@desplega.ai/agent-swarm 1.160.0 → 1.162.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 +4 -3
- package/dist/{acp-adapter-2mjwcsfh.js → acp-adapter-74m73ae9.js} +163 -49
- package/dist/{actions-e43rxskr.js → actions-4sr14gnt.js} +42 -38
- package/dist/{anthropic-messages-5qx80j9k.js → anthropic-messages-8xxrzky9.js} +22 -26
- package/dist/{app-mc7xfagn.js → app-pt68fbwp.js} +17 -14
- package/dist/{artifact-3v5t9jtg.js → artifact-fey7dvj9.js} +3 -2
- package/dist/{assistant-sedkzv3b.js → assistant-cv3jytks.js} +43 -39
- package/dist/{azure-openai-responses-nfb21z9a.js → azure-openai-responses-f5cqsyj8.js} +15 -10
- package/dist/{boot-reembed-m3656j2n.js → boot-reembed-4ht4gqth.js} +17 -14
- package/dist/{boot-reembed-cqz9swn5.js → boot-reembed-nxpcvpj9.js} +16 -13
- package/dist/{boot-scrub-logs-xbxf5d7w.js → boot-scrub-logs-k93kyw8k.js} +13 -10
- package/dist/boot-seeds-1skcrs0e.js +32 -0
- package/dist/{claude-adapter-dc6289mc.js → claude-adapter-r5g0tzge.js} +39 -30
- package/dist/{claude-managed-adapter-naaw51me.js → claude-managed-adapter-yxkfxg8j.js} +6 -5
- package/dist/{claude-managed-setup-eacvchx0.js → claude-managed-setup-pkyrgshb.js} +27 -27
- package/dist/{claude-sdk-session-bqp2xvym.js → claude-sdk-session-jxyxnrwd.js} +8041 -7910
- package/dist/{cli-4derpgyk.js → cli-2hhfhfq5.js} +6 -1
- package/dist/{cli-rykfmgwg.js → cli-2x0e561b.js} +1 -1
- package/dist/{cli-tzx2ke1v.js → cli-2zy95vhm.js} +137 -64
- package/dist/{cli-0x01kwrd.js → cli-4cwxn7gp.js} +47 -186
- package/dist/{cli-xjcywfsf.js → cli-4dcpaefp.js} +12 -11
- package/dist/{cli-v7fn5gms.js → cli-4x0csdjq.js} +164 -76
- package/dist/{cli-12tszpk9.js → cli-5bcd7sfy.js} +91 -29
- package/dist/{cli-jz4w45qt.js → cli-5k6k8ta3.js} +190 -50
- package/dist/{cli-tpq83z89.js → cli-5xhpb3kv.js} +20 -19
- package/dist/{cli-r1mxd1xh.js → cli-7af8yhav.js} +6 -179
- package/dist/{cli-jajnsm8q.js → cli-7tre70zp.js} +18160 -31345
- package/dist/{cli-447dt1h3.js → cli-8ev9xqnx.js} +218 -25
- package/dist/cli-bsky8g7w.js +449 -0
- package/dist/{cli-0z2v4nhw.js → cli-cat6h73s.js} +1 -1
- package/dist/{cli-25fcq4b4.js → cli-cebmgwsc.js} +15 -11
- package/dist/{cli-shkxm1vn.js → cli-cvatsam7.js} +189 -13
- package/dist/{cli-2658f6at.js → cli-cvk6yzw5.js} +6 -8
- package/dist/cli-dbmwby6a.js +9 -0
- package/dist/{cli-ptr8h7kp.js → cli-eg0b3p0k.js} +5 -218
- package/dist/cli-f9w1semm.js +413 -0
- package/dist/{cli-523679eh.js → cli-g739zqzt.js} +6 -5
- package/dist/{cli-dv6cdjs2.js → cli-gd4favx9.js} +28 -7
- package/dist/{cli-c8a36vcc.js → cli-gpqpmns7.js} +2 -2
- package/dist/{cli-5nbmpy8w.js → cli-hb5c2x5y.js} +1 -1
- package/dist/{cli-741yb0xx.js → cli-hmsw1gpy.js} +55 -169
- package/dist/{cli-qydf22qq.js → cli-jf7wmv1r.js} +2562 -735
- package/dist/{cli-mfe5btp9.js → cli-jxs2ygaw.js} +317 -121
- package/dist/{cli-kmcpfwn2.js → cli-jyy6pm2f.js} +19 -3
- package/dist/cli-kdkwd3yr.js +615 -0
- package/dist/{cli-6cs6wzxt.js → cli-kh04eqwe.js} +2 -2
- package/dist/{cli-9hsgwz4w.js → cli-kp42yek0.js} +1309 -391
- package/dist/cli-ma3zvh39.js +10404 -0
- package/dist/{cli-ybgv4kw2.js → cli-mbssg1xv.js} +9 -2
- package/dist/{cli-jsp14b6c.js → cli-mzfth0bp.js} +38 -1
- package/dist/{cli-r2ap2czm.js → cli-nexqx4ve.js} +6 -0
- package/dist/{cli-f8gy6r2r.js → cli-nq7yqw7b.js} +19 -8
- package/dist/{cli-10nhj6xq.js → cli-nt8hecg9.js} +34 -33
- package/dist/cli-p0r8sxj5.js +303 -0
- package/dist/{cli-58e8yr0d.js → cli-pkd6s2wy.js} +4 -2
- package/dist/{cli-a8dvhzrt.js → cli-q24re23n.js} +7 -5
- package/dist/cli-qjjvzwzd.js +222 -0
- package/dist/cli-qrgt5bqf.js +189 -0
- package/dist/{cli-et8m9xsv.js → cli-rfjw9jw2.js} +22 -10
- package/dist/{cli-7e398j1h.js → cli-rj0gqwwp.js} +3 -3
- package/dist/{cli-btfv8y88.js → cli-rnyzn44p.js} +2 -2
- package/dist/{cli-d5czme6m.js → cli-s3hwpt9v.js} +4754 -4945
- package/dist/{cli-0jwe9034.js → cli-sptrj5f5.js} +3 -3
- package/dist/{cli-0q3avq3s.js → cli-sqvfa090.js} +19 -11
- package/dist/{cli-azhgzetg.js → cli-swfmp1fx.js} +27 -27
- package/dist/{cli-jyk0ynw2.js → cli-t845n9xk.js} +23 -10
- package/dist/{cli-zpep9q5e.js → cli-tcen9p5w.js} +20 -15
- package/dist/{cli-74h9hscv.js → cli-tre4bdgq.js} +1 -1
- package/dist/{cli-pm1rst0h.js → cli-twrh04ap.js} +30 -15
- package/dist/{cli-phsaj4xq.js → cli-v0pvvhfq.js} +1 -1
- package/dist/{cli-ydmcgve1.js → cli-vc9bp061.js} +5 -5
- package/dist/{cli-g2whhdrf.js → cli-vxe6qa4h.js} +1 -1
- package/dist/{cli-vctdqs5h.js → cli-vy3ed88x.js} +15 -2
- package/dist/{cli-br0qdrnp.js → cli-vyqs9ya8.js} +18 -18
- package/dist/{cli-cpvsaqsw.js → cli-w0bwte75.js} +8 -5
- package/dist/cli-wbvnn6tk.js +861 -0
- package/dist/{cli-r94z9p1z.js → cli-wgbezhw2.js} +3 -0
- package/dist/{cli-evvtk35y.js → cli-wjgs5wxe.js} +7 -7
- package/dist/cli-wxkkd0e0.js +33 -0
- package/dist/{cli-0wgxmwf6.js → cli-xk79303e.js} +20 -7
- package/dist/{cli-ktmyrtpn.js → cli-xqpk3rp7.js} +33 -10
- package/dist/{cli-ygwm91nt.js → cli-yy6dew39.js} +1 -1
- package/dist/cli-zp38xvtm.js +9487 -0
- package/dist/{cli-tfky2838.js → cli-zvhd3f64.js} +4 -4
- package/dist/{cli-jayjpjmb.js → cli-zxqx25nz.js} +66 -23
- package/dist/cli.js +40 -32
- package/dist/{cloudflare-workers-ai-system-one-k6fbxw9d.js → cloudflare-workers-ai-system-one-k8ddqjkq.js} +8 -6
- package/dist/{codex-adapter-nmxcatww.js → codex-adapter-esvmnhn7.js} +24 -23
- package/dist/{codex-hook-20me6byw.js → codex-hook-m73jmqgx.js} +19 -3
- package/dist/{codex-login-w6fz4xbz.js → codex-login-cf7mzsgg.js} +2 -2
- package/dist/{codex-session-runner-90aa80ev.js → codex-session-runner-ban9excr.js} +24 -23
- package/dist/{commands-8wcq1kn7.js → commands-75413p2n.js} +13 -10
- package/dist/{db-j40kc4se.js → db-7f5pecwg.js} +17 -10
- package/dist/{dispatcher-4zqy768d.js → dispatcher-fh9at8nz.js} +41 -37
- package/dist/dsh-adapter-wpze65d4.js +24 -0
- package/dist/{e2b-ez07znam.js → e2b-gjgdjp91.js} +12 -9
- package/dist/easter-egg-3d-3w5c2n4c.js +1057 -0
- package/dist/{execute-6e7qeyk4.js → execute-f50wg9nh.js} +203 -49
- package/dist/{google-generative-ai-k6n5nbpp.js → google-generative-ai-jxxpnegy.js} +2 -2
- package/dist/{google-vertex-44xxtcvp.js → google-vertex-x7q1angm.js} +5 -5
- package/dist/{handlers-kjdce1w5.js → handlers-w13787bb.js} +44 -40
- package/dist/{hook-r2t4bqfg.js → hook-46g1jrvx.js} +34 -20
- package/dist/{hook-czx13n12.js → hook-4tpts2ry.js} +25 -21
- package/dist/{http-3bbb19be.js → http-19pzbfrt.js} +1440 -283
- package/dist/{index-668me3f0.js → index-8fd4dm4h.js} +42 -38
- package/dist/{index-fg0dsp6c.js → index-dqmp15bq.js} +41 -37
- package/dist/{index-kkv84jq9.js → index-qb4q1y3e.js} +41 -37
- package/dist/index-s75wc4wd.js +33 -0
- package/dist/{index-zg7vp46x.js → index-scptvdxg.js} +64 -38
- package/dist/{keepalive-yra8dy57.js → keepalive-xa5ts9cd.js} +15 -12
- package/dist/{lead-va0pad2c.js → lead-qp4xkvjq.js} +59 -54
- package/dist/{maintenance-hqewtmyg.js → maintenance-rm5885hm.js} +17 -14
- package/dist/{mistral-conversations-pc3ntnxt.js → mistral-conversations-rw7fbt22.js} +4 -4
- package/dist/{node-a5e00qhp.js → node-8zkdq42h.js} +834 -833
- package/dist/node-f0ykebbv.js +2107 -0
- package/dist/node-wyamey5r.js +19 -0
- package/dist/{oauth-refresh-sweep-7rdt1m9n.js → oauth-refresh-sweep-1csdfebf.js} +14 -11
- package/dist/{onboard-j6ms6d0x.js → onboard-r6b78cs4.js} +10 -10
- package/dist/{openai-codex-responses-bbancrr0.js → openai-codex-responses-efvrgrq3.js} +4 -4
- package/dist/{openai-completions-jpaj5g2b.js → openai-completions-bbbrrz4z.js} +12 -8
- package/dist/{openai-responses-200k1wx4.js → openai-responses-9jjyrcm1.js} +15 -10
- package/dist/{opencode-adapter-89rabkw2.js → opencode-adapter-kb3g6pkf.js} +12 -9
- package/dist/{otel-impl-a792rjz0.js → otel-impl-0y9knpky.js} +6 -6
- package/dist/{pi-mono-adapter-g7qzvr3v.js → pi-mono-adapter-z6s1bme2.js} +128 -37
- package/dist/{pricing-refresh-wx0tp7cb.js → pricing-refresh-mth26tgp.js} +15 -12
- package/dist/{rbac-roles-8tzawacv.js → rbac-roles-kwntb23q.js} +17 -12
- package/dist/rbac-roles-vpk4ebm8.js +45 -0
- package/dist/{registry-v5wytg0s.js → registry-km6t1jd2.js} +1 -1
- package/dist/{render-v2-mm7zswb8.js → render-v2-hcm7h00y.js} +17 -14
- package/dist/{runtime-zyssgse0.js → runtime-vfjsfsc5.js} +5 -4
- package/dist/{setup-8y70ys6t.js → setup-hbyzd65h.js} +2 -2
- package/dist/{virtual-modules-6nmk7h3n.js → virtual-modules-9bv7ry91.js} +9 -7
- package/dist/{work-objects-fg6xkb0n.js → work-objects-m09sxnhe.js} +44 -40
- package/dist/{worker-wmwhxsph.js → worker-0h35rvk4.js} +59 -54
- package/dist/{x-n3e0v3xa.js → x-f1gt1pz3.js} +2 -2
- package/openapi.json +699 -26
- package/package.json +19 -11
- package/src/azure-devops/api.ts +121 -0
- package/src/azure-devops/auth.ts +78 -0
- package/src/azure-devops/handlers.ts +413 -0
- package/src/azure-devops/index.ts +27 -0
- package/src/azure-devops/templates.ts +108 -0
- package/src/azure-devops/types.ts +90 -0
- package/src/be/api-drain.ts +184 -0
- package/src/be/db/tasks/read.ts +32 -7
- package/src/be/db/tasks/write.ts +21 -4
- package/src/be/db-client.ts +11 -2
- package/src/be/db-retention.ts +95 -32
- package/src/be/db.ts +44 -19
- package/src/be/memory/constants.ts +16 -0
- package/src/be/memory/graph-expansion.ts +8 -1
- package/src/be/memory/index-content.ts +20 -1
- package/src/be/memory/key-guard.ts +93 -0
- package/src/be/memory/key-paths.ts +103 -0
- package/src/be/memory/link-resolver.ts +29 -3
- package/src/be/memory/providers/sqlite-store.ts +152 -45
- package/src/be/memory/raters/llm-summarizer.ts +10 -4
- package/src/be/memory/raters/llm.ts +15 -5
- package/src/be/memory/raters/store.ts +6 -3
- package/src/be/memory/raters/types.ts +11 -0
- package/src/be/memory/reranker.ts +38 -7
- package/src/be/memory/types.ts +12 -1
- package/src/be/migrations/190_memory_rating_model.sql +7 -0
- package/src/be/migrations/191_context_versions_previous_index.sql +8 -0
- package/src/be/migrations/192_favorites_agent_fs_path.sql +36 -0
- package/src/be/onboarding.ts +7 -1
- package/src/be/pricing-normalize.ts +4 -2
- package/src/be/scripts/typecheck.ts +4 -3
- package/src/be/seed-pricing.ts +16 -0
- package/src/be/seed-prompt-templates.ts +1 -0
- package/src/be/swarm-config-guard.ts +46 -17
- package/src/be/task-citations.ts +11 -5
- package/src/be/users.ts +3 -0
- package/src/cli.tsx +3 -2
- package/src/comb/agent-fs.ts +39 -0
- package/src/comb/config.ts +37 -0
- package/src/comb/markers.ts +37 -0
- package/src/comb/review-batch.ts +486 -0
- package/src/comb/templates.ts +88 -0
- package/src/commands/claude-managed-setup.ts +33 -31
- package/src/commands/context-preamble.ts +4 -1
- package/src/commands/hook.ts +2 -1
- package/src/commands/provider-credentials.ts +28 -15
- package/src/commands/runner.ts +458 -110
- package/src/commands/templates.ts +10 -0
- package/src/e2b/env.ts +2 -0
- package/src/extensions/catalog.generated.json +17 -0
- package/src/extensions/contract-types.generated.ts +1 -1
- package/src/fs/agent-fs-provider.ts +106 -2
- package/src/github/handlers.ts +10 -74
- package/src/github/reactions.ts +119 -138
- package/src/github/task-reactions.ts +34 -11
- package/src/heartbeat/heartbeat.ts +4 -0
- package/src/hooks/codex-hook.ts +25 -1
- package/src/hooks/hook.ts +14 -1
- package/src/hooks/pr-body-guard.ts +983 -0
- package/src/http/agents.ts +1 -1
- package/src/http/all-routes.ts +1 -0
- package/src/http/assets.ts +5 -17
- package/src/http/comb.ts +131 -0
- package/src/http/core.ts +14 -1
- package/src/http/extensions.ts +51 -27
- package/src/http/fs.ts +9 -17
- package/src/http/index.ts +27 -9
- package/src/http/mcp-user.ts +8 -13
- package/src/http/mcp.ts +19 -12
- package/src/http/memory.ts +80 -14
- package/src/http/onboarding.ts +21 -2
- package/src/http/poll.ts +30 -3
- package/src/http/realtime.ts +62 -0
- package/src/http/request-principal.ts +22 -0
- package/src/http/session-data.ts +6 -4
- package/src/http/stats.ts +1 -0
- package/src/http/status.ts +34 -2
- package/src/http/tasks.ts +17 -3
- package/src/http/users.ts +1 -1
- package/src/http/webhooks.ts +120 -2
- package/src/kv-reserved-namespaces.ts +10 -5
- package/src/providers/claude-adapter.ts +84 -16
- package/src/providers/claude-managed-adapter.ts +29 -2
- package/src/providers/codex-adapter.ts +1 -1
- package/src/providers/codex-skill-resolver.ts +6 -0
- package/src/providers/dsh-adapter.ts +204 -7
- package/src/providers/opencode-adapter.ts +24 -3
- package/src/providers/pi-mono-adapter.ts +154 -5
- package/src/providers/pi-mono-extension.ts +1 -1
- package/src/providers/pricing-sources.md +5 -1
- package/src/providers/reasoning-effort.ts +10 -2
- package/src/providers/types.ts +1 -1
- package/src/rbac/legacy-policy.ts +3 -0
- package/src/rbac/permissions.ts +14 -0
- package/src/realtime/auth.ts +63 -1
- package/src/realtime/tickets.ts +52 -0
- package/src/realtime/transport.ts +51 -22
- package/src/scripts-runtime/types/stdlib.d.ts +13 -5
- package/src/scripts-runtime/types/swarm-extension.d.ts +7 -3
- package/src/scripts-runtime/types/swarm-sdk.d.ts +13 -5
- package/src/tasks/context-key.ts +38 -1
- package/src/telemetry-context.ts +175 -0
- package/src/telemetry-contract/EVENTS.md +81 -0
- package/src/telemetry-contract/SOURCE.json +9 -0
- package/src/telemetry-contract/catalog.json +1335 -0
- package/src/telemetry-contract/index.ts +60 -0
- package/src/telemetry-contract/types.gen.ts +1971 -0
- package/src/telemetry-identity.ts +129 -0
- package/src/telemetry-snapshot.ts +211 -0
- package/src/telemetry-trigger.ts +125 -0
- package/src/telemetry-types.typetest.ts +40 -0
- package/src/telemetry.ts +271 -67
- package/src/tests/api-drain-e2e.test.ts +249 -0
- package/src/tests/api-drain-worker-e2e.test.ts +216 -0
- package/src/tests/api-drain.test.ts +351 -0
- package/src/tests/azure-devops-auth.test.ts +100 -0
- package/src/tests/azure-devops-handlers.test.ts +324 -0
- package/src/tests/azure-devops-webhook-malformed.test.ts +96 -0
- package/src/tests/claude-default-route.test.ts +260 -0
- package/src/tests/claude-managed-adapter.test.ts +47 -0
- package/src/tests/claude-managed-setup.test.ts +48 -0
- package/src/tests/claude-prompt-body-once.test.ts +117 -0
- package/src/tests/claude-routes-e2e.test.ts +316 -0
- package/src/tests/comb-config-guard.test.ts +38 -0
- package/src/tests/comb-links.test.ts +162 -0
- package/src/tests/comb-markers.test.ts +68 -0
- package/src/tests/comb-review-batch.test.ts +770 -0
- package/src/tests/comb-status.test.ts +152 -0
- package/src/tests/context-versions-retention.test.ts +314 -0
- package/src/tests/core-auth.test.ts +7 -0
- package/src/tests/db-retention.test.ts +14 -14
- package/src/tests/db-task-read-contract.test.ts +3 -0
- package/src/tests/db-task-write-contract.test.ts +3 -0
- package/src/tests/docs-index-footprint.test.js +3 -3
- package/src/tests/dsh-adapter.test.ts +134 -2
- package/src/tests/dsh-usage.test.ts +153 -0
- package/src/tests/extensions-catalog.test.ts +1 -0
- package/src/tests/extensions-example-deploy-awareness.test.ts +301 -0
- package/src/tests/extensions-http.test.ts +137 -10
- package/src/tests/extensions-mcp-tools.test.ts +28 -0
- package/src/tests/favorites-agent-fs-path.test.ts +226 -0
- package/src/tests/fetch-resolved-env.test.ts +24 -0
- package/src/tests/fixtures/azure-devops/pull-request-commented.json +129 -0
- package/src/tests/fixtures/azure-devops/pull-request-created.json +88 -0
- package/src/tests/fixtures/fake-claude-routes.ts +229 -0
- package/src/tests/github-handlers-reactions.test.ts +486 -0
- package/src/tests/github-reactions.test.ts +280 -0
- package/src/tests/harness-cli-version.test.ts +62 -0
- package/src/tests/http-api-integration.test.ts +21 -0
- package/src/tests/http-task-write-ownership.test.ts +24 -1
- package/src/tests/internal-ai/complete-structured.test.ts +94 -0
- package/src/tests/internal-ai/credentials.test.ts +22 -0
- package/src/tests/internal-ai/models.test.ts +36 -2
- package/src/tests/internal-ai/schema-parity.test.ts +25 -1
- package/src/tests/internal-ai/summarize-session.test.ts +23 -7
- package/src/tests/mcp-user-route.test.ts +133 -0
- package/src/tests/memory-key-paths.test.ts +1055 -0
- package/src/tests/memory-link-resolver.test.ts +34 -0
- package/src/tests/memory-rate-endpoint.test.ts +66 -0
- package/src/tests/memory-rater-llm-summarizer.test.ts +2 -1
- package/src/tests/memory-rater-llm.test.ts +73 -0
- package/src/tests/memory-rater-store.test.ts +31 -0
- package/src/tests/memory-reranker.test.ts +40 -0
- package/src/tests/onboarding.test.ts +108 -0
- package/src/tests/opencode-adapter.test.ts +57 -0
- package/src/tests/opencode-plugin.test.ts +4 -0
- package/src/tests/pi-codemode.test.ts +82 -4
- package/src/tests/pi-mono-adapter.test.ts +265 -2
- package/src/tests/pr-body-leaks.test.ts +789 -0
- package/src/tests/preload.ts +14 -0
- package/src/tests/provider-registration.test.ts +0 -2
- package/src/tests/providers/pi-cost.test.ts +190 -4
- package/src/tests/rbac-engine.test.ts +25 -1
- package/src/tests/realtime-room-auth.test.ts +104 -1
- package/src/tests/realtime-tickets.test.ts +74 -0
- package/src/tests/realtime-transport.test.ts +131 -4
- package/src/tests/runner-api-drain.test.ts +301 -0
- package/src/tests/runner-fallback-output.test.ts +61 -0
- package/src/tests/runner-fenced-json-output.test.ts +178 -0
- package/src/tests/runner-slot-reconcile.test.ts +199 -0
- package/src/tests/script-connections.test.ts +6 -0
- package/src/tests/send-task-requested-by.test.ts +133 -15
- package/src/tests/session-costs-recompute-all-providers.test.ts +23 -0
- package/src/tests/task-lifecycle-telemetry.test.ts +8 -3
- package/src/tests/task-reactions.test.ts +29 -6
- package/src/tests/telemetry-context.test.ts +314 -0
- package/src/tests/telemetry-init.test.ts +51 -19
- package/src/tests/telemetry-snapshot.test.ts +229 -0
- package/src/tests/telemetry-trigger.test.ts +200 -0
- package/src/tests/template-registry-helpers.ts +1 -0
- package/src/tests/vcs-azure-devops.test.ts +73 -0
- package/src/tests/webhooks-task-blocked.test.ts +23 -0
- package/src/tests/workflow-agent-task-retry.test.ts +363 -0
- package/src/tests/workflow-definition-telemetry.test.ts +4 -4
- package/src/tests/workflow-llm.test.ts +14 -0
- package/src/tools/context-diff.ts +20 -0
- package/src/tools/extension-install.ts +27 -16
- package/src/tools/memory-edit.ts +47 -3
- package/src/tools/memory-search.ts +13 -1
- package/src/tools/memory-store.ts +55 -3
- package/src/tools/poll-task.ts +20 -1
- package/src/tools/send-task.ts +9 -1
- package/src/tools/task-action.ts +11 -0
- package/src/types.ts +45 -8
- package/src/utils/api-drain.ts +24 -0
- package/src/utils/constants.ts +57 -16
- package/src/utils/credentials.test.ts +31 -1
- package/src/utils/credentials.ts +20 -9
- package/src/utils/dsh-usage.ts +53 -0
- package/src/utils/harness-cli-version.ts +6 -4
- package/src/utils/internal-ai/complete-structured.ts +26 -3
- package/src/utils/internal-ai/credentials.ts +23 -9
- package/src/utils/internal-ai/index.ts +8 -1
- package/src/utils/internal-ai/models.ts +34 -8
- package/src/utils/internal-ai/summarize-session.ts +22 -8
- package/src/utils/pr-body-leaks.ts +172 -0
- package/src/utils/secret-scrubber.ts +8 -0
- package/src/utils/task-attachment-links.ts +14 -8
- package/src/vcs/azure-devops.ts +80 -0
- package/src/vcs/index.ts +5 -1
- package/src/vcs/types.ts +2 -2
- package/src/workflows/recovery.ts +26 -1
- package/src/workflows/resume.ts +31 -4
- package/src/workflows/task-step-routing.ts +75 -2
- package/templates/community/open-prompt-showreel/PLAYBOOK.md +336 -0
- package/templates/community/open-prompt-showreel/README.md +33 -0
- package/templates/community/open-prompt-showreel/example/tla-races/facts.ts +145 -0
- package/templates/community/open-prompt-showreel/example/tla-races/facts.v3.json +140 -0
- package/templates/community/open-prompt-showreel/example/tla-races/music.mist-city.json +8 -0
- package/templates/community/open-prompt-showreel/example/tla-races/reel.html +805 -0
- package/templates/community/open-prompt-showreel/example/tla-races/smoke.sh +48 -0
- package/templates/community/open-prompt-showreel/lead-prompt.md +89 -0
- package/templates/community/open-prompt-showreel/setup.sh +167 -0
- package/templates/community/open-prompt-showreel/skills/motion-design-replication/SKILL.md +85 -0
- package/templates/community/open-prompt-showreel/skills/motion-design-video-analysis/SKILL.md +115 -0
- package/templates/community/open-prompt-showreel/skills/open-prompt-showreel/SKILL.md +147 -0
- package/templates/community/open-prompt-showreel/skills/video-generation/SKILL.md +195 -0
- package/templates/community/open-prompt-showreel/tools/fetch-music.sh +65 -0
- package/templates/community/open-prompt-showreel/tools/music-analyze.py +69 -0
- package/templates/community/open-prompt-showreel/tools/music-current.sh +34 -0
- package/templates/community/open-prompt-showreel/tools/music-cut.sh +36 -0
- package/templates/community/open-prompt-showreel/tools/music-refine.py +39 -0
- package/templates/community/open-prompt-showreel/tools/render.mjs +157 -0
- package/templates/community/open-prompt-showreel/tools/sheet.sh +44 -0
- package/templates/community/open-prompt-showreel/tools/web-compress.sh +17 -0
- package/templates/community/open-prompt-showreel/tools/x-reencode.sh +21 -0
- package/templates/extensions/README.md +1 -0
- package/templates/extensions/deploy-awareness/README.md +28 -0
- package/templates/extensions/deploy-awareness/hooks.ts +152 -0
- package/templates/extensions/deploy-awareness/manifest.json +8 -0
- package/templates/skills/memory/config.json +2 -2
- package/templates/skills/memory/content.md +59 -5
- package/templates/skills/swarm-extensions/config.json +1 -1
- package/templates/skills/swarm-extensions/content.md +28 -5
- package/tsconfig.json +3 -0
- package/dist/boot-seeds-gsetbs5y.js +0 -28
- package/dist/cli-j490egb5.js +0 -5632
- package/dist/cli-tjf4cn8z.js +0 -9119
- package/dist/cli-tmqt7dpj.js +0 -572
- package/dist/dsh-adapter-mpnzgztj.js +0 -19
- package/dist/index-7aj368tw.js +0 -30
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
checkpointPortStepAndResolveSuccessors,
|
|
25
25
|
completeTaskStepAndResolveSuccessors,
|
|
26
26
|
failStepAndRunIfWaiting,
|
|
27
|
+
scheduleTaskStepRetry,
|
|
27
28
|
} from "./task-step-routing";
|
|
28
29
|
|
|
29
30
|
/**
|
|
@@ -171,6 +172,24 @@ async function recoverWaitingRuns(registry: ExecutorRegistry): Promise<number> {
|
|
|
171
172
|
if (!run || run.status !== "waiting" || !workflow) continue;
|
|
172
173
|
|
|
173
174
|
const taskCompleted = stuck.taskStatus === "completed";
|
|
175
|
+
if (stuck.taskStatus === "failed") {
|
|
176
|
+
// Same retry policy as the live task.failed handler: this sweep can
|
|
177
|
+
// reach a failed task first, and must not bypass the node's retry.
|
|
178
|
+
// `stuck` is a snapshot: the live handler and retry poller may have
|
|
179
|
+
// redriven the step to a new task since, so every claim below is
|
|
180
|
+
// fenced on `stuck.taskId` still being the task bound to the step.
|
|
181
|
+
const failedStep = await getWorkflowRunStep(stuck.stepId);
|
|
182
|
+
if (!failedStep) continue;
|
|
183
|
+
const retry = await scheduleTaskStepRetry(
|
|
184
|
+
workflow.definition,
|
|
185
|
+
stuck.runId,
|
|
186
|
+
failedStep,
|
|
187
|
+
stuck.taskId,
|
|
188
|
+
"Task failed (recovered)",
|
|
189
|
+
);
|
|
190
|
+
if (retry === "scheduled") recovered++;
|
|
191
|
+
if (retry !== "not-eligible") continue;
|
|
192
|
+
}
|
|
174
193
|
if (!taskCompleted && (workflow.definition.onNodeFailure ?? "fail") === "fail") {
|
|
175
194
|
// Preserve the fail-fast recovery policy for failed/cancelled tasks.
|
|
176
195
|
// Claimed: this sweep runs on every heartbeat, so the live task.failed
|
|
@@ -178,7 +197,12 @@ async function recoverWaitingRuns(registry: ExecutorRegistry): Promise<number> {
|
|
|
178
197
|
// would kill a run that is already advancing.
|
|
179
198
|
const reason =
|
|
180
199
|
stuck.taskStatus === "failed" ? "Task failed (recovered)" : "Task cancelled (recovered)";
|
|
181
|
-
const claimed = await failStepAndRunIfWaiting(
|
|
200
|
+
const claimed = await failStepAndRunIfWaiting(
|
|
201
|
+
stuck.stepId,
|
|
202
|
+
stuck.runId,
|
|
203
|
+
reason,
|
|
204
|
+
stuck.taskId,
|
|
205
|
+
);
|
|
182
206
|
if (!claimed) continue;
|
|
183
207
|
recovered++;
|
|
184
208
|
continue;
|
|
@@ -202,6 +226,7 @@ async function recoverWaitingRuns(registry: ExecutorRegistry): Promise<number> {
|
|
|
202
226
|
stepOutput,
|
|
203
227
|
ctx,
|
|
204
228
|
taskCompleted ? undefined : reason,
|
|
229
|
+
stuck.taskId,
|
|
205
230
|
);
|
|
206
231
|
if (!routing.claimed) continue;
|
|
207
232
|
if (routing.foreachChild && !routing.joined) {
|
package/src/workflows/resume.ts
CHANGED
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
checkpointPortStepAndResolveSuccessors,
|
|
39
39
|
completeTaskStepAndResolveSuccessors,
|
|
40
40
|
failStepAndRunIfWaiting,
|
|
41
|
+
scheduleTaskStepRetry,
|
|
41
42
|
} from "./task-step-routing";
|
|
42
43
|
import { matchesFilter } from "./wait-filter";
|
|
43
44
|
|
|
@@ -87,7 +88,9 @@ export function setupWorkflowResumeListener(
|
|
|
87
88
|
try {
|
|
88
89
|
const event = data as TaskEvent;
|
|
89
90
|
if (!event.workflowRunId || !event.workflowRunStepId) return;
|
|
90
|
-
await handleTaskFailure(event, event.failureReason ?? "Task failed", registry
|
|
91
|
+
await handleTaskFailure(event, event.failureReason ?? "Task failed", registry, {
|
|
92
|
+
retryable: true,
|
|
93
|
+
});
|
|
91
94
|
} catch (err) {
|
|
92
95
|
console.error("[workflows] Handle task failure error:", err);
|
|
93
96
|
}
|
|
@@ -98,7 +101,7 @@ export function setupWorkflowResumeListener(
|
|
|
98
101
|
try {
|
|
99
102
|
const event = data as TaskEvent;
|
|
100
103
|
if (!event.workflowRunId || !event.workflowRunStepId) return;
|
|
101
|
-
await handleTaskFailure(event, "Task was cancelled", registry);
|
|
104
|
+
await handleTaskFailure(event, "Task was cancelled", registry, { retryable: false });
|
|
102
105
|
} catch (err) {
|
|
103
106
|
console.error("[workflows] Handle task cancellation error:", err);
|
|
104
107
|
}
|
|
@@ -213,7 +216,10 @@ export async function finalizeOrWait(runId: string): Promise<void> {
|
|
|
213
216
|
if (run?.status === "waiting") await updateWorkflowRun(runId, { status: "running" });
|
|
214
217
|
return;
|
|
215
218
|
}
|
|
216
|
-
|
|
219
|
+
// A step queued for the retry poller is still live, like a waiting one.
|
|
220
|
+
const hasWaiting = steps.some(
|
|
221
|
+
(s) => s.status === "waiting" || (s.status === "failed" && s.nextRetryAt != null),
|
|
222
|
+
);
|
|
217
223
|
if (hasWaiting) {
|
|
218
224
|
await updateWorkflowRun(runId, { status: "waiting" });
|
|
219
225
|
} else {
|
|
@@ -227,7 +233,10 @@ export async function finalizeOrWait(runId: string): Promise<void> {
|
|
|
227
233
|
}
|
|
228
234
|
|
|
229
235
|
/**
|
|
230
|
-
* Handle task failure/cancellation
|
|
236
|
+
* Handle task failure/cancellation.
|
|
237
|
+
* A failed (never cancelled) task of an agent-task node with `retry` and
|
|
238
|
+
* attempts left is re-dispatched through the retry poller first.
|
|
239
|
+
* Otherwise the workflow's onNodeFailure config applies:
|
|
231
240
|
* 'fail' (default): mark the entire run as failed.
|
|
232
241
|
* 'continue': treat as completed with error output, let convergence proceed.
|
|
233
242
|
*/
|
|
@@ -235,6 +244,7 @@ async function handleTaskFailure(
|
|
|
235
244
|
event: TaskEvent,
|
|
236
245
|
reason: string,
|
|
237
246
|
registry: ExecutorRegistry,
|
|
247
|
+
options: { retryable: boolean },
|
|
238
248
|
): Promise<void> {
|
|
239
249
|
const run = await getWorkflowRun(event.workflowRunId!);
|
|
240
250
|
if (!run || (run.status !== "waiting" && run.status !== "running")) return;
|
|
@@ -246,6 +256,23 @@ async function handleTaskFailure(
|
|
|
246
256
|
const workflow = await getWorkflow(run.workflowId);
|
|
247
257
|
if (!workflow) return;
|
|
248
258
|
|
|
259
|
+
if (options.retryable) {
|
|
260
|
+
const retry = await scheduleTaskStepRetry(
|
|
261
|
+
workflow.definition,
|
|
262
|
+
run.id,
|
|
263
|
+
step,
|
|
264
|
+
event.taskId,
|
|
265
|
+
reason,
|
|
266
|
+
);
|
|
267
|
+
if (retry === "scheduled") {
|
|
268
|
+
console.log(
|
|
269
|
+
`[workflows] Task ${event.taskId} failed; step ${step.nodeId} of run ${run.id} queued for retry ${step.retryCount + 1}`,
|
|
270
|
+
);
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
if (retry === "not-claimed") return;
|
|
274
|
+
}
|
|
275
|
+
|
|
249
276
|
const onFailure = workflow.definition.onNodeFailure ?? "fail";
|
|
250
277
|
|
|
251
278
|
if (onFailure === "fail") {
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
|
+
detachTaskFromWorkflowRunStep,
|
|
2
3
|
getDbClient,
|
|
4
|
+
getTaskById,
|
|
3
5
|
getWorkflowRunStep,
|
|
4
6
|
updateWorkflowRun,
|
|
5
7
|
updateWorkflowRunStep,
|
|
6
8
|
} from "../be/db";
|
|
7
|
-
import
|
|
8
|
-
|
|
9
|
+
import {
|
|
10
|
+
RetryPolicySchema,
|
|
11
|
+
type WorkflowDefinition,
|
|
12
|
+
type WorkflowNode,
|
|
13
|
+
type WorkflowRunStep,
|
|
14
|
+
} from "../types";
|
|
15
|
+
import { checkpointStep, checkpointStepFailure } from "./checkpoint";
|
|
9
16
|
import { getSuccessors } from "./definition";
|
|
10
17
|
import { joinForeach, resolveForeachParent } from "./foreach-join";
|
|
11
18
|
|
|
@@ -15,21 +22,36 @@ export interface PortStepRoutingResult {
|
|
|
15
22
|
successors: WorkflowNode[];
|
|
16
23
|
}
|
|
17
24
|
|
|
25
|
+
/**
|
|
26
|
+
* True while `taskId` is still the task bound to `stepId`. A retry detaches
|
|
27
|
+
* the failed task and the poller binds a fresh one to the same step, so a
|
|
28
|
+
* caller holding an older snapshot (the recovery sweep) can find the step
|
|
29
|
+
* `waiting` again on a task it never saw. Call inside the claim transaction.
|
|
30
|
+
*/
|
|
31
|
+
async function isTaskBoundToStep(taskId: string, stepId: string): Promise<boolean> {
|
|
32
|
+
const task = await getTaskById(taskId);
|
|
33
|
+
return task?.workflowRunStepId === stepId;
|
|
34
|
+
}
|
|
35
|
+
|
|
18
36
|
/**
|
|
19
37
|
* Atomically fail a waiting step and its run. Returns false when another
|
|
20
38
|
* handler already moved the step out of `waiting` — the same task terminal
|
|
21
39
|
* event can reach both the live bus listener and a recovery sweep, and a
|
|
22
40
|
* blind write here would stomp a run another handler is already advancing.
|
|
41
|
+
* With `ownerTaskId`, also returns false when that task is no longer the one
|
|
42
|
+
* bound to the step (a stale snapshot of a step that was since redriven).
|
|
23
43
|
*/
|
|
24
44
|
export async function failStepAndRunIfWaiting(
|
|
25
45
|
stepId: string,
|
|
26
46
|
runId: string,
|
|
27
47
|
reason: string,
|
|
48
|
+
ownerTaskId?: string,
|
|
28
49
|
): Promise<boolean> {
|
|
29
50
|
const now = new Date().toISOString();
|
|
30
51
|
return await getDbClient().transaction(async () => {
|
|
31
52
|
const current = await getWorkflowRunStep(stepId);
|
|
32
53
|
if (!current || current.status !== "waiting") return false;
|
|
54
|
+
if (ownerTaskId && !(await isTaskBoundToStep(ownerTaskId, stepId))) return false;
|
|
33
55
|
await updateWorkflowRunStep(stepId, {
|
|
34
56
|
status: "failed",
|
|
35
57
|
error: reason,
|
|
@@ -69,6 +91,54 @@ export async function checkpointPortStepAndResolveSuccessors(
|
|
|
69
91
|
});
|
|
70
92
|
}
|
|
71
93
|
|
|
94
|
+
/**
|
|
95
|
+
* Outcome of `scheduleTaskStepRetry`:
|
|
96
|
+
* - `scheduled`: the step is queued for the retry poller; the caller stops.
|
|
97
|
+
* - `not-claimed`: another handler already moved the step out of `waiting`,
|
|
98
|
+
* or the failed task is no longer the one bound to the step (it was
|
|
99
|
+
* already retried and a fresh task now owns it); the caller stops.
|
|
100
|
+
* - `not-eligible`: no retry applies (no `node.retry`, not an agent-task node,
|
|
101
|
+
* or retries exhausted); the caller applies `onNodeFailure` as before.
|
|
102
|
+
*/
|
|
103
|
+
export type TaskStepRetryOutcome = "scheduled" | "not-claimed" | "not-eligible";
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Apply a node's `retry` policy to a FAILED agent-task step task. The sync
|
|
107
|
+
* executor path does this in `executeStep`; an async agent-task step only
|
|
108
|
+
* learns about the failure here, from `task.failed` or the recovery sweep.
|
|
109
|
+
*
|
|
110
|
+
* In one transaction: re-claim the step while it is still `waiting` AND still
|
|
111
|
+
* bound to the failed task, detach that task (the executor reuses any task
|
|
112
|
+
* bound to the step, so a bound failed task would park the retry forever), and
|
|
113
|
+
* record the failure with `nextRetryAt` so the retry poller re-dispatches a new
|
|
114
|
+
* task. Bounded by `maxRetries` via the step's persisted `retryCount`, read
|
|
115
|
+
* only after ownership is confirmed: a stale caller's step snapshot may carry
|
|
116
|
+
* the counter of a newer attempt.
|
|
117
|
+
*/
|
|
118
|
+
export async function scheduleTaskStepRetry(
|
|
119
|
+
def: WorkflowDefinition,
|
|
120
|
+
runId: string,
|
|
121
|
+
step: WorkflowRunStep,
|
|
122
|
+
taskId: string,
|
|
123
|
+
reason: string,
|
|
124
|
+
): Promise<TaskStepRetryOutcome> {
|
|
125
|
+
const node = def.nodes.find((n) => n.id === step.nodeId);
|
|
126
|
+
if (!node || node.type !== "agent-task" || !node.retry) return "not-eligible";
|
|
127
|
+
const parsed = RetryPolicySchema.safeParse(node.retry);
|
|
128
|
+
if (!parsed.success) return "not-eligible";
|
|
129
|
+
const policy = parsed.data;
|
|
130
|
+
|
|
131
|
+
return await getDbClient().transaction(async (): Promise<TaskStepRetryOutcome> => {
|
|
132
|
+
const current = await getWorkflowRunStep(step.id);
|
|
133
|
+
if (!current || current.status !== "waiting") return "not-claimed";
|
|
134
|
+
if (!(await isTaskBoundToStep(taskId, step.id))) return "not-claimed";
|
|
135
|
+
if (current.retryCount >= policy.maxRetries) return "not-eligible";
|
|
136
|
+
await detachTaskFromWorkflowRunStep(taskId);
|
|
137
|
+
await checkpointStepFailure(runId, step.id, reason, current.retryCount, policy);
|
|
138
|
+
return "scheduled";
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
|
|
72
142
|
export interface TaskStepRoutingResult {
|
|
73
143
|
/**
|
|
74
144
|
* False when another handler already moved the step out of `waiting` — the
|
|
@@ -100,6 +170,7 @@ export async function completeTaskStepAndResolveSuccessors(
|
|
|
100
170
|
output: unknown,
|
|
101
171
|
ctx: Record<string, unknown>,
|
|
102
172
|
failureReason?: string,
|
|
173
|
+
ownerTaskId?: string,
|
|
103
174
|
): Promise<TaskStepRoutingResult> {
|
|
104
175
|
// The task step, optional foreach join checkpoint, workflow context, and
|
|
105
176
|
// running status must commit together. A crash after this transaction is
|
|
@@ -109,6 +180,8 @@ export async function completeTaskStepAndResolveSuccessors(
|
|
|
109
180
|
// own awaits, so the claim is only authoritative here.
|
|
110
181
|
const current = await getWorkflowRunStep(step.id);
|
|
111
182
|
if (!current || current.status !== "waiting") return UNCLAIMED;
|
|
183
|
+
// A stale snapshot of a step since redriven to a fresh task must not route it.
|
|
184
|
+
if (ownerTaskId && !(await isTaskBoundToStep(ownerTaskId, step.id))) return UNCLAIMED;
|
|
112
185
|
|
|
113
186
|
const foreachParent = resolveForeachParent(def, step.nodeId);
|
|
114
187
|
if (foreachParent) {
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
# Open-Prompt Motion-Graphics Videos, Made by Your Swarm
|
|
2
|
+
|
|
3
|
+
An Agent-Swarm playbook template for making design-led motion-graphics videos (showreels, eval comparisons, "we found N bugs" stories, launch clips) from one open prompt. One Claude Code worker on Opus at max effort designs, codes, renders and critiques the whole video in a scratch directory. The Lead briefs it, reviews the frames, and relays the result.
|
|
4
|
+
|
|
5
|
+
The worked example is a 24-second video about a model checker finding race conditions in Agent Swarm itself. It is on the docs page for this playbook, with its contact sheet.
|
|
6
|
+
|
|
7
|
+
## What You Get
|
|
8
|
+
|
|
9
|
+
- A 15-30 second video, 1920x1080 (and 1080x1350 for feeds), h264 yuv420p, with music you are allowed to use, a credit line on the end card, and the full attribution in the post.
|
|
10
|
+
- Every number on screen read live from a named source into `facts.json` right before render.
|
|
11
|
+
- The real Agent Swarm logo on the end card, never a redrawn one.
|
|
12
|
+
- A contact sheet per critique round, so a reviewer sees what the maker saw.
|
|
13
|
+
- Delivery to agent-fs, with a share link per mp4.
|
|
14
|
+
|
|
15
|
+
## Template Files
|
|
16
|
+
|
|
17
|
+
`templates/community/open-prompt-showreel/`:
|
|
18
|
+
|
|
19
|
+
- `PLAYBOOK.md`: this playbook.
|
|
20
|
+
- `README.md`: quick start.
|
|
21
|
+
- `lead-prompt.md`: the one-time setup prompt, the per-video brief, and the feedback-round brief.
|
|
22
|
+
- `setup.sh`: idempotent toolchain setup for a worker container.
|
|
23
|
+
- `tools/`: `render.mjs`, `sheet.sh`, `music-analyze.py`, `music-refine.py`, `music-cut.sh`, `music-current.sh`, `fetch-music.sh`, `x-reencode.sh`, `web-compress.sh`.
|
|
24
|
+
- `skills/`: sanitized copies of `open-prompt-showreel`, `video-generation`, `motion-design-video-analysis`, `motion-design-replication`.
|
|
25
|
+
- `example/tla-races/`: the finished reel (`reel.html`), the facts script (`facts.ts`), the facts it produced (`facts.v3.json`), and `smoke.sh`.
|
|
26
|
+
|
|
27
|
+
## Roles
|
|
28
|
+
|
|
29
|
+
| Role | Does |
|
|
30
|
+
|---|---|
|
|
31
|
+
| Lead | Writes the brief from the requester's words, sets model and effort, reviews frames before relaying, relays the links. |
|
|
32
|
+
| Maker | A Claude Code harness worker (provider `claude`) on the full worker image. Runs on `claude-opus-5-5` at `max` effort. Writes the facts script, the reel, the music cut; renders; critiques; delivers. |
|
|
33
|
+
|
|
34
|
+
Codex, pi and other harnesses were not tried for this workflow. Do not route it to them without a test run.
|
|
35
|
+
|
|
36
|
+
## Setup, Start to Finish
|
|
37
|
+
|
|
38
|
+
Everything below was run in a worker container (x86_64, node 22.23.3, bun 1.4.0, python 3.12.3) unless it is marked **not run**.
|
|
39
|
+
|
|
40
|
+
### 1. What the worker image already has
|
|
41
|
+
|
|
42
|
+
| Tool | In the stock full worker image | Notes |
|
|
43
|
+
|---|---|---|
|
|
44
|
+
| node, npm, bun, git, gh, curl, tar | yes | |
|
|
45
|
+
| python3 + venv + pip | yes | system `pip install` is blocked by PEP 668; use a venv |
|
|
46
|
+
| numpy | **no** | `setup.sh` installs it in a venv |
|
|
47
|
+
| ffmpeg 7.0.2 (static) | yes | has libx264, aac, `xstack`, `atempo`, `loudnorm`, `ass`; **no `drawtext`, no `ffprobe`** |
|
|
48
|
+
| playwright 1.58.0 | yes, `/opt/global-deps-full/node_modules` | |
|
|
49
|
+
| Chromium 145 | yes, `/opt/playwright` | `PLAYWRIGHT_BROWSERS_PATH` is already set |
|
|
50
|
+
| agent-fs CLI 0.15.0 | yes | |
|
|
51
|
+
|
|
52
|
+
### 2. Install the template on the maker
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
git clone --depth 1 --filter=blob:none --sparse https://github.com/desplega-ai/agent-swarm.git /tmp/agent-swarm-tpl
|
|
56
|
+
git -C /tmp/agent-swarm-tpl sparse-checkout set templates/community/open-prompt-showreel
|
|
57
|
+
mkdir -p /workspace/personal/showreel-toolkit
|
|
58
|
+
cp -r /tmp/agent-swarm-tpl/templates/community/open-prompt-showreel/. /workspace/personal/showreel-toolkit/
|
|
59
|
+
bash /workspace/personal/showreel-toolkit/setup.sh
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`/workspace/personal` is the path that survives a container restart. Do not install into `$HOME`.
|
|
63
|
+
|
|
64
|
+
`setup.sh` does, in order, and skips whatever is already there:
|
|
65
|
+
|
|
66
|
+
1. Checks node, npm, bun, python3, curl, tar.
|
|
67
|
+
2. Checks ffmpeg has libx264; otherwise installs the pinned static build (version and sha256 match `Dockerfile.worker`).
|
|
68
|
+
3. Installs `ffprobe` from the same tarball (`INSTALL_FFPROBE=0` to skip).
|
|
69
|
+
4. Checks Playwright and launches Chromium once; otherwise `npm install playwright@1.58.0` and `playwright install chromium`.
|
|
70
|
+
5. Creates `.venv` and installs numpy.
|
|
71
|
+
6. Downloads Space Grotesk, JetBrains Mono and Instrument Serif Italic from `google/fonts` (SIL OFL) and checks each against a pinned sha256.
|
|
72
|
+
7. Downloads the Agent Swarm logo from agent-swarm.dev and from `apps/ui/public/logo.png` on main, and warns if they differ.
|
|
73
|
+
8. Copies `tools/`, `example/` and itself, and writes `env.sh` (PATH, fonts, logo, Playwright paths).
|
|
74
|
+
|
|
75
|
+
Measured on a clean directory: 17.6 s with ffprobe, numpy and fonts. A second run took 0.9 s and installed nothing.
|
|
76
|
+
|
|
77
|
+
### 3. Re-run setup at every container start
|
|
78
|
+
|
|
79
|
+
Append to the maker's `setupScript` (the `update-profile` tool, field `setupScript`). Keep what is already there.
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
# Showreel toolchain: idempotent, no-ops when already installed.
|
|
83
|
+
[ -f /workspace/personal/showreel-toolkit/setup.sh ] && bash /workspace/personal/showreel-toolkit/setup.sh >> /workspace/personal/showreel-toolkit/setup.log 2>&1 || true
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Not run** for this playbook: changing a live profile. The `setup.sh` line it calls was run from a clean directory.
|
|
87
|
+
|
|
88
|
+
### 4. Prove the toolchain with the smoke test
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
. /workspace/personal/showreel-toolkit/env.sh
|
|
92
|
+
cd /workspace/personal/showreel-toolkit/example/tla-races && bash smoke.sh
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
It renders the example reel to a 16-frame contact sheet and a 2-second mp4 at 960x540 with a generated tone as the audio track. It checks the pixel format and the AAC stream, then renders once more with a broken audio file and checks that `render.mjs` exits non-zero and leaves no mp4. Expected lines: `OK: yuv420p 960x540`, `OK: aac audio`, `OK: failed encode exits non-zero`. It needs no network, no `gh`, no agent-fs. It took 8.8 s.
|
|
96
|
+
|
|
97
|
+
### 5. Install the skills
|
|
98
|
+
|
|
99
|
+
For each `skills/<name>/SKILL.md`, a Lead calls `skill-create` with the file content and `scope: "swarm"`, then `skill-install` on the maker (and `open-prompt-showreel` on itself).
|
|
100
|
+
|
|
101
|
+
**Not run** for this playbook: `skill-create` writes to a live swarm. The four files do parse with the repo's `parseSkillContent`, which is what `skill-create` calls, and each name matches its directory.
|
|
102
|
+
|
|
103
|
+
`swarm-studio` and `studio-api`, the fixed-template skills that the original `open-prompt-showreel` skill points at, are not shipped. They sit on a private repo and a hosted renderer. If your swarm has a template toolkit, route fixed-template asks there.
|
|
104
|
+
|
|
105
|
+
### 6. Model and effort
|
|
106
|
+
|
|
107
|
+
Set both on every maker task. They are fields of `send-task`:
|
|
108
|
+
|
|
109
|
+
```text
|
|
110
|
+
model: claude-opus-5-5
|
|
111
|
+
effort: max
|
|
112
|
+
agentId: <maker>
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
Every brief ends with a gate: "If you are not on claude-opus-5-5, stop and say so instead of rendering."
|
|
116
|
+
|
|
117
|
+
### 7. agent-fs delivery
|
|
118
|
+
|
|
119
|
+
The maker uploads to `thoughts/<maker-agent-id>/videos/<slug>/` (versions as `<slug>-v2`, `<slug>-v3`; never overwrite). After each non-trivial write, check the size: `agent-fs stat <path> --json | jq '.size'`.
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
agent-fs --org <ORG_ID> --drive <DRIVE_ID> write thoughts/<maker-agent-id>/videos/<slug>/<file>.mp4 --file ./out/<file>.mp4
|
|
123
|
+
agent-fs --org <ORG_ID> --drive <DRIVE_ID> share-create thoughts/<maker-agent-id>/videos/<slug>/<file>.mp4 --expires-in 604800 --json
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
A share link opens a player with no login and expires in 7 days at most. Report the url, the share id and the expiry. A raw signed URL downloads instead of playing, and agent-fs serves a raw `.mp4` as `application/octet-stream`. For a byte-exact copy back down: `agent-fs download <path> -o <file>` (`cat` is paginated and truncates).
|
|
127
|
+
|
|
128
|
+
**Not run** for this playbook: `write` to a real drive and `share-create` (it publishes a public link). `write --file`, `share-create` and `signed-url --inline` flags were checked against the CLI's `--help`. `agent-fs download` was run on the example master.
|
|
129
|
+
|
|
130
|
+
## How One Video Gets Made
|
|
131
|
+
|
|
132
|
+
```text
|
|
133
|
+
Lead brief -> facts.ts -> reel.html -> render.mjs stills -> contact sheet -> fix -> (x3) -> music cut -> render -> agent-fs -> Lead review -> relay
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Brief
|
|
137
|
+
|
|
138
|
+
One task, one open prompt. The brief template is in `lead-prompt.md`. Do not write a storyboard, shot list, palette or template for the maker; earlier templated cuts read as generic. Hard rules go in, design rules stay out:
|
|
139
|
+
|
|
140
|
+
- **Content rule:** every number or claim on screen comes from a named source and matches it exactly. Anything not in the source stays off screen. Fewer numbers is fine.
|
|
141
|
+
- **Real brand:** the logo is `apps/ui/public/logo.png`, never a redrawn mark.
|
|
142
|
+
- **Music:** CC0 or CC BY only. Short credit on the end card; source link, license link and the changes made in the output.
|
|
143
|
+
- **Process:** a contact sheet looked at least 3 times.
|
|
144
|
+
|
|
145
|
+
### Facts before design
|
|
146
|
+
|
|
147
|
+
The maker writes `facts.ts` and runs `bun facts.ts > facts.json`. The reel reads `facts.json`; nothing is hard-coded. The example script `example/tla-races/facts.ts` reads:
|
|
148
|
+
|
|
149
|
+
| On screen | Source | How it is read |
|
|
150
|
+
|---|---|---|
|
|
151
|
+
| Whether each of 7 workflow races is red or green | `src/tests/workflow-tla-races.test.ts` on `origin/main` | `git show origin/main:<file>`; a regex over `test.failing("CXn: ...")` (red) vs `test("CXn: ...")` (green) |
|
|
152
|
+
| Which PR fixes which race | open and merged PRs | a PR fixes `CXn` when its diff replaces `test.failing("CXn:` with `test("CXn:`; merged PRs come from `gh api commits/<sha>/pulls` over the file's history |
|
|
153
|
+
| 3 heartbeat bugs: fix PR, violated invariant, 5-step trace, regression test | merged PRs whose body cites a TLC trace in `specs/tla/heartbeat` | `gh pr list --search`, a regex over the PR body, the added test from `gh api pulls/N/files`, then `git cat-file -e origin/main:<test>` |
|
|
154
|
+
| State counts and status views | a model-checking write-up | table rows read from the markdown; carried over and labelled `carried` when the write-up is not configured |
|
|
155
|
+
| Short SHA in the footer | `git rev-parse --short origin/main` | |
|
|
156
|
+
|
|
157
|
+
Rules the maker follows:
|
|
158
|
+
|
|
159
|
+
- A fact turns green only if main says so. A PR that is merged in the brief but not on main stays red.
|
|
160
|
+
- If the source disagrees with the brief, the source wins and the output says so.
|
|
161
|
+
- Draft numbers never ship. If the source is not ready, build the design on draft facts, `defer-task` with `wakeOn:{event:"settled",taskIds:[...]}`, and re-read on wake.
|
|
162
|
+
|
|
163
|
+
### The reel
|
|
164
|
+
|
|
165
|
+
One `reel.html` draws each frame on a `<canvas>` as a pure function of the frame number. It exposes two functions, which `tools/render.mjs` drives with Playwright:
|
|
166
|
+
|
|
167
|
+
```js
|
|
168
|
+
window.boot = async (facts, fonts, logo) => { /* load fonts + logo, stash facts */ };
|
|
169
|
+
window.frame = (f) => { render(f); return cv.toDataURL("image/png"); };
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Stills for contact sheets:
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
. /workspace/personal/showreel-toolkit/env.sh
|
|
176
|
+
TK=/workspace/personal/showreel-toolkit
|
|
177
|
+
cd /workspace/personal/<slug>
|
|
178
|
+
export REEL=reel.html FACTS=facts.json MUSIC=music/<track>.json # the credit file from fetch-music.sh is enough for stills
|
|
179
|
+
bash $TK/tools/sheet.sh 1920 1080 r1 # 16 frames, 4x4 -> r1.png
|
|
180
|
+
COLS=5 bash $TK/tools/sheet.sh 1920 1080 t1 "180,183,185,187,189,190,191,192,193,194,196,198,200,203,206,209,212,215,220,230"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
The full render, with audio. It needs `music/current.json` from the Music section below (it carries the `wav` field; a `--music` file without `wav` renders a silent video and `render.mjs` warns). `render.mjs` creates the output directory and exits non-zero if ffmpeg fails:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
node $TK/tools/render.mjs --reel reel.html --w 1920 --h 1080 --facts facts.json \
|
|
187
|
+
--logo $LOGO --fonts "$FONTS" --music music/current.json --out out/<slug>-1920x1080.mp4
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
`render.mjs` pipes PNG frames to ffmpeg with `-pix_fmt yuv420p`, h264 High, `-crf 16`, AAC 192k and `+faststart`. The 720-frame 1080p render of the example took about 3.5 minutes (frame 600 at 167 s).
|
|
191
|
+
|
|
192
|
+
Layout is responsive to `?w=&h=`, so the 4:5 cut is a second render at 1080x1350, not a crop.
|
|
193
|
+
|
|
194
|
+
### The critique loop
|
|
195
|
+
|
|
196
|
+
At least three rounds. Each round:
|
|
197
|
+
|
|
198
|
+
1. Render a 16-frame contact sheet and **look at it** (Read the PNG).
|
|
199
|
+
2. Render a 20-frame transition strip around each cut to catch pops and empty frames.
|
|
200
|
+
3. Write down what is weak: dead space, text too small for a phone, a cramped 4:5, jumpy easing, a hit off the beat. Fix it.
|
|
201
|
+
|
|
202
|
+
The last round checks every on-screen number against `facts.json` and the source, and opens the end-card frame alone at full size to confirm the logo and the credit line. Keep every round's sheet (`r1-16x9.png`, `r2-16x9.png`, ...).
|
|
203
|
+
|
|
204
|
+
### Music
|
|
205
|
+
|
|
206
|
+
CC0 or CC BY only. No NC (it is a company post), no ND (the track is cut and stretched) and no SA (it would carry over to the video). Pick a fresh track for each video.
|
|
207
|
+
|
|
208
|
+
```bash
|
|
209
|
+
bash $TK/tools/fetch-music.sh incompetech Voltaic music # Kevin MacLeod, CC BY 4.0
|
|
210
|
+
bash $TK/tools/fetch-music.sh url https://opengameart.org/sites/default/files/mist_city.ogg music \
|
|
211
|
+
"Mist City" Section7 "CC BY 4.0" https://opengameart.org/content/mist-city
|
|
212
|
+
bash $TK/tools/fetch-music.sh url https://example.com/x.mp3 music "Nope" Someone "CC BY-NC 4.0" https://example.com # refused
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
Both downloads were byte-identical to the files used for the example video. The script accepts only CC0 1.0 and CC BY 1.0 to 4.0, matched case-insensitively (`cc-by 4.0` works), and refuses NC, ND, SA, "All rights reserved" and any string it does not know. It cannot check the source page, so read the license there yourself. It writes `music/<slug>.json` with the license link and a short `credit` for the end card.
|
|
216
|
+
|
|
217
|
+
To time the cut to the music, find tempo, beat phase and the drop, then stretch the track so the beats sit on the frame grid and the drop lands on the key reveal. Then write `music/current.json`, the file the render reads:
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
python3 $TK/tools/music-analyze.py music/voltaic.mp3 # bpm, beat phase, top drop candidates (json)
|
|
221
|
+
python3 $TK/tools/music-refine.py music/voltaic.mp3 <bpm> <drop_sec>
|
|
222
|
+
bash $TK/tools/music-cut.sh music/voltaic.mp3 <bpm> <drop_sec> music/cut.wav # TARGET_BPM=120 DROP_AT=14 DUR=24 by default
|
|
223
|
+
bash $TK/tools/music-current.sh music/voltaic.json music/cut.wav # writes music/current.json
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
At 30 fps and 120 BPM a beat is 15 frames. On the example track the analyzer returned 120.2 BPM and a strongest drop candidate at 143.3 s. `music-cut.sh` fades in 0.3 s and out 1.7 s, and `DIP=1` ducks the track just before the drop.
|
|
227
|
+
|
|
228
|
+
`music-current.sh` copies the track json to `music/current.json` and adds `"wav": "music/cut.wav"` (which `render.mjs` muxes in as AAC) and `attribution`. CC BY needs a link to the source, a link to the license and a notice that the track was changed, so the post carries the whole `attribution` string, for example:
|
|
229
|
+
|
|
230
|
+
```text
|
|
231
|
+
"Mist City" by Section7, https://opengameart.org/content/mist-city, licensed under CC BY 4.0, https://creativecommons.org/licenses/by/4.0/. Changes: trimmed, time-stretched to the video's beat grid, faded in and out, and loudness-normalized.
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
Set `MODIFIED="..."` to describe the edits more exactly. The short `credit` stays on the end card.
|
|
235
|
+
|
|
236
|
+
### Re-encode for X when the source is full range
|
|
237
|
+
|
|
238
|
+
The reel pipeline already writes limited-range `yuv420p`. A clip from a screen recording, a JPEG pipeline or `remotion render` may be tagged `yuvj420p` (full range, "pc"). Re-encode it:
|
|
239
|
+
|
|
240
|
+
```bash
|
|
241
|
+
bash $TK/tools/x-reencode.sh in.mp4 out.mp4
|
|
242
|
+
# before: h264 (High) ... yuvj420p(pc, progressive) ...
|
|
243
|
+
# after: h264 (High) ... yuv420p(tv, bt709, progressive) ...
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
The ffmpeg side is reproduced: `remotion render` 4.0.532 wrote `yuvj420p(pc, bt470bg)` by default and `yuv420p(tv, bt709)` with `--color-space=bt709`. That X mishandles full-range files is a field report from our own posting runs; it was not reproduced here.
|
|
247
|
+
|
|
248
|
+
### Web copy for docs and PRs
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
bash $TK/tools/web-compress.sh out/<slug>-1920x1080.mp4 docs-site/public/<dir> <name> 16.5
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
Writes a 1280-wide mp4 and a poster jpg. The 17.8 MB master of the example became 2.6 MB. Commit the small copy, not the master. A signed agent-fs URL expires; a file in the repo does not.
|
|
255
|
+
|
|
256
|
+
### Lead review before relay
|
|
257
|
+
|
|
258
|
+
The maker's output is not the finish line. Before relaying, the Lead:
|
|
259
|
+
|
|
260
|
+
1. Opens the contact sheet and looks at the frames, not just the file list.
|
|
261
|
+
2. Opens the end-card frame: real logo, credit line present and readable.
|
|
262
|
+
3. Checks every on-screen number against the maker's `facts.json`, and `facts.json` against the source named in the brief.
|
|
263
|
+
4. Checks the ffprobe line: `h264`, `yuv420p`, exactly 1920x1080 (and 1080x1350), duration as briefed, and an `aac` audio stream when the video has music. (`ffprobe` after `setup.sh`, or `ffmpeg -i` stderr in the stock image.)
|
|
264
|
+
5. Plays the share link once.
|
|
265
|
+
6. Relays the share link, the share id and the expiry, plus the `attribution` string from `music/current.json` (source link, license link, changes made). The maker never posts.
|
|
266
|
+
|
|
267
|
+
## Known Gotchas
|
|
268
|
+
|
|
269
|
+
| Gotcha | What happens | What to do |
|
|
270
|
+
|---|---|---|
|
|
271
|
+
| No `ffprobe` in the worker image | `ffprobe: command not found` | `ffmpeg -hide_banner -i f.mp4 2>&1 \| grep Stream`, or run `setup.sh` (installs 7.0.2 ffprobe). Remotion's compositor package also bundles one. |
|
|
272
|
+
| No `drawtext` filter | `ffmpeg -version` lists libfreetype, but `drawtext` is not registered | Draw text on the canvas, or burn captions with the `ass` filter |
|
|
273
|
+
| numpy not installed, system pip refused | `externally-managed-environment` (PEP 668) | `python3 -m venv` under `/workspace/personal`; `setup.sh` does it |
|
|
274
|
+
| PNG frames encoded by libx264 without `-pix_fmt` | The output is `yuv444p` (High 4:4:4 Predictive), which many players and uploaders reject | Always `-pix_fmt yuv420p`. `render.mjs` does. |
|
|
275
|
+
| Full-range `yuvj420p` | Rendered by `remotion render` by default | `--color-space=bt709`, or `x-reencode.sh` |
|
|
276
|
+
| Remotion's bundled ffmpeg is stripped | no `fps`, `tile`, `hstack` filters | Use the image's `/usr/local/bin/ffmpeg` for analysis and sheets |
|
|
277
|
+
| agent-fs serves `.mp4` as `application/octet-stream` | A content-type check on a raw link fails | Use a `share-create` link. Do not retry the content-type check. |
|
|
278
|
+
| Signed URLs expire and default to attachment | A `<video src>` pointing at one downloads instead of playing, and stops working at the expiry | Never use one as a public URL. For a page, commit a compressed copy. `signed-url --inline` renders in a browser tab but still expires. |
|
|
279
|
+
| `agent-fs cat` truncates | Pagination hides the tail of a big file | `agent-fs download <path> -o <file>` for exact bytes |
|
|
280
|
+
| Container restart mid-render | The scratch dir is the only thing that survives | Keep it in `/workspace/personal/<slug>`, name it in the first progress note, upload an interim cut before the long render |
|
|
281
|
+
| Brief and source disagree | The brief says four PRs merged; main has five | The source wins, and the output says so |
|
|
282
|
+
| Invented logo | The first example cut drew its own mark | Use `apps/ui/public/logo.png`; `setup.sh` downloads it and warns if the live site differs |
|
|
283
|
+
| `--music` json without `wav` | The mp4 has no audio; `render.mjs` warns on stderr | Run `music-current.sh` after `music-cut.sh`, render with `music/current.json`, check for an `aac` stream |
|
|
284
|
+
| Music the requester already heard | Same track on every video | Pick a fresh track; offer two alternates when music is in question |
|
|
285
|
+
|
|
286
|
+
## Example: TLA+ Races Showreel
|
|
287
|
+
|
|
288
|
+
### The prompt (abridged)
|
|
289
|
+
|
|
290
|
+
> Make a dynamic 15 to 25 second motion graphics video about how a model checker (TLA+) found real race conditions in Agent Swarm, each one pinned as a failing test and then turned green by a fix PR. Make it your showreel: show what an incredible motion designer you are. Go all out.
|
|
291
|
+
>
|
|
292
|
+
> The only content rule: every number, PR and race on screen is read live right before the final render. Anything you cannot confirm stays off screen. Fewer facts is fine: design-led, not a ledger.
|
|
293
|
+
|
|
294
|
+
Plus the standard how-to: ad hoc scratch dir, a contact sheet at least three times, CC-licensed music with a credit, and the gate that stops a maker who is not on `claude-opus-5-5`.
|
|
295
|
+
|
|
296
|
+
### What is in the video
|
|
297
|
+
|
|
298
|
+
Title "TLA+", then a particle field counting the model checker's reachable states up to 1,349,396. A counterexample trace draws across a timeline (heartbeat bug 1, the invariant `NoLiveKill` violated). Ten tiles appear red under "Each race, pinned as a failing test". A scan sweep turns them green under "Then a fix PR turns it green." The counter, labelled "today" at 1,349,396, collapses to 4,243 under "a simpler design, proposed." A hexagon morphs into the real logo and the end card reads "Races found by a model checker", with the music credit.
|
|
299
|
+
|
|
300
|
+
### How the facts got on screen
|
|
301
|
+
|
|
302
|
+
`example/tla-races/facts.ts` produced `facts.v3.json`: the 7 workflow races (`CX1` to `CX7`) and 3 heartbeat bugs, their fix PRs (#1666, #1668, #1669, #1670, #1673, #1675, #1678), the invariants and traces, and `origin/main` at `e3c90a88`. The reel draws only a handful of those facts.
|
|
303
|
+
|
|
304
|
+
### v1 to v3
|
|
305
|
+
|
|
306
|
+
| Cut | Why it was made | What it showed |
|
|
307
|
+
|---|---|---|
|
|
308
|
+
| v1 | Fixed-template cuts of the same subject read as generic. The brief became "Opus, max effort, one open prompt, your own design". | 24 s, 16:9 and 4:5. Music: "Voltaic", Kevin MacLeod, CC BY 4.0. 7 workflow races red (their fix PRs were still open); 2 heartbeat bugs green. The end card used a hexagon mark the maker had drawn. |
|
|
309
|
+
| v2 | Feedback: use the correct logo at the end, and use different music. | Real logo asset on the end card; "Mist City", Section7, CC BY 4.0, with two alternate tracks (CC0 and CC BY 3.0) rendered for choice. A first attempt died in the final render when the worker session was lost; the retry found the scratch dir and finished in 8 minutes. Facts re-read: only the first race fix had merged. |
|
|
310
|
+
| v3 | Once the remaining fix PRs merged, the cut for the post. "Only the facts change." | Same design, music and logo. `facts.ts` re-run against `origin/main`: all 10 tiles green. The brief listed four merged PRs, main also had the heartbeat bug 2 fix, so the reel says "ALL 10 FIXED ON MAIN". Source over brief. |
|
|
311
|
+
|
|
312
|
+
### Final video
|
|
313
|
+
|
|
314
|
+
`tla-races-showreel-v3`: 24.00 s, h264 High, yuv420p, 1920x1080, 30 fps, AAC. The docs page embeds a 1280-wide, 2.6 MB copy and a poster. The master stays in agent-fs.
|
|
315
|
+
|
|
316
|
+
## Verification Log
|
|
317
|
+
|
|
318
|
+
| Step | Result |
|
|
319
|
+
|---|---|
|
|
320
|
+
| Sparse clone of the template, `cp`, `setup.sh`, `smoke.sh` | Run against the PR branch (`--branch`); the commands in this playbook target `main`, which has the template once this merges. 14.6 s for `setup.sh`, then `OK: yuv420p 960x540`. |
|
|
321
|
+
| `setup.sh` on a clean directory, stock image | Run. Installs ffprobe, numpy, fonts, logo. Re-run installs nothing. |
|
|
322
|
+
| `FORCE_LOCAL_FFMPEG=1 FORCE_LOCAL_PLAYWRIGHT=1 bash setup.sh` | Run. Pinned ffmpeg tarball passed its sha256; `npm install playwright@1.58.0`; `playwright install chromium` fetched 622 MB; smoke test passed on that toolchain. |
|
|
323
|
+
| `python3 -m venv` + `pip install numpy pillow` | Run. numpy 2.5.3, pillow 12.3.0. |
|
|
324
|
+
| System `pip install numpy` | Run. Refused (PEP 668). |
|
|
325
|
+
| Fonts from `google/fonts` | Run. Byte-identical to the files used in the example. |
|
|
326
|
+
| `fetch-music.sh` for Voltaic and Mist City | Run. Byte-identical to the files used. NC, ND, SA, "All rights reserved", a bare `CC BY` and unknown licenses refused; `cc-by 4.0`, `CC0` and `cc by 2.5` normalize and get the right license link. |
|
|
327
|
+
| `music-analyze.py`, `music-cut.sh` | Run on Voltaic (120.2 BPM; cut is 24.00 s). Run on Mist City (129.2 BPM, `atempo=0.929`). |
|
|
328
|
+
| `music-current.sh`, then a 720-frame render at 960x540 with `music/current.json` | Run on the Mist City cut. ffprobe: h264 `yuv420p` 960x540 and an `aac` stream, both 24.00 s. |
|
|
329
|
+
| `render.mjs` with a broken wav, with ffmpeg killed mid-render, with no ffmpeg on `PATH` | Run. Each exits 1 with the ffmpeg exit status in the message and leaves no partial mp4. |
|
|
330
|
+
| `x-reencode.sh` | Run on a `yuvj420p` clip and on `remotion render` output. Both came out `yuv420p(tv, bt709)`. |
|
|
331
|
+
| `web-compress.sh` | Run on the example master (17.8 MB to 2.6 MB). |
|
|
332
|
+
| Remotion `npm install` and a 30-frame render with `--browser-executable=/opt/playwright/chromium` | Run. Remotion 4.0.532, 14 s. |
|
|
333
|
+
| `smoke.sh` | Run. `OK: yuv420p 960x540`, `OK: aac audio`, `OK: failed encode exits non-zero`. |
|
|
334
|
+
| `apt-get install` of Chromium system libraries | **Not run.** The worker has no root. |
|
|
335
|
+
| `npx remotion studio` | **Not run.** |
|
|
336
|
+
| `skill-create`, `skill-install`, `update-profile`, `agent-fs share-create` | **Not run.** They change a live swarm or publish a link. |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# Open-Prompt Motion-Graphics Videos, Made by Your Swarm
|
|
2
|
+
|
|
3
|
+
Community template for making design-led motion-graphics videos with an agent swarm: one Claude Code worker on `claude-opus-5-5` at `max` effort designs, codes, renders and critiques the video from one open prompt. The worked example is a 24-second TLA+ races showreel.
|
|
4
|
+
|
|
5
|
+
Files:
|
|
6
|
+
|
|
7
|
+
- `PLAYBOOK.md`: end-to-end setup, the per-video procedure, gotchas, the TLA+ example and the verification log.
|
|
8
|
+
- `lead-prompt.md`: the one-time setup prompt, the per-video brief, and the feedback-round brief.
|
|
9
|
+
- `setup.sh`: idempotent toolchain setup for a worker container (ffmpeg/ffprobe, Playwright + Chromium, numpy venv, fonts, logo).
|
|
10
|
+
- `tools/`: `render.mjs` (canvas reel to stills or mp4), `sheet.sh` (contact sheet and transition strip), `music-analyze.py`, `music-refine.py`, `music-cut.sh`, `music-current.sh`, `fetch-music.sh`, `x-reencode.sh`, `web-compress.sh`.
|
|
11
|
+
- `skills/`: sanitized copies of `open-prompt-showreel`, `video-generation`, `motion-design-video-analysis`, `motion-design-replication`. Install them with `skill-create` and `skill-install`.
|
|
12
|
+
- `example/tla-races/`: `reel.html` (the finished reel), `facts.ts` and `facts.v3.json` (the live facts), `smoke.sh` (toolchain test).
|
|
13
|
+
|
|
14
|
+
Quick start, on the maker worker:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
git clone --depth 1 --filter=blob:none --sparse https://github.com/desplega-ai/agent-swarm.git /tmp/agent-swarm-tpl
|
|
18
|
+
git -C /tmp/agent-swarm-tpl sparse-checkout set templates/community/open-prompt-showreel
|
|
19
|
+
mkdir -p /workspace/personal/showreel-toolkit
|
|
20
|
+
cp -r /tmp/agent-swarm-tpl/templates/community/open-prompt-showreel/. /workspace/personal/showreel-toolkit/
|
|
21
|
+
bash /workspace/personal/showreel-toolkit/setup.sh
|
|
22
|
+
|
|
23
|
+
. /workspace/personal/showreel-toolkit/env.sh
|
|
24
|
+
cd /workspace/personal/showreel-toolkit/example/tla-races && bash smoke.sh # expect: OK: yuv420p 960x540
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Then send the maker a task built from the brief in `lead-prompt.md`, with `model: claude-opus-5-5` and `effort: max`.
|
|
28
|
+
|
|
29
|
+
The docs page is [Open-Prompt Showreel Videos](https://docs.agent-swarm.dev/docs/playbooks/open-prompt-showreel).
|
|
30
|
+
|
|
31
|
+
Not shipped: `swarm-studio` and `studio-api`. The original skill points at them for fixed-template creatives; they depend on a private repository and a hosted renderer.
|
|
32
|
+
|
|
33
|
+
Music: use CC0 or CC BY tracks only. Put a short credit on the end card and the full attribution in the output: source link, license link and the changes made (`tools/music-current.sh` writes it to `music/current.json`, next to the `wav` the render needs). The TLA+ example credits ["Mist City"](https://opengameart.org/content/mist-city) by Section7 ([CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)), trimmed and time-stretched.
|