@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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Smoke test for the toolchain: renders the TLA+ example reel to a 16-frame contact sheet and a
|
|
3
|
+
# 2-second mp4 with a generated tone as the audio, and checks the pixel format and the AAC stream.
|
|
4
|
+
# Also checks that a failing encode makes render.mjs exit non-zero. No network, no gh, no agent-fs.
|
|
5
|
+
#
|
|
6
|
+
# . ../../env.sh && bash smoke.sh (env.sh is written by setup.sh)
|
|
7
|
+
set -euo pipefail
|
|
8
|
+
|
|
9
|
+
HERE="$(cd "$(dirname "$0")" && pwd)"
|
|
10
|
+
TOOLS="$HERE/../../tools"
|
|
11
|
+
: "${FONTS:?source env.sh first}" "${LOGO:?source env.sh first}"
|
|
12
|
+
OUT="${OUT:-$(mktemp -d)}"
|
|
13
|
+
export REEL="$HERE/reel.html" FACTS="$HERE/facts.v3.json" MUSIC="$HERE/music.mist-city.json"
|
|
14
|
+
|
|
15
|
+
mkdir -p "$OUT" && cd "$OUT"
|
|
16
|
+
bash "$TOOLS/sheet.sh" 960 540 smoke
|
|
17
|
+
|
|
18
|
+
# A tone stands in for a cut track; music-current.sh adds the wav field, as in a real run.
|
|
19
|
+
ffmpeg -v error -y -f lavfi -i "sine=frequency=440:duration=3" -ar 48000 -ac 2 tone.wav
|
|
20
|
+
bash "$TOOLS/music-current.sh" "$MUSIC" tone.wav current.json >/dev/null
|
|
21
|
+
# out/ does not exist yet: render.mjs creates the output directory.
|
|
22
|
+
node "$TOOLS/render.mjs" --reel "$REEL" --w 960 --h 540 --facts "$FACTS" --logo "$LOGO" --fonts "$FONTS" \
|
|
23
|
+
--music current.json --frames 60 --out out/smoke.mp4 2>/dev/null
|
|
24
|
+
# `ffmpeg -i` with no output exits 1, hence the || true (pipefail would otherwise end the script here).
|
|
25
|
+
info=$(ffmpeg -hide_banner -i out/smoke.mp4 2>&1 || true)
|
|
26
|
+
stream=$(grep -m1 'Stream.*Video' <<<"$info" || true)
|
|
27
|
+
audio=$(grep -m1 'Stream.*Audio' <<<"$info" || true)
|
|
28
|
+
echo "out/smoke.mp4: ${stream#*Video: }"
|
|
29
|
+
echo "out/smoke.mp4: ${audio#*Audio: }"
|
|
30
|
+
case "$stream" in
|
|
31
|
+
*yuv420p*960x540*) echo "OK: yuv420p 960x540" ;;
|
|
32
|
+
*) echo "FAIL: expected yuv420p 960x540" >&2; exit 1 ;;
|
|
33
|
+
esac
|
|
34
|
+
case "$audio" in
|
|
35
|
+
*aac*) echo "OK: aac audio" ;;
|
|
36
|
+
*) echo "FAIL: expected an aac audio stream" >&2; exit 1 ;;
|
|
37
|
+
esac
|
|
38
|
+
|
|
39
|
+
# A wav ffmpeg cannot read must fail the render and must not leave an mp4 behind.
|
|
40
|
+
echo "not audio" >bad.wav
|
|
41
|
+
bash "$TOOLS/music-current.sh" "$MUSIC" bad.wav bad.json >/dev/null
|
|
42
|
+
if node "$TOOLS/render.mjs" --reel "$REEL" --w 960 --h 540 --facts "$FACTS" --logo "$LOGO" --fonts "$FONTS" \
|
|
43
|
+
--music bad.json --frames 2 --out bad/smoke.mp4 2>/dev/null; then
|
|
44
|
+
echo "FAIL: render.mjs exited 0 after ffmpeg failed" >&2; exit 1
|
|
45
|
+
fi
|
|
46
|
+
[ ! -e bad/smoke.mp4 ] || { echo "FAIL: a failed render left bad/smoke.mp4" >&2; exit 1; }
|
|
47
|
+
echo "OK: failed encode exits non-zero"
|
|
48
|
+
echo "outputs in $OUT: $(ls "$OUT" | tr '\n' ' ')"
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Lead Kickoff Prompts
|
|
2
|
+
|
|
3
|
+
Two prompts. The first sets the swarm up once. The second is the per-video brief the Lead sends to the maker.
|
|
4
|
+
|
|
5
|
+
## 1. One-time setup prompt
|
|
6
|
+
|
|
7
|
+
Copy this into your agent-swarm Lead.
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
Set my swarm up to make open-prompt motion-graphics videos.
|
|
11
|
+
|
|
12
|
+
Parameters:
|
|
13
|
+
- Maker worker: <MAKER_AGENT_NAME>. It must be a Claude Code harness worker (provider claude) on the full worker image.
|
|
14
|
+
- agent-fs org and drive for deliveries: <ORG_ID> / <DRIVE_ID>
|
|
15
|
+
- Template source: templates/community/open-prompt-showreel in desplega-ai/agent-swarm (branch main).
|
|
16
|
+
|
|
17
|
+
Steps:
|
|
18
|
+
1. On the maker worker, copy the template to /workspace/personal/showreel-toolkit:
|
|
19
|
+
git clone --depth 1 --filter=blob:none --sparse https://github.com/desplega-ai/agent-swarm.git /tmp/agent-swarm-tpl
|
|
20
|
+
git -C /tmp/agent-swarm-tpl sparse-checkout set templates/community/open-prompt-showreel
|
|
21
|
+
mkdir -p /workspace/personal/showreel-toolkit
|
|
22
|
+
cp -r /tmp/agent-swarm-tpl/templates/community/open-prompt-showreel/. /workspace/personal/showreel-toolkit/
|
|
23
|
+
bash /workspace/personal/showreel-toolkit/setup.sh
|
|
24
|
+
2. Set the maker's setupScript (update-profile, setupScript) so the toolchain is rechecked at every container start. Keep whatever is already in the script and append:
|
|
25
|
+
# Showreel toolchain: idempotent, no-ops when already installed.
|
|
26
|
+
[ -f /workspace/personal/showreel-toolkit/setup.sh ] && bash /workspace/personal/showreel-toolkit/setup.sh >> /workspace/personal/showreel-toolkit/setup.log 2>&1 || true
|
|
27
|
+
3. Create the four skills from /workspace/personal/showreel-toolkit/skills/*/SKILL.md with skill-create (scope swarm), then skill-install open-prompt-showreel on yourself and all four on the maker:
|
|
28
|
+
open-prompt-showreel, video-generation, motion-design-video-analysis, motion-design-replication
|
|
29
|
+
4. Run the smoke test on the maker and report its output:
|
|
30
|
+
. /workspace/personal/showreel-toolkit/env.sh && cd /workspace/personal/showreel-toolkit/example/tla-races && bash smoke.sh
|
|
31
|
+
It must print "OK: yuv420p 960x540". If it does not, stop and report the failing line.
|
|
32
|
+
5. Do not render a real video yet.
|
|
33
|
+
|
|
34
|
+
Deliver back:
|
|
35
|
+
- The maker's name and the output of setup.sh and smoke.sh.
|
|
36
|
+
- The four skill names as they appear in the skills list.
|
|
37
|
+
- Anything you could not do automatically (for example a Chromium system library that needs root).
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 2. Per-video brief (Lead to maker)
|
|
41
|
+
|
|
42
|
+
One task, one open prompt. Do not write a storyboard, shot list, palette or template for the maker. Fill the angle brackets and send it with `model: claude-opus-5-5` and `effort: max`, assigned to the maker.
|
|
43
|
+
|
|
44
|
+
```text
|
|
45
|
+
GOAL: <one line: what the video is and where it goes (X / LinkedIn / internal)>.
|
|
46
|
+
Made by you on claude-opus-5-5, max effort, ad hoc, your own design. Use the open-prompt-showreel skill.
|
|
47
|
+
|
|
48
|
+
<Requester>, verbatim: "<the ask>"
|
|
49
|
+
|
|
50
|
+
Your prompt: make a dynamic <15 | 15-30> second motion graphics video <about SUBJECT>.
|
|
51
|
+
Make it your showreel: show what an incredible motion designer you are. Go all out.
|
|
52
|
+
|
|
53
|
+
Content rule: every number or claim on screen comes from <SOURCE: eval writeup path /
|
|
54
|
+
test file on origin/main / PR numbers> and matches it exactly. Anything not in the
|
|
55
|
+
source stays off screen. Fewer numbers is fine: design-led, not a table.
|
|
56
|
+
|
|
57
|
+
How:
|
|
58
|
+
- Ad hoc: scratch dir under /workspace/personal, any tools or code you like. No repo, no PR, no shared template.
|
|
59
|
+
- Tools are in /workspace/personal/showreel-toolkit (source env.sh). Real fonts and the real logo are in assets/.
|
|
60
|
+
- Real brand: Agent Swarm logo = origin/main apps/ui/public/logo.png (verify vs agent-swarm.dev/logo.png). Never draw your own mark.
|
|
61
|
+
- Look at a contact sheet at least 3 times, fixing what looks weak each round; in the last round check every on-screen number against the source and look at the end-card frame.
|
|
62
|
+
- Music optional; CC0 or CC BY only (no NC, no ND, no SA); short credit on the end card; in your output the full attribution from music/current.json (source link, license link, changes made).
|
|
63
|
+
- If you are not on claude-opus-5-5, stop and say so instead of rendering.
|
|
64
|
+
- Nothing is owed to a human by you; Lead reviews and relays.
|
|
65
|
+
|
|
66
|
+
Deliver to agent-fs thoughts/<maker-agent-id>/videos/<slug>/: <1920x1080 [+ 1080x1350]> h264 yuv420p mp4,
|
|
67
|
+
contact sheet(s), facts.json, reel.html.
|
|
68
|
+
Output: agent-fs paths, a share-create link per mp4 (url + share id), ffprobe line, model you ran on,
|
|
69
|
+
each on-screen number with its source, music attribution (source link, license link, changes made).
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Optional style add-on for a calmer, premium cut: 3 colors, one background, one font, no HUD or grain; one shot = one idea; about 3 s open and 2 s held end; key object centered; eased, overlapping keyframes; no hard cuts; about 108 BPM with the phrase hit on the first product frame; no SFX.
|
|
73
|
+
|
|
74
|
+
## 3. Feedback round brief (v2, v3)
|
|
75
|
+
|
|
76
|
+
```text
|
|
77
|
+
GOAL: v<N> of <slug>. Base it on your v<N-1> in agent-fs <path>: same design, same music, same logo unless listed below.
|
|
78
|
+
|
|
79
|
+
<Requester>, verbatim: "<the feedback>"
|
|
80
|
+
|
|
81
|
+
Changes, one per point of feedback:
|
|
82
|
+
- <point> -> <concrete change>
|
|
83
|
+
|
|
84
|
+
Re-read every on-screen number from the source yourself and update facts.json. If the source disagrees with
|
|
85
|
+
this brief, trust the source and say so. Copy your scratch dir to <slug>-v<N> first; do not overwrite v<N-1>.
|
|
86
|
+
Deliver to thoughts/<maker-agent-id>/videos/<slug>-v<N>/ and report what changed vs v<N-1> in one line.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
If a point depends on other work (PRs still merging, an eval still running), tell the maker to deliver the rest as an interim and `defer-task` on the blocking task. Never ship draft numbers.
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -euo pipefail
|
|
3
|
+
|
|
4
|
+
# Toolchain setup for open-prompt motion-graphics videos on an Agent Swarm worker container.
|
|
5
|
+
#
|
|
6
|
+
# Idempotent: every step checks first, so it is cheap to run at every container start from the
|
|
7
|
+
# worker setupScript. Needs no root. Everything it installs lives under BASE_DIR, which should be on
|
|
8
|
+
# a path that survives a container restart (/workspace/personal does; $HOME does not).
|
|
9
|
+
#
|
|
10
|
+
# What the stock worker image already ships (checked, not reinstalled):
|
|
11
|
+
# node, bun, python3 + venv, ffmpeg 7.0.2 static (libx264, aac, no ffprobe, no drawtext),
|
|
12
|
+
# playwright 1.58.0 under /opt/global-deps-full, Chromium under /opt/playwright, agent-fs CLI.
|
|
13
|
+
# What this script adds:
|
|
14
|
+
# ffprobe (optional), numpy in a venv (music beat analysis), the three fonts (sha256-pinned),
|
|
15
|
+
# the real Agent Swarm logo, the render/sheet/music/encode tools, and the TLA+ example reel.
|
|
16
|
+
# If the image lacks ffmpeg or playwright, it falls back to a pinned static ffmpeg and a local
|
|
17
|
+
# playwright install (force either with FORCE_LOCAL_FFMPEG=1 / FORCE_LOCAL_PLAYWRIGHT=1). Chromium's
|
|
18
|
+
# system libraries need root to install (`npx playwright install-deps chromium`); this script cannot.
|
|
19
|
+
#
|
|
20
|
+
# Usage: bash setup.sh (BASE_DIR=/workspace/personal/showreel-toolkit by default)
|
|
21
|
+
# INSTALL_FFPROBE=0 bash setup.sh
|
|
22
|
+
|
|
23
|
+
BASE_DIR="${BASE_DIR:-/workspace/personal/showreel-toolkit}"
|
|
24
|
+
INSTALL_FFPROBE="${INSTALL_FFPROBE:-1}"
|
|
25
|
+
FORCE_LOCAL_FFMPEG="${FORCE_LOCAL_FFMPEG:-0}" # 1 = ignore the system ffmpeg, install the pinned build
|
|
26
|
+
FORCE_LOCAL_PLAYWRIGHT="${FORCE_LOCAL_PLAYWRIGHT:-0}" # 1 = ignore /opt/global-deps-full, install playwright locally
|
|
27
|
+
FFMPEG_VERSION="${FFMPEG_VERSION:-7.0.2}"
|
|
28
|
+
PLAYWRIGHT_VERSION="${PLAYWRIGHT_VERSION:-1.58.0}"
|
|
29
|
+
SELF_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
30
|
+
|
|
31
|
+
# Same pins as the worker image (Dockerfile.worker). Bump the version and both hashes together.
|
|
32
|
+
FFMPEG_SHA256_AMD64="abda8d77ce8309141f83ab8edf0596834087c52467f6badf376a6a2a4c87cf67"
|
|
33
|
+
FFMPEG_SHA256_ARM64="f4149bb2b0784e30e99bdda85471c9b5930d3402014e934a5098b41d0f7201b1"
|
|
34
|
+
|
|
35
|
+
# Fonts come from github.com/google/fonts (SIL Open Font License 1.1). The hashes are the exact files the reels used.
|
|
36
|
+
FONT_BASE="https://raw.githubusercontent.com/google/fonts/main/ofl"
|
|
37
|
+
FONTS=(
|
|
38
|
+
"SpaceGrotesk.ttf|$FONT_BASE/spacegrotesk/SpaceGrotesk%5Bwght%5D.ttf|acad6de1fc93436f5c0f1f4137751ef04f1aea3063e7036535970ffcfbd79f72"
|
|
39
|
+
"JetBrainsMono.ttf|$FONT_BASE/jetbrainsmono/JetBrainsMono%5Bwght%5D.ttf|48715a42ec242c21e9f02692891e147d022299a52e48d5e413e1a942193ffeda"
|
|
40
|
+
"InstrumentSerif-Italic.ttf|$FONT_BASE/instrumentserif/InstrumentSerif-Italic.ttf|08939b8bdf534afec24ae0ef5e03f948940cd9a8fe08e7fecbad040e62327385"
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
log() { printf '[showreel-setup] %s\n' "$*"; }
|
|
44
|
+
have() { command -v "$1" >/dev/null 2>&1; }
|
|
45
|
+
die() { log "ERROR: $*"; exit 1; }
|
|
46
|
+
|
|
47
|
+
case "$(uname -m)" in
|
|
48
|
+
x86_64 | amd64) ARCH=amd64 FFMPEG_SHA256="$FFMPEG_SHA256_AMD64" ;;
|
|
49
|
+
aarch64 | arm64) ARCH=arm64 FFMPEG_SHA256="$FFMPEG_SHA256_ARM64" ;;
|
|
50
|
+
*) die "unsupported architecture $(uname -m)" ;;
|
|
51
|
+
esac
|
|
52
|
+
|
|
53
|
+
mkdir -p "$BASE_DIR"/{bin,assets/fonts,assets/music,work}
|
|
54
|
+
export PATH="$BASE_DIR/bin:$BASE_DIR/.venv/bin:$PATH"
|
|
55
|
+
|
|
56
|
+
# 1. Base runtimes. Nothing here is installed; a worker without them is not a worker image.
|
|
57
|
+
for t in node npm bun python3 curl tar; do have "$t" || die "$t is missing"; done
|
|
58
|
+
log "node $(node --version), bun $(bun --version), $(python3 --version)"
|
|
59
|
+
|
|
60
|
+
# 2. ffmpeg (+ optional ffprobe) from the pinned static build.
|
|
61
|
+
fetch_ffmpeg_tarball() {
|
|
62
|
+
local tar="$BASE_DIR/work/ffmpeg-$FFMPEG_VERSION-$ARCH.tar.xz"
|
|
63
|
+
if [ ! -s "$tar" ]; then
|
|
64
|
+
local base="ffmpeg-$FFMPEG_VERSION-$ARCH-static.tar.xz"
|
|
65
|
+
curl -fsSL "https://johnvansickle.com/ffmpeg/releases/$base" -o "$tar" ||
|
|
66
|
+
curl -fsSL "https://johnvansickle.com/ffmpeg/old-releases/$base" -o "$tar"
|
|
67
|
+
fi
|
|
68
|
+
echo "$FFMPEG_SHA256 $tar" | sha256sum -c - >/dev/null || { rm -f "$tar"; die "ffmpeg tarball sha256 mismatch"; }
|
|
69
|
+
echo "$tar"
|
|
70
|
+
}
|
|
71
|
+
# Capture first: `ffmpeg ... | grep -q` dies of SIGPIPE under pipefail and reads as "no libx264".
|
|
72
|
+
has_x264() { have ffmpeg && grep -q libx264 <<<"$(ffmpeg -hide_banner -encoders 2>/dev/null || true)"; }
|
|
73
|
+
if [ "$FORCE_LOCAL_FFMPEG" != 1 ] && has_x264; then
|
|
74
|
+
log "ffmpeg ok: $(ffmpeg -version | head -1 | cut -c1-40)"
|
|
75
|
+
else
|
|
76
|
+
log "ffmpeg with libx264 not found, installing pinned $FFMPEG_VERSION static build"
|
|
77
|
+
tar -xJf "$(fetch_ffmpeg_tarball)" -C "$BASE_DIR/bin" --strip-components=1 "ffmpeg-$FFMPEG_VERSION-$ARCH-static/ffmpeg"
|
|
78
|
+
fi
|
|
79
|
+
if [ "$INSTALL_FFPROBE" = 1 ] && ! have ffprobe; then
|
|
80
|
+
log "installing ffprobe $FFMPEG_VERSION (the worker image ships ffmpeg only)"
|
|
81
|
+
tar -xJf "$(fetch_ffmpeg_tarball)" -C "$BASE_DIR/bin" --strip-components=1 "ffmpeg-$FFMPEG_VERSION-$ARCH-static/ffprobe"
|
|
82
|
+
fi
|
|
83
|
+
|
|
84
|
+
# 3. Playwright + Chromium. The worker image has them under /opt; otherwise install locally.
|
|
85
|
+
PLAYWRIGHT_ROOT=""
|
|
86
|
+
for root in /opt/global-deps-full/node_modules "$BASE_DIR/node_modules"; do
|
|
87
|
+
if [ "$FORCE_LOCAL_PLAYWRIGHT" = 1 ] && [ "$root" != "$BASE_DIR/node_modules" ]; then continue; fi
|
|
88
|
+
if [ -d "$root/playwright" ]; then PLAYWRIGHT_ROOT="$root"; break; fi
|
|
89
|
+
done
|
|
90
|
+
if [ -z "$PLAYWRIGHT_ROOT" ]; then
|
|
91
|
+
log "playwright not found, installing playwright@$PLAYWRIGHT_VERSION into $BASE_DIR"
|
|
92
|
+
npm install --prefix "$BASE_DIR" --no-audit --no-fund "playwright@$PLAYWRIGHT_VERSION" >/dev/null
|
|
93
|
+
PLAYWRIGHT_ROOT="$BASE_DIR/node_modules"
|
|
94
|
+
fi
|
|
95
|
+
if [ "$FORCE_LOCAL_PLAYWRIGHT" = 1 ]; then
|
|
96
|
+
export PLAYWRIGHT_BROWSERS_PATH="$BASE_DIR/browsers"
|
|
97
|
+
elif [ -d /opt/playwright ]; then
|
|
98
|
+
export PLAYWRIGHT_BROWSERS_PATH=/opt/playwright
|
|
99
|
+
else
|
|
100
|
+
export PLAYWRIGHT_BROWSERS_PATH="${PLAYWRIGHT_BROWSERS_PATH:-$BASE_DIR/browsers}"
|
|
101
|
+
fi
|
|
102
|
+
smoke() {
|
|
103
|
+
PLAYWRIGHT_ROOT="$PLAYWRIGHT_ROOT" node -e '
|
|
104
|
+
const { createRequire } = require("node:module");
|
|
105
|
+
const { chromium } = createRequire(process.env.PLAYWRIGHT_ROOT + "/")("playwright");
|
|
106
|
+
(async () => {
|
|
107
|
+
const b = await chromium.launch();
|
|
108
|
+
const p = await b.newPage({ viewport: { width: 64, height: 64 } });
|
|
109
|
+
await p.setContent("<canvas id=c></canvas>");
|
|
110
|
+
console.log("chromium", b.version());
|
|
111
|
+
await b.close();
|
|
112
|
+
})().catch((e) => { console.error(String(e.message).split("\n")[0]); process.exit(1); });
|
|
113
|
+
' 2>&1
|
|
114
|
+
}
|
|
115
|
+
if ! chromium_out=$(smoke); then
|
|
116
|
+
log "no working Chromium, running playwright install chromium into $PLAYWRIGHT_BROWSERS_PATH"
|
|
117
|
+
PLAYWRIGHT_BROWSERS_PATH="$PLAYWRIGHT_BROWSERS_PATH" "$PLAYWRIGHT_ROOT/.bin/playwright" install chromium >/dev/null
|
|
118
|
+
chromium_out=$(smoke) || die "Chromium still does not launch: $chromium_out (missing system libraries need root: npx playwright install-deps chromium)"
|
|
119
|
+
fi
|
|
120
|
+
log "playwright $(PLAYWRIGHT_ROOT="$PLAYWRIGHT_ROOT" node -e 'console.log(require("node:module").createRequire(process.env.PLAYWRIGHT_ROOT + "/")("playwright/package.json").version)'), $chromium_out"
|
|
121
|
+
|
|
122
|
+
# 4. numpy in a venv, for the music beat/drop analysis. A venv survives restarts, ~/.local does not.
|
|
123
|
+
if ! "$BASE_DIR/.venv/bin/python" -c 'import numpy' 2>/dev/null; then
|
|
124
|
+
log "creating venv and installing numpy"
|
|
125
|
+
python3 -m venv "$BASE_DIR/.venv"
|
|
126
|
+
"$BASE_DIR/.venv/bin/pip" install --quiet --disable-pip-version-check numpy
|
|
127
|
+
fi
|
|
128
|
+
log "numpy $("$BASE_DIR/.venv/bin/python" -c 'import numpy; print(numpy.__version__)')"
|
|
129
|
+
|
|
130
|
+
# 5. Fonts, sha256-pinned.
|
|
131
|
+
for spec in "${FONTS[@]}"; do
|
|
132
|
+
IFS='|' read -r name url sha <<<"$spec"
|
|
133
|
+
dest="$BASE_DIR/assets/fonts/$name"
|
|
134
|
+
if [ -s "$dest" ] && echo "$sha $dest" | sha256sum -c - >/dev/null 2>&1; then continue; fi
|
|
135
|
+
log "downloading $name"
|
|
136
|
+
curl -fsSL "$url" -o "$dest"
|
|
137
|
+
echo "$sha $dest" | sha256sum -c - >/dev/null || { rm -f "$dest"; die "$name sha256 mismatch (google/fonts changed it: re-pin the hash after looking at the new file)"; }
|
|
138
|
+
done
|
|
139
|
+
log "fonts ok: $(ls "$BASE_DIR/assets/fonts" | tr '\n' ' ')"
|
|
140
|
+
|
|
141
|
+
# 6. The real Agent Swarm logo. Never draw your own. Repo copy and live site must match; the live site wins.
|
|
142
|
+
if [ ! -s "$BASE_DIR/assets/logo.png" ]; then
|
|
143
|
+
curl -fsSL "https://agent-swarm.dev/logo.png" -o "$BASE_DIR/assets/logo.png"
|
|
144
|
+
curl -fsSL "https://raw.githubusercontent.com/desplega-ai/agent-swarm/main/apps/ui/public/logo.png" -o "$BASE_DIR/work/logo.repo.png"
|
|
145
|
+
if ! cmp -s "$BASE_DIR/assets/logo.png" "$BASE_DIR/work/logo.repo.png"; then
|
|
146
|
+
log "WARNING: agent-swarm.dev/logo.png differs from apps/ui/public/logo.png on main. Using the live site copy; say so in the output."
|
|
147
|
+
fi
|
|
148
|
+
fi
|
|
149
|
+
log "logo sha256 $(sha256sum "$BASE_DIR/assets/logo.png" | cut -c1-16)"
|
|
150
|
+
|
|
151
|
+
# 7. Tools, example reel and the environment file.
|
|
152
|
+
mkdir -p "$BASE_DIR/tools" "$BASE_DIR/example"
|
|
153
|
+
if [ "$SELF_DIR" != "$BASE_DIR" ]; then
|
|
154
|
+
cp -r "$SELF_DIR/tools/." "$BASE_DIR/tools/"
|
|
155
|
+
cp -r "$SELF_DIR/example/." "$BASE_DIR/example/"
|
|
156
|
+
cp "$SELF_DIR/setup.sh" "$BASE_DIR/setup.sh"
|
|
157
|
+
fi
|
|
158
|
+
chmod +x "$BASE_DIR"/tools/*.sh
|
|
159
|
+
cat >"$BASE_DIR/env.sh" <<EOF
|
|
160
|
+
# source this before working: . $BASE_DIR/env.sh
|
|
161
|
+
export PATH="$BASE_DIR/bin:$BASE_DIR/.venv/bin:\$PATH"
|
|
162
|
+
export PLAYWRIGHT_ROOT="$PLAYWRIGHT_ROOT"
|
|
163
|
+
export PLAYWRIGHT_BROWSERS_PATH="$PLAYWRIGHT_BROWSERS_PATH"
|
|
164
|
+
export FONTS="SG=$BASE_DIR/assets/fonts/SpaceGrotesk.ttf,JB=$BASE_DIR/assets/fonts/JetBrainsMono.ttf,IS=$BASE_DIR/assets/fonts/InstrumentSerif-Italic.ttf"
|
|
165
|
+
export LOGO="$BASE_DIR/assets/logo.png"
|
|
166
|
+
EOF
|
|
167
|
+
log "done. Next: . $BASE_DIR/env.sh && cd $BASE_DIR/example/tla-races && bash smoke.sh"
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: motion-design-replication
|
|
3
|
+
description: Rebuild the feel of a reference motion-design clip (camera, depth of field, easing, captions, outro) as an on-brand agent-swarm piece in Remotion, then prove it with side-by-side frames and a model re-read of the replica. Use when asked to "replicate this video's vibe for the swarm", "make one like this but ours", or to rebuild a competitor/product clip. Runs after motion-design-video-analysis.
|
|
4
|
+
metadata:
|
|
5
|
+
type: procedure
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Motion-design replication
|
|
9
|
+
|
|
10
|
+
Takes a reference clip and produces a replica that matches its craft (resolution, fps, duration, camera, DOF, easing, caption style, outro) while swapping everything brand-specific (palette, logo, shapes, copy) for agent-swarm's. Built on a run that rebuilt Linear's "Loops updates" dial as a Schedules teaser. Keep the working R3F + postprocessing + label setup from your first 3D composition in your Remotion project and reuse it.
|
|
11
|
+
|
|
12
|
+
The bar is the highest quality of content. A render that passes automated checks proves nothing about how it looks. The loop in Step 5 is the work.
|
|
13
|
+
|
|
14
|
+
## Step 1 — analyse and write the rebuild spec
|
|
15
|
+
|
|
16
|
+
Run `motion-design-video-analysis` on the reference, including its rebuild-spec section and the by-eye claim check. You need, in frames: every cut, every caption change, every transition window. Pull 10 fps windows around each transition; a cut hidden under a fast element reads as a "camera move" to both you and the model until you step frames.
|
|
17
|
+
|
|
18
|
+
## Step 2 — pick the swarm subject and map it onto the reference's metaphor
|
|
19
|
+
|
|
20
|
+
Pick the feature whose shape matches the reference's central object (a dial ⇒ Schedules, because a dial reads as a clock and a clock maps onto cron). Write captions that follow one real run of that feature, in product vocabulary, checked against the repo docs (`agent-swarm/docs-site/content/docs/`). Keep the reference's caption count and rhythm, not its words.
|
|
21
|
+
|
|
22
|
+
## Step 3 — collect real brand assets; never redraw
|
|
23
|
+
|
|
24
|
+
Copy, don't approximate. For Agent Swarm:
|
|
25
|
+
|
|
26
|
+
- **Mark**: `apps/ui/public/logo.png` in `desplega-ai/agent-swarm` (the hex mark; byte-identical to `docs-site/public/logo.png` and `https://agent-swarm.dev/logo.png`; verify with `sha256sum`). There is no logo SVG.
|
|
27
|
+
- **Wordmark**: "Agent Swarm", Space Grotesk 600, tracking -0.01em, near-white. If your project only vendors Space Grotesk 400/500/700, 600 renders as 700; say so if it matters.
|
|
28
|
+
- **Fonts**: Space Grotesk (display) + Space Mono (labels).
|
|
29
|
+
- **Colour**: amber-400 #fabc00, amber-300 #ffd237, zinc-950 #09090b, zinc-400 #9f9fa9 (amber-500 #f69e00 reads brown at low alpha). three.js wants hex: convert oklch tokens with culori (`formatHex(clampChroma(parse(x),'oklch'))`).
|
|
30
|
+
- **Feature icons**: the app's own lucide icons (`apps/ui/src/components/layout/app-sidebar.tsx`), e.g. Schedules = `ClockIcon`.
|
|
31
|
+
|
|
32
|
+
Keep the reference's grade (e.g. dark, low-key) and let the brand accent carry only the "live" elements, or the piece stops reading like the reference.
|
|
33
|
+
|
|
34
|
+
## Step 4 — build in your Remotion project
|
|
35
|
+
|
|
36
|
+
See `video-generation` for the project layout. New composition under `src/compositions/<Name>/`, registered in `src/Root.tsx`, timeline constants in a `timeline.ts` in frames. Land it as a draft PR; never merge.
|
|
37
|
+
|
|
38
|
+
For a 3D reference use `@remotion/three` + three.js + `postprocessing`. Traps that each cost an hour on the first run:
|
|
39
|
+
|
|
40
|
+
1. **GL backend**: only `--gl=swangle` works in worker containers (`angle`, `egl`, `swiftshader`, `vulkan` all fail "Error creating WebGL context").
|
|
41
|
+
2. **`@react-three/postprocessing` renders black under Remotion.** It builds its composer in a `useEffect`, after Remotion's single per-frame `advance()`. Build `postprocessing`'s `EffectComposer` yourself in a `useMemo` and render it from `useFrame(..., 1)`.
|
|
42
|
+
3. **Anything that loads async inside the canvas misses the frame.** Remotion advances R3F once per frame; a texture that lands after that is never captured. Preload outside `<ThreeCanvas>` behind `delayRender`, mount the canvas when ready.
|
|
43
|
+
4. **troika-three-text is invisible under swangle** (typesets, empty SDF atlas). Draw labels to a 2D canvas with the loaded webfont and use a `CanvasTexture` on a plane (`alphaTest` + `depthWrite` so DOF sees them). A 3-row texture with the text in the middle row makes a free mask for caption rolls (slide `texture.offset.y`).
|
|
44
|
+
5. **DOF focus is wrong unless you call `cocMaterial.adoptCameraSettings(camera)`** after changing near/far. Set `cocMaterial.focusDistance` / `focusRange` in world units per frame; scale `bokehScale` by `canvasWidth / 1920` so previews match the master.
|
|
45
|
+
6. **Transparent draw order**: a transparent dial surface drawn after an additive `depthWrite:false` element paints over it. Give the base surface `renderOrder={-10}` and effects a high one. Dynamic `BufferGeometry` needs `frustumCulled={false}` (its bounding sphere is computed once, from zeros).
|
|
46
|
+
7. **Render cost**: swangle saturates every core, so `--concurrency` beyond 2 buys nothing. MSAA and full-res DOF dominate (~2.6 s/frame with MSAA 4 + full-res DOF; with `multisampling: 0` and DOF `resolutionScale: 0.5` a 858-frame piece renders in ~7.5 min at 960x540 and ~8–9 min at 1080p). `--scale=0.333` fails (non-integer height); use 0.5 for previews.
|
|
47
|
+
8. **Font delayRender timeout**: `loadFont` in `src/theme/fonts.ts` can hold a delayRender that fires ~118 s into a long render and kills it. Pass `--timeout=3600000`, then check the outro frames actually use the brand font.
|
|
48
|
+
9. **Audio**: if your `remotion.config.ts` mutes the project, pass `--muted=false` and verify with `ffmpeg -i out.mp4` that an audio stream exists.
|
|
49
|
+
10. **Color range**: add `--color-space=bt709` or the mp4 comes out full-range `yuvj420p` (see `video-generation`).
|
|
50
|
+
|
|
51
|
+
Camera per shot = keyframed position/look/fov/focus in a pure `camAt(frame)` function, set inside `useFrame`. Express positions relative to the subject (radial out / tangential / up) so a shot survives geometry changes.
|
|
52
|
+
|
|
53
|
+
## Step 5 — build → look → critique, at least 3 rounds
|
|
54
|
+
|
|
55
|
+
Each round:
|
|
56
|
+
|
|
57
|
+
1. Render the whole piece at `--scale=0.5`.
|
|
58
|
+
2. Extract original and replica frames at the same ~12–14 timestamps (one per beat plus each transition) into one labelled side-by-side PNG sheet. A helper that does `grab(video, t)` via ffmpeg rawvideo + PIL paste is enough.
|
|
59
|
+
3. Open the sheet. Write down every difference, as concrete as "caption is 26% of frame width vs 38%", "ticks converge upward, reference converges downward ⇒ camera is inside the ring, move it past the centre".
|
|
60
|
+
4. Fix and re-render. For camera/framing fixes, render 3–5 stills (`remotion still --frame=N`) and compare them before paying for a full render.
|
|
61
|
+
5. Measure motion, not just frames: per-second median |Δ| at native fps (160x90 gray) for both clips. Stills can't show a camera that barely moves. On the first run a replica that matched every still was 80% frozen at 30 fps against the reference's 30%, because its drift was a third of the reference's.
|
|
62
|
+
6. Sample densely wherever the camera moves. Sparse beat sampling (one frame per beat, ~14 total) misses mid-beat geometry and focus defects: on the first run a flat ring pinching edge-on, a caption fully out of focus, and a caption running off the frame edge all sat between the sampled timestamps for 6 rounds. In camera-moving shots sample every 0.5s against the original at the same times, and for each caption check the middle of its hold: sharp, legible, and fully inside the frame. Draw hairline tracks as tubes (or screen-space lines), never flat annuli, so they cannot collapse at grazing angles.
|
|
63
|
+
|
|
64
|
+
Record each round's differences and fixes in the notes. That log is a deliverable. Expect 5–6 rounds for a 3D piece; the first two are mostly about getting anything on screen (see Step 4 traps).
|
|
65
|
+
|
|
66
|
+
## Step 6 — music and audio
|
|
67
|
+
|
|
68
|
+
Match the reference's measured audio (analysis Step 2). Pick a CC0 or CC BY track from a curated bank (or fetch one with the template's `fetch-music.sh`); don't generate. To choose, send the reference audio and 2 candidate 28s cuts to `google/gemini-3.8-flash` in one request and ask for a similarity rating. Level-match to the reference's mean volume (`volumedetect`), trim, fade, and credit the track. If nothing fits, ship silent and say so. No voiceover.
|
|
69
|
+
|
|
70
|
+
## Step 7 — master and deliverables
|
|
71
|
+
|
|
72
|
+
- Master at the reference's aspect and fps; if the reference is a downscaled delivery (e.g. 640x360), render a 1080p master and a reference-resolution copy.
|
|
73
|
+
- Side-by-side mp4 on one timeline, reference audio left channel, replica right:
|
|
74
|
+
`ffmpeg -i ref.mp4 -i replica.mp4 -filter_complex "[0:v]scale=960:540,setsar=1[a];[1:v]scale=960:540,setsar=1[b];[a][b]hstack=inputs=2[v];[0:a][1:a]amerge=inputs=2,pan=stereo|c0<c0+c1|c1<c2+c3[aout]" -map "[v]" -map "[aout]" -c:v libx264 -crf 18 -c:a aac side-by-side.mp4`
|
|
75
|
+
- PNG comparison sheet from the final round.
|
|
76
|
+
- Frozen-frame fraction for both clips at 1 fps and native fps (160x90, mean |Δ| < 0.25/255 = frozen). The replica should sit in the reference's range. First run: reference 10.7% / 30.3%, final replica 17.9% / 37.7% (gap mostly in the outro cards).
|
|
77
|
+
- Upload binaries with `agent-fs write <path> --file <local>` (binary-safe) and check `agent-fs stat` sizes.
|
|
78
|
+
|
|
79
|
+
## Step 8 — judge: re-analyse the replica
|
|
80
|
+
|
|
81
|
+
Run `motion-design-video-analysis` Step 4 on **both** clips with the same prompt, model and timestamps (re-run the reference too; an old read used a different prompt). Put the two reads side by side (technique, easing, composition, transitions, vibe) and list where the model sees a difference. A 13-frame call can brush the 30s script cap; retry once before changing anything.
|
|
82
|
+
|
|
83
|
+
Read the differences as signal about the replica, not the model. First run: the model called the reference's opening "2D" but the replica's "3D" (the replica's depth cues were stronger than the reference's), and described the replica as "charcoal" with no mention of the reference's "negative space" (its macro shots were greyer). Both were real.
|
|
84
|
+
|
|
85
|
+
Then name the three weakest remaining spots yourself; the model's read is a second opinion, not the verdict.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: motion-design-video-analysis
|
|
3
|
+
description: Reverse-engineer a short motion-design / product-update video (animation technique, timing and easing, composition, transitions, likely tooling, vibe, audio) and produce a rebuild spec someone can build from. Default path is one call to google/gemini-3.8-flash over sampled frames, then a mandatory by-eye check of every claim. Use when asked how a marketing or product video was made, what its vibe is, or before replicating one (then continue with motion-design-replication).
|
|
4
|
+
metadata:
|
|
5
|
+
type: procedure
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Motion-design video analysis
|
|
9
|
+
|
|
10
|
+
Turns a short (under ~1 min) motion-design clip into two things: an **analysis** (how it was made and how it feels) and a **rebuild spec** (numbers someone can build from without reopening the video). Validated on a 28.6 s product-update clip (Linear's "Loops updates") and reused as the judge on a replica of it.
|
|
11
|
+
|
|
12
|
+
The model is a fast first reader. You are the ground truth. Both models tested on the Linear clip confidently described a "flat 2D view that becomes 3D at 7.5s"; the frames show a 3D scene from t=0. Plan for that class of error.
|
|
13
|
+
|
|
14
|
+
## Prerequisites
|
|
15
|
+
|
|
16
|
+
- `ffmpeg` on PATH. Worker images have a full static build at `/usr/local/bin/ffmpeg` (has `fps`, `tile`, `scale`, `crop`, `hstack`; no `drawtext`, no `ffprobe`: read `ffmpeg -i` stderr, or run the community template's `setup.sh` to add ffprobe). The Remotion-bundled ffmpeg under `node_modules/@remotion/compositor-*` is stripped (no `fps`, `tile` or `hstack`); don't use it for analysis.
|
|
17
|
+
- Pixel maths: `python3 -m venv /tmp/venv && /tmp/venv/bin/pip install numpy pillow` (system pip is blocked by PEP 668; this venv install was run and works).
|
|
18
|
+
- An OpenRouter credential the script can use. In an Agent Swarm, bind it as an egress credential so the key never enters the script (the header `Authorization: Bearer [REDACTED:OPENROUTER_API_KEY]` resolves at egress in **ephemeral `script-run` only**, see Execution notes). Outside a swarm, any way of calling OpenRouter works.
|
|
19
|
+
- Getting bytes off agent-fs: `agent-fs download <path> -o <file>`. Viewer URLs serve an SPA shell, not the file; use `agent-fs signed-url <path> --json` when a script needs to fetch it. Upload binaries with `agent-fs write <path> --file <local>` (binary-safe).
|
|
20
|
+
|
|
21
|
+
## Step 1 — probe the file
|
|
22
|
+
|
|
23
|
+
```
|
|
24
|
+
ffmpeg -hide_banner -i in.mp4 2>&1 | grep -E "Duration|Stream"
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Record container duration, resolution, fps, and whether an audio stream exists. These go straight into the rebuild spec.
|
|
28
|
+
|
|
29
|
+
## Step 2 — audio: verify, then exercise transcription for real
|
|
30
|
+
|
|
31
|
+
1. A stream existing proves nothing. Measure it: `ffmpeg -i in.mp4 -af volumedetect -f null -` and `-af "silencedetect=noise=-30dB:d=0.5"`.
|
|
32
|
+
2. "No voice" is a narrower claim than "no audio". A music/SFX bed with no speech is common (the Linear clip: AAC stereo, mean -21 dB, active 0–27.1s, no speech).
|
|
33
|
+
3. Always run the transcription call, even when you expect no speech: `ffmpeg -i in.mp4 -vn -ac 1 -ar 16000 -c:a pcm_s16le out.wav`, stage it, send it to `google/gemini-3.8-flash` as `{type:"input_audio", input_audio:{data:<b64>, format:"wav"}}`. Ask: is there speech; if yes, verbatim transcript with timestamps; if no, describe music (tempo, instrumentation, mood) and each SFX with its timestamp. SFX timestamps matter for the rebuild (they mark the beats).
|
|
34
|
+
|
|
35
|
+
## Step 3 — look at the whole clip yourself first
|
|
36
|
+
|
|
37
|
+
Before any model call, build contact sheets and read them:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
ffmpeg -i in.mp4 -vf "fps=2,scale=480:270,tile=4x5:padding=4:color=red" sheet_%d.png
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
2 fps catches every cut and caption change in a ~30s clip. For each transition, pull a 10 fps window (`-ss <t-0.4> -t 1.2 -vf "fps=10,scale=320:180,tile=4x4"`) to see how it happens: hard cut, mask roll, blur cross, whip. Write a beat list from this (time, what changes). The model call is a second opinion on your beat list, not the source of it.
|
|
44
|
+
|
|
45
|
+
## Step 4 — default model call: google/gemini-3.8-flash over sampled frames
|
|
46
|
+
|
|
47
|
+
**Never send raw video.** Every raw-video attempt (base64 `video_url`) timed out on every model, including inside a durable run with `timeoutMs: 180000`; the effective cap stayed ~30s.
|
|
48
|
+
|
|
49
|
+
1. Sample ~12 frames across the clip: `ffmpeg -i in.mp4 -vf "fps=12/<duration>,scale=480:-1" f_%03d.jpg`. Add frames right before and after each cut you found in Step 3.
|
|
50
|
+
2. Base64 them into one JSON (`[{t, b64}]`), write it to agent-fs, get a signed URL.
|
|
51
|
+
3. In an ephemeral `script-run`, fetch the JSON, and send one request to `google/gemini-3.8-flash`: a structured prompt, then alternating `{type:"text", text:"t=<n>s"}` / `{type:"image_url", image_url:{url:"data:image/jpeg;base64,..."}}` parts.
|
|
52
|
+
4. Prompt for exactly these sections, each claim citing a timestamp: animation technique; timing & easing; composition & layout; transitions; likely tooling; vibe & aesthetic. Ask it to state whether the scene is 2D or 3D **at each timestamp** and what evidence it sees (perspective, foreshortening, blur that varies with depth). The per-timestamp answer makes the miss easy to spot in Step 5; it does **not** prevent it (re-run 2026-09-24 with exactly this question: still "2D" for 0.5–6.6s).
|
|
53
|
+
|
|
54
|
+
Reference numbers: Linear clip, 12 frames, 10.4s, $0.013; 13 frames with the per-timestamp prompt, 26.6s, $0.022. Keep it under ~14 frames at 480px or you hit the ~30s script cap.
|
|
55
|
+
|
|
56
|
+
### Optional — multi-model comparison
|
|
57
|
+
|
|
58
|
+
Only when the user asks which model to use, or the default call fails twice. Resolve IDs from the live catalogue (`GET https://openrouter.ai/api/v1/models`, filter `architecture.input_modalities` for `image`/`video`; users' remembered names are often off by a version). Run each candidate once over the same frame JSON. Record completed / latency / `usage.cost` / grounded-or-generic. Known results: `google/gemini-2.5-pro` matched flash at 2.3x cost and 28.9s; `qwen/qwen3.8-max-0902` handled 1 image but timed out on every 3/7/12-frame request (reproduced 3x).
|
|
59
|
+
|
|
60
|
+
## Step 5 — check every model claim against the frames (mandatory)
|
|
61
|
+
|
|
62
|
+
Make a table: claim → timestamp it cites → what the frame actually shows → keep / correct / drop. Open the frames (`Read` the PNG) for each row. Do not skip a claim because it sounds plausible.
|
|
63
|
+
|
|
64
|
+
What to test for, from the worked example:
|
|
65
|
+
|
|
66
|
+
- **Dimensionality.** Both models said the dial was "a flat 2D-style view" until 7.5s, then "3D". Wrong. At t=0 the arc is foreshortened, a second ring recedes, the "LOOP TRIGGER" letters are squashed vertically, and the dots nearer the camera are blurrier than the rim (depth of field). That is a 3D scene from frame 0. What changes at 7.5s is the **camera** (telephoto head-on → close oblique macro), not the dimensionality. Test for 3D with: foreshortened text or circles, parallel lines converging, blur that varies with depth, parallax between layers during a camera move.
|
|
67
|
+
- **Cuts vs moves.** Models call a hard cut an "orbital camera swing" or "seamless spatial transition". Check the 10 fps window: if one frame is shot A and the next is shot B, it's a cut (the Linear clip has hard cuts at 6.9s and 12.35s, hidden under a fast streak).
|
|
68
|
+
- **Caption transitions.** "Instantaneous typographic cuts" was really a ~5-frame vertical roll inside a mask. Only a 10 fps crop shows it.
|
|
69
|
+
- **Tooling.** Keep it as a hypothesis with its evidence, not a fact.
|
|
70
|
+
|
|
71
|
+
Put corrections in the analysis with the frame that proves them.
|
|
72
|
+
|
|
73
|
+
## Step 6 — write the analysis
|
|
74
|
+
|
|
75
|
+
Sections: Animation technique / Timing & easing / Composition & layout / Transitions / Likely tooling (with evidence) / Vibe & aesthetic / Audio (measured) / Claim check table (Step 5). Then the rebuild spec below. Raw model output goes in a collapsed section at the end. Deliver as markdown on agent-fs (comment-friendly), not a page, unless asked.
|
|
76
|
+
|
|
77
|
+
## Step 7 — the rebuild spec (required output section)
|
|
78
|
+
|
|
79
|
+
Someone should be able to build the piece from this section alone. Measure; don't eyeball when a number is cheap to get.
|
|
80
|
+
|
|
81
|
+
| Field | How to get it | Linear clip example |
|
|
82
|
+
|---|---|---|
|
|
83
|
+
| Canvas, fps, duration | Step 1 probe | 640x360 delivered (16:9, likely a 1080p master), 30 fps, 28.59s = 858 frames |
|
|
84
|
+
| Palette (hex) | luminance-banded sample of non-black pixels over ~7 frames (script below) + top 0.2% highlights | floor #070707, dial surface #111111–#181818, lines #343435, highlights #edeced. Pure monochrome, no accent |
|
|
85
|
+
| Type | read the frames; measure cap height as % of frame height | captions: wide monospace, caps, tracking ~+0.15em, ~3% of frame height, faint glow. Outro: geometric sans (Inter-style), 500, sentence case |
|
|
86
|
+
| Beat timing (frames @30) | from the 2 fps sheet + 10 fps windows | trigger captions roll at 33/93/138; streak launches ~189; cut 207; step captions 207/312; cut 371; step captions 371/420/480/526; fade ~574–592; feature lockup 597–657; tagline 660–744; wordmark ~766→end (858) |
|
|
87
|
+
| Easing (cubic-bezier) | step through 10 fps frames of one move, plot position vs time | streak legs ≈ (0.3,0.55,0.25,1) — fast launch, long settle; caption roll ≈ (0.33,0,0.1,1) over 5 frames; camera drift ≈ (0.35,0,0.65,1); outro settles ≈ (0.16,1,0.3,1) |
|
|
88
|
+
| Camera path | per shot: framing, lens feel, drift direction | shot 1 telephoto from beyond the dial centre looking at the far rim (rim convex, ticks fan toward camera), slow push-in; shot 2 close low oblique macro, slow lateral drift; shot 3 reverse oblique, slow drift, lifts and defocuses to black |
|
|
89
|
+
| DOF and blur | which depth is sharp per shot, where focus racks | shot 1 focus on the rim pip, inner rows soft; shots 2–3 very shallow, rack focus from the incoming streak to the node over ~40 / ~16 frames |
|
|
90
|
+
| Transitions | list each with frame and type | mask roll (captions), hard cut under a fast streak (x2), fade to black, soft-edge left→right wipe (wordmark), blur-rise cross (lockup → tagline), opacity fade, blur-in (final wordmark) |
|
|
91
|
+
| Audio | Step 2 | ambient synth pad, no beat, no voice; soft UI whooshes/ticks near beats; ~1.5s silent tail |
|
|
92
|
+
|
|
93
|
+
Palette sampler (writes nothing, prints hexes):
|
|
94
|
+
|
|
95
|
+
```python
|
|
96
|
+
# /tmp/venv/bin/python pal.py in.mp4 0.5 2 5 8 11 14 17
|
|
97
|
+
import subprocess, sys, numpy as np
|
|
98
|
+
v, ts = sys.argv[1], [float(t) for t in sys.argv[2:]]
|
|
99
|
+
grab = lambda t: np.frombuffer(subprocess.run(["ffmpeg","-v","error","-ss",str(t),"-i",v,"-frames:v","1","-vf","scale=640:360","-f","rawvideo","-pix_fmt","rgb24","-"],capture_output=True).stdout,np.uint8).reshape(-1,3)
|
|
100
|
+
px = np.concatenate([grab(t) for t in ts]).astype(float); px = px[px.sum(1) > 15]
|
|
101
|
+
order = np.argsort(px @ [0.2126,0.7152,0.0722])
|
|
102
|
+
print(["#%02x%02x%02x" % tuple(px[b].mean(0).astype(int)) for b in np.array_split(order, 8)],
|
|
103
|
+
"top", "#%02x%02x%02x" % tuple(px[order[-len(order)//500:]].mean(0).astype(int)))
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Also report **motion density**, because it is the easiest thing to get wrong in a rebuild:
|
|
107
|
+
|
|
108
|
+
- Frozen-frame fraction: sample at 160x90, mean |Δ| < 0.25/255 between consecutive samples counts as frozen. Report at 1 fps and at the native fps. Linear clip: 3/28 (10.7%) at 1 fps, 259/854 (30.3%) at 30 fps, mostly the outro cards plus a ~1s hold around 5s.
|
|
109
|
+
- Per-second median |Δ| at native fps. Linear clip: 0.3–0.8/255 through all three 3D shots (the camera never stops). A first replica drifted at 0.1–0.2 and measured 80% frozen at 30 fps while looking fine in stills.
|
|
110
|
+
|
|
111
|
+
## Execution notes for an Agent Swarm worker
|
|
112
|
+
|
|
113
|
+
- Do OpenRouter calls from ephemeral `script-run` with inline source, one model per call, payload small enough to finish in ~25s. In a durable `launch-script-run`, `ctx.stdlib.fetch` does not get credential-binding substitution ("Missing Authentication header"), and `ctx.step.swarmScript` doesn't fix it.
|
|
114
|
+
- Scripts can't read local paths. Stage frame JSON / audio on agent-fs and fetch a signed URL inside the script.
|
|
115
|
+
- Replicating the clip next? Use `motion-design-replication`; it takes this rebuild spec as its input.
|