| 1 | { |
| 2 | lib, |
| 3 | runCommand, |
| 4 | writeText, |
| 5 | roundabout, |
| 6 | }: |
| 7 | |
| 8 | let |
| 9 | hooks = writeText "hooks.json" ( |
| 10 | builtins.toJSON { |
| 11 | hooks = import ./codex-hooks.nix { inherit lib roundabout; }; |
| 12 | } |
| 13 | ); |
| 14 | plugin = writeText "plugin.json" ( |
| 15 | builtins.toJSON { |
| 16 | name = "roundabout"; |
| 17 | version = roundabout.version; |
| 18 | description = "build admission for agents sharing a machine"; |
| 19 | author.name = "atagen"; |
| 20 | skills = "./skills/"; |
| 21 | interface = { |
| 22 | displayName = "Roundabout"; |
| 23 | shortDescription = "Give shared builds room to run"; |
| 24 | longDescription = "Queue builds, notice overdue leases and keep artifacts within budget."; |
| 25 | developerName = "atagen"; |
| 26 | category = "Productivity"; |
| 27 | capabilities = [ ]; |
| 28 | defaultPrompt = "Help me run builds through Roundabout."; |
| 29 | }; |
| 30 | } |
| 31 | ); |
| 32 | marketplace = writeText "marketplace.json" ( |
| 33 | builtins.toJSON { |
| 34 | name = "roundabout"; |
| 35 | interface.displayName = "Roundabout"; |
| 36 | plugins = [ |
| 37 | { |
| 38 | name = "roundabout"; |
| 39 | source = { |
| 40 | source = "local"; |
| 41 | path = "./plugins/roundabout"; |
| 42 | }; |
| 43 | policy = { |
| 44 | installation = "AVAILABLE"; |
| 45 | authentication = "ON_INSTALL"; |
| 46 | }; |
| 47 | category = "Productivity"; |
| 48 | } |
| 49 | ]; |
| 50 | } |
| 51 | ); |
| 52 | in |
| 53 | runCommand "roundabout-codex-plugin-${roundabout.version}" { } '' |
| 54 | p=$out/plugins/roundabout |
| 55 | mkdir -p $out/.agents/plugins $p/.codex-plugin $p/hooks $p/skills |
| 56 | cp ${marketplace} $out/.agents/plugins/marketplace.json |
| 57 | cp ${plugin} $p/.codex-plugin/plugin.json |
| 58 | cp ${hooks} $p/hooks/hooks.json |
| 59 | cp -r ${../plugin/skills}/. $p/skills/ |
| 60 | '' |