agents-city 0.3.0-beta.21

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.
Files changed (440) hide show
  1. package/.claude-plugin/marketplace.json +16 -0
  2. package/LICENSE +202 -0
  3. package/NOTICE +5 -0
  4. package/README.es.md +2021 -0
  5. package/README.md +1999 -0
  6. package/benchmarks/committee/README.md +39 -0
  7. package/benchmarks/committee/metrics.py +51 -0
  8. package/benchmarks/committee/run.py +64 -0
  9. package/benchmarks/committee/traces/01-single.json +8 -0
  10. package/benchmarks/committee/traces/02-mesh.json +16 -0
  11. package/benchmarks/committee/traces/03-chair.json +15 -0
  12. package/benchmarks/latency/README.md +35 -0
  13. package/benchmarks/latency/fake-claude-cli.mjs +119 -0
  14. package/benchmarks/latency/fake-native-server.mjs +340 -0
  15. package/benchmarks/latency/fake-tui.py +91 -0
  16. package/benchmarks/latency/live.py +380 -0
  17. package/benchmarks/stress/README.md +20 -0
  18. package/benchmarks/stress/run.py +487 -0
  19. package/bin/agents +4 -0
  20. package/bin/agents-city.js +116 -0
  21. package/bin/benchmark +17 -0
  22. package/bin/bus +6 -0
  23. package/bin/cities +3 -0
  24. package/bin/city +86 -0
  25. package/bin/committee +6 -0
  26. package/bin/demo +200 -0
  27. package/bin/exit +5 -0
  28. package/bin/hall +73 -0
  29. package/bin/hall.html +426 -0
  30. package/bin/logs +3 -0
  31. package/bin/report.py +14 -0
  32. package/bin/reset +3 -0
  33. package/bin/road +3 -0
  34. package/bin/seat +10 -0
  35. package/bin/serve.py +1428 -0
  36. package/bin/setup.py +753 -0
  37. package/bin/skills +3 -0
  38. package/bin/test +131 -0
  39. package/bin/test-adapter.py +183 -0
  40. package/bin/test-admision.py +99 -0
  41. package/bin/test-avatar.py +58 -0
  42. package/bin/test-benchmark.py +40 -0
  43. package/bin/test-broker.py +334 -0
  44. package/bin/test-cage.py +206 -0
  45. package/bin/test-card.py +402 -0
  46. package/bin/test-channel.py +379 -0
  47. package/bin/test-cities.py +453 -0
  48. package/bin/test-claude-runtime.py +252 -0
  49. package/bin/test-committee.py +340 -0
  50. package/bin/test-contracts.py +544 -0
  51. package/bin/test-crecimiento.py +164 -0
  52. package/bin/test-demo.py +308 -0
  53. package/bin/test-doctor.py +106 -0
  54. package/bin/test-domains.py +151 -0
  55. package/bin/test-evidencia.py +50 -0
  56. package/bin/test-exit.py +128 -0
  57. package/bin/test-hall-protocol.py +93 -0
  58. package/bin/test-launch.py +169 -0
  59. package/bin/test-live-feed.py +508 -0
  60. package/bin/test-pairing.py +99 -0
  61. package/bin/test-parcels.py +283 -0
  62. package/bin/test-runtime-failures.py +252 -0
  63. package/bin/test-runtime-ui.py +488 -0
  64. package/bin/test-runtime.py +268 -0
  65. package/bin/test-rutas.py +80 -0
  66. package/bin/test-seat.py +1386 -0
  67. package/bin/test-security.py +150 -0
  68. package/bin/test-serve.py +1057 -0
  69. package/bin/test-stress.py +64 -0
  70. package/bin/test-widgets.py +143 -0
  71. package/bin/test-workspace.py +188 -0
  72. package/bin/testlib.py +95 -0
  73. package/bin/tokens.py +14 -0
  74. package/bus/scripts/deploy.sh +60 -0
  75. package/bus/scripts/mint-token.sh +68 -0
  76. package/bus/scripts/setup-dev.sh +79 -0
  77. package/bus/scripts/test-channel.ts +8 -0
  78. package/bus/scripts/test-hub.ts +266 -0
  79. package/bus/scripts/test-local.sh +40 -0
  80. package/bus/scripts/test-queue.ts +132 -0
  81. package/bus/worker/package-lock.json +1971 -0
  82. package/bus/worker/package.json +17 -0
  83. package/bus/worker/src/index.ts +485 -0
  84. package/bus/worker/tsconfig.json +13 -0
  85. package/bus/worker/wrangler.toml +32 -0
  86. package/city/oven/README.md +59 -0
  87. package/city/oven/collect.py +43 -0
  88. package/city/oven/oven.html +4 -0
  89. package/city/scripts/history.py +120 -0
  90. package/city/scripts/seed.py +442 -0
  91. package/city/web/assets/modelos/License.txt +28 -0
  92. package/city/web/assets/modelos/PROCEDENCIA.txt +3 -0
  93. package/city/web/assets/modelos/building-a.glb +0 -0
  94. package/city/web/assets/modelos/building-b.glb +0 -0
  95. package/city/web/assets/modelos/building-c.glb +0 -0
  96. package/city/web/assets/modelos/building-d.glb +0 -0
  97. package/city/web/assets/modelos/building-e.glb +0 -0
  98. package/city/web/assets/modelos/building-f.glb +0 -0
  99. package/city/web/assets/modelos/building-g.glb +0 -0
  100. package/city/web/assets/modelos/building-h.glb +0 -0
  101. package/city/web/assets/sprites/building-a.png +0 -0
  102. package/city/web/assets/sprites/building-b.png +0 -0
  103. package/city/web/assets/sprites/building-c.png +0 -0
  104. package/city/web/assets/sprites/building-d.png +0 -0
  105. package/city/web/assets/sprites/building-e.png +0 -0
  106. package/city/web/assets/sprites/building-f.png +0 -0
  107. package/city/web/assets/sprites/building-g.png +0 -0
  108. package/city/web/assets/sprites/building-h.png +0 -0
  109. package/city/web/assets/sprites/building-i.png +0 -0
  110. package/city/web/assets/sprites/building-j.png +0 -0
  111. package/city/web/assets/sprites/building-k.png +0 -0
  112. package/city/web/assets/sprites/building-l.png +0 -0
  113. package/city/web/assets/sprites/building-m.png +0 -0
  114. package/city/web/assets/sprites/building-n.png +0 -0
  115. package/city/web/assets/sprites/building-skyscraper-a.png +0 -0
  116. package/city/web/assets/sprites/building-skyscraper-b.png +0 -0
  117. package/city/web/assets/sprites/building-skyscraper-c.png +0 -0
  118. package/city/web/assets/sprites/building-skyscraper-d.png +0 -0
  119. package/city/web/assets/sprites/building-skyscraper-e.png +0 -0
  120. package/city/web/assets/sprites/catalogo.json +47 -0
  121. package/city/web/assets/sprites/detail-awning-wide.png +0 -0
  122. package/city/web/assets/sprites/detail-awning.png +0 -0
  123. package/city/web/assets/sprites/detail-overhang-wide.png +0 -0
  124. package/city/web/assets/sprites/detail-overhang.png +0 -0
  125. package/city/web/assets/sprites/detail-parasol-a.png +0 -0
  126. package/city/web/assets/sprites/detail-parasol-b.png +0 -0
  127. package/city/web/assets/sprites/low-detail-building-a.png +0 -0
  128. package/city/web/assets/sprites/low-detail-building-b.png +0 -0
  129. package/city/web/assets/sprites/low-detail-building-c.png +0 -0
  130. package/city/web/assets/sprites/low-detail-building-d.png +0 -0
  131. package/city/web/assets/sprites/low-detail-building-e.png +0 -0
  132. package/city/web/assets/sprites/low-detail-building-f.png +0 -0
  133. package/city/web/assets/sprites/low-detail-building-g.png +0 -0
  134. package/city/web/assets/sprites/low-detail-building-h.png +0 -0
  135. package/city/web/assets/sprites/low-detail-building-i.png +0 -0
  136. package/city/web/assets/sprites/low-detail-building-j.png +0 -0
  137. package/city/web/assets/sprites/low-detail-building-k.png +0 -0
  138. package/city/web/assets/sprites/low-detail-building-l.png +0 -0
  139. package/city/web/assets/sprites/low-detail-building-m.png +0 -0
  140. package/city/web/assets/sprites/low-detail-building-n.png +0 -0
  141. package/city/web/assets/sprites/low-detail-building-wide-a.png +0 -0
  142. package/city/web/assets/sprites/low-detail-building-wide-b.png +0 -0
  143. package/city/web/assets/sprites/medidas.json +248 -0
  144. package/city/web/dist/city.js +939 -0
  145. package/city/web/dist/index.html +294 -0
  146. package/city/web/dist/modelos/License.txt +28 -0
  147. package/city/web/dist/modelos/PROCEDENCIA.txt +3 -0
  148. package/city/web/dist/modelos/building-a.glb +0 -0
  149. package/city/web/dist/modelos/building-b.glb +0 -0
  150. package/city/web/dist/modelos/building-c.glb +0 -0
  151. package/city/web/dist/modelos/building-d.glb +0 -0
  152. package/city/web/dist/modelos/building-e.glb +0 -0
  153. package/city/web/dist/modelos/building-f.glb +0 -0
  154. package/city/web/dist/modelos/building-g.glb +0 -0
  155. package/city/web/dist/modelos/building-h.glb +0 -0
  156. package/city/web/dist/sprites/building-a.png +0 -0
  157. package/city/web/dist/sprites/building-b.png +0 -0
  158. package/city/web/dist/sprites/building-c.png +0 -0
  159. package/city/web/dist/sprites/building-d.png +0 -0
  160. package/city/web/dist/sprites/building-e.png +0 -0
  161. package/city/web/dist/sprites/building-f.png +0 -0
  162. package/city/web/dist/sprites/building-g.png +0 -0
  163. package/city/web/dist/sprites/building-h.png +0 -0
  164. package/city/web/dist/sprites/building-i.png +0 -0
  165. package/city/web/dist/sprites/building-j.png +0 -0
  166. package/city/web/dist/sprites/building-k.png +0 -0
  167. package/city/web/dist/sprites/building-l.png +0 -0
  168. package/city/web/dist/sprites/building-m.png +0 -0
  169. package/city/web/dist/sprites/building-n.png +0 -0
  170. package/city/web/dist/sprites/building-skyscraper-a.png +0 -0
  171. package/city/web/dist/sprites/building-skyscraper-b.png +0 -0
  172. package/city/web/dist/sprites/building-skyscraper-c.png +0 -0
  173. package/city/web/dist/sprites/building-skyscraper-d.png +0 -0
  174. package/city/web/dist/sprites/building-skyscraper-e.png +0 -0
  175. package/city/web/dist/sprites/catalogo.json +47 -0
  176. package/city/web/dist/sprites/detail-awning-wide.png +0 -0
  177. package/city/web/dist/sprites/detail-awning.png +0 -0
  178. package/city/web/dist/sprites/detail-overhang-wide.png +0 -0
  179. package/city/web/dist/sprites/detail-overhang.png +0 -0
  180. package/city/web/dist/sprites/detail-parasol-a.png +0 -0
  181. package/city/web/dist/sprites/detail-parasol-b.png +0 -0
  182. package/city/web/dist/sprites/low-detail-building-a.png +0 -0
  183. package/city/web/dist/sprites/low-detail-building-b.png +0 -0
  184. package/city/web/dist/sprites/low-detail-building-c.png +0 -0
  185. package/city/web/dist/sprites/low-detail-building-d.png +0 -0
  186. package/city/web/dist/sprites/low-detail-building-e.png +0 -0
  187. package/city/web/dist/sprites/low-detail-building-f.png +0 -0
  188. package/city/web/dist/sprites/low-detail-building-g.png +0 -0
  189. package/city/web/dist/sprites/low-detail-building-h.png +0 -0
  190. package/city/web/dist/sprites/low-detail-building-i.png +0 -0
  191. package/city/web/dist/sprites/low-detail-building-j.png +0 -0
  192. package/city/web/dist/sprites/low-detail-building-k.png +0 -0
  193. package/city/web/dist/sprites/low-detail-building-l.png +0 -0
  194. package/city/web/dist/sprites/low-detail-building-m.png +0 -0
  195. package/city/web/dist/sprites/low-detail-building-n.png +0 -0
  196. package/city/web/dist/sprites/low-detail-building-wide-a.png +0 -0
  197. package/city/web/dist/sprites/low-detail-building-wide-b.png +0 -0
  198. package/city/web/dist/sprites/medidas.json +248 -0
  199. package/city/web/dist-hall/hall.js +264 -0
  200. package/city/web/index.html +294 -0
  201. package/city/web/package.json +18 -0
  202. package/city/web/sella.py +21 -0
  203. package/city/web/src/activity-actors.ts +47 -0
  204. package/city/web/src/activity.ts +172 -0
  205. package/city/web/src/ayuntamiento.ts +580 -0
  206. package/city/web/src/draw.ts +640 -0
  207. package/city/web/src/game-speech.ts +79 -0
  208. package/city/web/src/hall.ts +1867 -0
  209. package/city/web/src/main.ts +2225 -0
  210. package/city/web/src/oven.ts +124 -0
  211. package/city/web/src/people.ts +244 -0
  212. package/city/web/src/presencia.ts +193 -0
  213. package/city/web/src/puertas.ts +180 -0
  214. package/city/web/src/repo-roles.ts +59 -0
  215. package/city/worker/package.json +16 -0
  216. package/city/worker/schema.sql +117 -0
  217. package/city/worker/src/index.ts +702 -0
  218. package/city/worker/src/square.ts +218 -0
  219. package/city/worker/wrangler.toml +58 -0
  220. package/demo/ada.md +50 -0
  221. package/demo/bruno.md +62 -0
  222. package/demo/camila.md +56 -0
  223. package/demo/city/ada.md +40 -0
  224. package/demo/city/city.yml +8 -0
  225. package/demo/city/parcels.yml +15 -0
  226. package/demo/city/roads.json +4 -0
  227. package/demo/city/units.yml +10 -0
  228. package/demo/clinica/city.yml +8 -0
  229. package/demo/clinica/parcels.yml +15 -0
  230. package/demo/clinica/roads.json +4 -0
  231. package/demo/clinica/units.yml +9 -0
  232. package/demo/clinica/vera.md +46 -0
  233. package/demo/dante.md +54 -0
  234. package/demo/despacho/city.yml +8 -0
  235. package/demo/despacho/marta.md +46 -0
  236. package/demo/despacho/parcels.yml +15 -0
  237. package/demo/despacho/roads.json +4 -0
  238. package/demo/despacho/units.yml +9 -0
  239. package/demo/elsa.md +50 -0
  240. package/demo/farid.md +52 -0
  241. package/demo/greta.md +50 -0
  242. package/demo/hugo.md +49 -0
  243. package/demo/iris.md +49 -0
  244. package/demo/jonas.md +51 -0
  245. package/demo/kira.md +51 -0
  246. package/demo/luca.md +49 -0
  247. package/demo/parcels.yml +92 -0
  248. package/demo/seed.py +20 -0
  249. package/demo/show.py +161 -0
  250. package/demo/stories.py +824 -0
  251. package/demo/units.yml +33 -0
  252. package/docs/agents-first.md +99 -0
  253. package/docs/glossary.md +55 -0
  254. package/docs/map-live-layers.md +73 -0
  255. package/docs/security.md +231 -0
  256. package/docs/self-host.md +151 -0
  257. package/docs/testing.md +205 -0
  258. package/package.json +73 -0
  259. package/plugin/.claude-plugin/plugin.json +62 -0
  260. package/plugin/.mcp.json +15 -0
  261. package/plugin/channel/activity-cli.ts +16 -0
  262. package/plugin/channel/adapter-prompts.ts +113 -0
  263. package/plugin/channel/adapter.js +4292 -0
  264. package/plugin/channel/adapter.ts +133 -0
  265. package/plugin/channel/bus.js +20188 -0
  266. package/plugin/channel/bus.ts +131 -0
  267. package/plugin/channel/city-config.ts +125 -0
  268. package/plugin/channel/claude-channel.ts +58 -0
  269. package/plugin/channel/cli-args.ts +75 -0
  270. package/plugin/channel/client.js +4200 -0
  271. package/plugin/channel/client.ts +38 -0
  272. package/plugin/channel/committee/activity.ts +256 -0
  273. package/plugin/channel/committee/collection.ts +154 -0
  274. package/plugin/channel/committee/decision.ts +175 -0
  275. package/plugin/channel/committee/floor.ts +135 -0
  276. package/plugin/channel/committee/guards.ts +30 -0
  277. package/plugin/channel/committee/history.ts +38 -0
  278. package/plugin/channel/committee/render.ts +102 -0
  279. package/plugin/channel/committee/service.ts +72 -0
  280. package/plugin/channel/committee/storage.ts +92 -0
  281. package/plugin/channel/committee/types.ts +163 -0
  282. package/plugin/channel/committee/view.ts +63 -0
  283. package/plugin/channel/committee-cli.ts +109 -0
  284. package/plugin/channel/delivery-metrics.ts +61 -0
  285. package/plugin/channel/delivery-queue.ts +118 -0
  286. package/plugin/channel/hub/activity-controller.ts +72 -0
  287. package/plugin/channel/hub/activity-feed.ts +169 -0
  288. package/plugin/channel/hub/committee-controller.ts +60 -0
  289. package/plugin/channel/hub/connections.ts +48 -0
  290. package/plugin/channel/hub/diagnostics.ts +67 -0
  291. package/plugin/channel/hub/envelope-validity.ts +109 -0
  292. package/plugin/channel/hub/envelopes.ts +66 -0
  293. package/plugin/channel/hub/lifecycle.ts +91 -0
  294. package/plugin/channel/hub/local-roads.ts +89 -0
  295. package/plugin/channel/hub/remote-roads.ts +165 -0
  296. package/plugin/channel/hub/road-controller.ts +99 -0
  297. package/plugin/channel/hub-client.ts +149 -0
  298. package/plugin/channel/local-hub.js +5995 -0
  299. package/plugin/channel/local-hub.ts +349 -0
  300. package/plugin/channel/map-reporter.ts +48 -0
  301. package/plugin/channel/package-lock.json +1731 -0
  302. package/plugin/channel/package.json +19 -0
  303. package/plugin/channel/protocol.ts +98 -0
  304. package/plugin/channel/road-cli.ts +18 -0
  305. package/plugin/channel/run.sh +15 -0
  306. package/plugin/channel/runtime/claude.ts +458 -0
  307. package/plugin/channel/runtime/codex-config.ts +77 -0
  308. package/plugin/channel/runtime/codex.ts +669 -0
  309. package/plugin/channel/runtime/command.ts +62 -0
  310. package/plugin/channel/runtime/factory.ts +15 -0
  311. package/plugin/channel/runtime/json-rpc.ts +154 -0
  312. package/plugin/channel/runtime/kimi.ts +277 -0
  313. package/plugin/channel/runtime/opencode.ts +248 -0
  314. package/plugin/channel/runtime/process.ts +84 -0
  315. package/plugin/channel/runtime/types.ts +45 -0
  316. package/plugin/channel/runtime-files.ts +73 -0
  317. package/plugin/channel/runtime-gateway.js +6396 -0
  318. package/plugin/channel/runtime-gateway.ts +358 -0
  319. package/plugin/channel/runtime-metrics.ts +52 -0
  320. package/plugin/channel/runtime-subscription.ts +180 -0
  321. package/plugin/channel/terminal-delivery.ts +131 -0
  322. package/plugin/channel/untrusted.ts +60 -0
  323. package/plugin/commands/committee.md +31 -0
  324. package/plugin/commands/exit.md +32 -0
  325. package/plugin/commands/goals.md +20 -0
  326. package/plugin/commands/join.md +18 -0
  327. package/plugin/commands/notice.md +20 -0
  328. package/plugin/commands/propose.md +19 -0
  329. package/plugin/commands/round.md +17 -0
  330. package/plugin/commands/session.md +22 -0
  331. package/plugin/commands/settings.md +25 -0
  332. package/plugin/commands/setup.md +21 -0
  333. package/plugin/commands/team.md +23 -0
  334. package/plugin/domains/custom.md +27 -0
  335. package/plugin/domains/finance.md +31 -0
  336. package/plugin/domains/healthcare.md +34 -0
  337. package/plugin/domains/legal.md +31 -0
  338. package/plugin/domains/marketing.md +33 -0
  339. package/plugin/domains/operations.md +31 -0
  340. package/plugin/domains/research.md +32 -0
  341. package/plugin/domains/sales.md +30 -0
  342. package/plugin/domains/software.md +37 -0
  343. package/plugin/hooks/activity.sh +6 -0
  344. package/plugin/hooks/digging.sh +68 -0
  345. package/plugin/hooks/growth.sh +42 -0
  346. package/plugin/hooks/hooks.json +106 -0
  347. package/plugin/hooks/notice-on-pr.sh +35 -0
  348. package/plugin/hooks/notice-on-stop.sh +80 -0
  349. package/plugin/hooks/notice-pending.sh +58 -0
  350. package/plugin/hooks/solo-en-ciudad.sh +23 -0
  351. package/plugin/hooks/tokens.sh +47 -0
  352. package/plugin/roles/examples/account-executive.md +25 -0
  353. package/plugin/roles/examples/ai-manager.md +34 -0
  354. package/plugin/roles/examples/associate.md +24 -0
  355. package/plugin/roles/examples/brand-lead.md +20 -0
  356. package/plugin/roles/examples/cfo.md +20 -0
  357. package/plugin/roles/examples/city-lead.md +25 -0
  358. package/plugin/roles/examples/clinical-director.md +26 -0
  359. package/plugin/roles/examples/clinical-ops.md +25 -0
  360. package/plugin/roles/examples/clinician.md +25 -0
  361. package/plugin/roles/examples/compliance.md +27 -0
  362. package/plugin/roles/examples/content.md +24 -0
  363. package/plugin/roles/examples/controller.md +27 -0
  364. package/plugin/roles/examples/cpto.md +41 -0
  365. package/plugin/roles/examples/customer-success.md +25 -0
  366. package/plugin/roles/examples/data-engineer.md +37 -0
  367. package/plugin/roles/examples/data.md +60 -0
  368. package/plugin/roles/examples/dev.md +37 -0
  369. package/plugin/roles/examples/devops.md +39 -0
  370. package/plugin/roles/examples/enablement.md +24 -0
  371. package/plugin/roles/examples/ethics.md +24 -0
  372. package/plugin/roles/examples/fin-analytics.md +27 -0
  373. package/plugin/roles/examples/health-compliance.md +25 -0
  374. package/plugin/roles/examples/health-data.md +26 -0
  375. package/plugin/roles/examples/knowledge.md +25 -0
  376. package/plugin/roles/examples/lifecycle.md +26 -0
  377. package/plugin/roles/examples/llm-engineer.md +34 -0
  378. package/plugin/roles/examples/managing-partner.md +20 -0
  379. package/plugin/roles/examples/methods.md +23 -0
  380. package/plugin/roles/examples/operations-lead.md +23 -0
  381. package/plugin/roles/examples/ops.md +24 -0
  382. package/plugin/roles/examples/patient-safety.md +26 -0
  383. package/plugin/roles/examples/performance.md +27 -0
  384. package/plugin/roles/examples/po.md +36 -0
  385. package/plugin/roles/examples/process-owner.md +23 -0
  386. package/plugin/roles/examples/product-design.md +39 -0
  387. package/plugin/roles/examples/program-manager.md +24 -0
  388. package/plugin/roles/examples/quality.md +25 -0
  389. package/plugin/roles/examples/research-director.md +24 -0
  390. package/plugin/roles/examples/research-ops.md +25 -0
  391. package/plugin/roles/examples/researcher.md +25 -0
  392. package/plugin/roles/examples/revenue-lead.md +25 -0
  393. package/plugin/roles/examples/revops.md +26 -0
  394. package/plugin/roles/examples/seo.md +27 -0
  395. package/plugin/roles/examples/specialist.md +24 -0
  396. package/plugin/scripts/admision.py +165 -0
  397. package/plugin/scripts/apaga.py +232 -0
  398. package/plugin/scripts/avatar.py +211 -0
  399. package/plugin/scripts/broker.py +531 -0
  400. package/plugin/scripts/cage.py +252 -0
  401. package/plugin/scripts/capabilities.py +197 -0
  402. package/plugin/scripts/card.py +312 -0
  403. package/plugin/scripts/cities.py +520 -0
  404. package/plugin/scripts/city-env.sh +90 -0
  405. package/plugin/scripts/city-runtime.sh +87 -0
  406. package/plugin/scripts/city-session.sh +526 -0
  407. package/plugin/scripts/city_env.py +67 -0
  408. package/plugin/scripts/crecimiento.py +140 -0
  409. package/plugin/scripts/deliberations.py +48 -0
  410. package/plugin/scripts/doctor.py +172 -0
  411. package/plugin/scripts/domains.py +201 -0
  412. package/plugin/scripts/evidencia.py +64 -0
  413. package/plugin/scripts/find-repos.sh +111 -0
  414. package/plugin/scripts/gh.py +159 -0
  415. package/plugin/scripts/hall_protocol.py +147 -0
  416. package/plugin/scripts/hook_activity.py +139 -0
  417. package/plugin/scripts/launch.py +94 -0
  418. package/plugin/scripts/logs.py +98 -0
  419. package/plugin/scripts/pairing.py +185 -0
  420. package/plugin/scripts/parcels.py +132 -0
  421. package/plugin/scripts/read-card.py +51 -0
  422. package/plugin/scripts/report.py +201 -0
  423. package/plugin/scripts/reset.py +180 -0
  424. package/plugin/scripts/roads.py +230 -0
  425. package/plugin/scripts/roles.py +274 -0
  426. package/plugin/scripts/runtime_log.py +69 -0
  427. package/plugin/scripts/runtime_processes.py +132 -0
  428. package/plugin/scripts/rutas.py +83 -0
  429. package/plugin/scripts/seat.py +1349 -0
  430. package/plugin/scripts/tokens.py +194 -0
  431. package/plugin/scripts/trust-repos.py +59 -0
  432. package/plugin/scripts/ui.py +280 -0
  433. package/plugin/scripts/units.py +80 -0
  434. package/plugin/scripts/workspace.py +364 -0
  435. package/plugin/skills/city/SKILL.md +191 -0
  436. package/templates/blank.md +39 -0
  437. package/templates/finance.md +44 -0
  438. package/templates/legal.md +45 -0
  439. package/templates/marketing.md +48 -0
  440. package/templates/product.md +45 -0
package/README.md ADDED
@@ -0,0 +1,1999 @@
1
+ # Agents City
2
+
3
+ [Español](README.es.md) · [English](README.md)
4
+
5
+ **Run several autonomous agent cities on one machine, and connect only the
6
+ cities that should talk.**
7
+
8
+ Agents City is a local-first, multi-model orchestrator for repository work. Each
9
+ city has its own identity, domain, chair seat, goal, repo support agents,
10
+ editable knowledge, live-recognised skills, and explicit roads to other cities.
11
+ It does not turn every agent into a group chat: the seat chairs the process,
12
+ selects specialists, and controls the floor.
13
+
14
+ This is the complete guide. If you only want to try it, go to
15
+ [Quick start](#quick-start).
16
+
17
+ ## Contents
18
+
19
+ - [Mental model](#mental-model)
20
+ - [Quick start](#quick-start)
21
+ - [Requirements and installation](#requirements-and-installation)
22
+ - [First run, step by step](#first-run-step-by-step)
23
+ - [Working inside tmux](#working-inside-tmux)
24
+ - [Runtimes and transports](#runtimes-and-transports)
25
+ - [Domains, roles, and knowledge](#domains-roles-and-knowledge)
26
+ - [Complete command reference](#complete-command-reference)
27
+ - [Committee: complete workflow](#committee-complete-workflow)
28
+ - [Claude `/city:` commands](#claude-city-commands)
29
+ - [Use-case cookbook](#use-case-cookbook)
30
+ - [Files and environment variables](#files-and-environment-variables)
31
+ - [Security and trust boundaries](#security-and-trust-boundaries)
32
+ - [Troubleshooting](#troubleshooting)
33
+ - [Development and testing](#development-and-testing)
34
+
35
+ ## Mental model
36
+
37
+ A city is not an account, a remote person, or a free-form collection of bots. It
38
+ is one autonomous work domain owned by a local person:
39
+
40
+ ```text
41
+ local user
42
+ ├── home city
43
+ │ ├── stable identity: owner/home
44
+ │ ├── domain + seat role + goal
45
+ │ ├── seat: chair and only public boundary
46
+ │ ├── agent A: workspace + mounts → a git repo (kind: code)
47
+ │ ├── agent B: workspace + mounts → a folder of documents (kind: knowledge)
48
+ │ ├── agent C: workspace + mounts → several repos and a worktree
49
+ │ ├── editable domain/role knowledge
50
+ │ ├── skills that already live inside the mounted work
51
+ │ └── explicit roads to other seats
52
+ ├── product city
53
+ └── client-a city
54
+ ```
55
+
56
+ **Agents come first.** An agent is the unit, and a repo is just one thing it can
57
+ mount. Each agent has a **workspace folder** with a `mounts/` dir of symlinks to
58
+ wherever the real work lives — a git repo, a linked worktree, or a plain folder
59
+ of documents — so a person whose work is knowledge in documents, with no git at
60
+ all, is a first-class agent. "One repo is one agent" is simply the special case
61
+ of an agent whose single mount is that repo, so **existing repo-only cities keep
62
+ working unchanged**. Full model: [docs/agents-first.md](docs/agents-first.md).
63
+
64
+ The important boundaries are:
65
+
66
+ - **User:** may own several local cities.
67
+ - **City:** has its own identity, domain, goal, configuration, and state.
68
+ - **Seat:** chairs the committee and is the only actor that may cross roads.
69
+ - **Agent:** the member unit. It owns a workspace folder and works over its
70
+ mounts, contributes evidence, and always has member authority — whether its
71
+ speciality is `dev`, `seo` or `cfo`, and whether its **kind** is `code`,
72
+ `knowledge` or `coordinator`.
73
+ - **Mount:** a symlink inside an agent's workspace to real work on disk (a repo,
74
+ a worktree, a document folder). An agent may have several, or none.
75
+ - **Role:** professional perspective and responsibility; it does not grant bus
76
+ permissions.
77
+ - **Skill:** capability installed by the user or repo. Recognition is live and
78
+ read-only; the one deliberate write is the Hall installing a skill zip the
79
+ owner explicitly uploads, into that agent's own home — never on its own,
80
+ never anywhere else. Skills are the Claude runtime's format; other engines
81
+ ignore them.
82
+ - **Road:** allowlist between two seats. It grants reachability, not authority.
83
+ - **Committee:** bounded process for isolated positions, synthesis, floor,
84
+ decision, and verification. It is not lateral conversation between all agents.
85
+
86
+ ## Quick start
87
+
88
+ ### Right now: the real npm experience without publishing
89
+
90
+ Packing first matters: this tests the exact file list a person would receive
91
+ from npm, not the whole checkout.
92
+
93
+ ```bash
94
+ cd /path/to/agents-city
95
+ npm pack
96
+ npm install -g ./agents-city-0.3.0-beta.21.tgz
97
+ agents-city --version
98
+ agents-city seat
99
+ ```
100
+
101
+ You do not need to run `npm publish`. The installation is global only for your
102
+ currently active Node installation.
103
+
104
+ ### Registry installation once available
105
+
106
+ Check availability and dist-tags first:
107
+
108
+ ```bash
109
+ npm view agents-city dist-tags --json
110
+ ```
111
+
112
+ If it returns `E404`, use the local tarball in the previous section. Once the
113
+ registry shows a `beta` dist-tag, install it with:
114
+
115
+ ```bash
116
+ npm install -g agents-city@beta
117
+ agents-city --version
118
+ agents-city seat
119
+ ```
120
+
121
+ Use `@beta` while this is a prerelease. Bare `npm install -g agents-city` should
122
+ be reserved for the future stable release carrying the `latest` tag.
123
+
124
+ ### Open the Hall instead of the terminal wizard
125
+
126
+ ```bash
127
+ agents-city
128
+ # equivalent to:
129
+ agents-city hall
130
+ ```
131
+
132
+ The Hall listens on `127.0.0.1`, chooses a free port, and opens the browser. You
133
+ can create or select a city and edit its configuration there. The Hall and CLI
134
+ use the same underlying modules.
135
+
136
+ ## Requirements and installation
137
+
138
+ ### Base requirements
139
+
140
+ | Requirement | Used for |
141
+ |---|---|
142
+ | Node.js 22 or later | npm package, WebSocket bus, and frontends |
143
+ | npm | installation and packaging |
144
+ | Python 3 | Hall, onboarding, cities, maps, and utilities |
145
+ | bash | sessions and launchers |
146
+ | tmux | one window per seat/repo; `seat` tries to install it when missing |
147
+ | macOS or Linux | natively supported platforms |
148
+ | WSL | required on Windows because native Windows has no bash/tmux |
149
+
150
+ Each runtime also needs its own installed and authenticated CLI. Agents City
151
+ does not bundle or replace Claude, Codex, OpenCode, or Kimi accounts.
152
+
153
+ ```bash
154
+ command -v claude
155
+ command -v codex
156
+ command -v opencode
157
+ command -v kimi
158
+ ```
159
+
160
+ You do not need all of them. An all-Claude, all-Codex, or mixed city is valid.
161
+
162
+ ### GitHub is optional
163
+
164
+ Selecting local repos requires no account. If you choose GitHub during
165
+ onboarding, Agents City uses the separate `gh` CLI:
166
+
167
+ 1. detects it;
168
+ 2. tries the system package manager if it is absent;
169
+ 3. runs `gh auth login --web` when unauthenticated;
170
+ 4. shows the device code if a browser cannot open;
171
+ 5. offers to clone selected repos that are not on disk.
172
+
173
+ `gh` is not bundled inside the Agents City npm package.
174
+
175
+ ### Update a local installation
176
+
177
+ ```bash
178
+ cd /path/to/agents-city
179
+ npm pack
180
+ npm install -g ./agents-city-0.3.0-beta.21.tgz
181
+ agents-city --version
182
+ ```
183
+
184
+ Already-running sessions retain the code loaded in memory. To apply the new
185
+ version to one city:
186
+
187
+ ```bash
188
+ agents-city exit home --dry-run
189
+ agents-city exit home
190
+ agents-city seat --city home
191
+ ```
192
+
193
+ Save active work first: `exit` closes every window in that city.
194
+
195
+ ### Uninstall
196
+
197
+ ```bash
198
+ npm uninstall -g agents-city
199
+ ```
200
+
201
+ This removes the installed program. It does **not** remove `~/.agents-city`, your
202
+ cities, backups, or repositories. Use `agents-city reset` only when you intend to
203
+ restart one specific city.
204
+
205
+ ## First run, step by step
206
+
207
+ `agents-city seat` creates `home` when no city exists and asks for five decisions.
208
+
209
+ ### 1. Work domain
210
+
211
+ The domain determines vocabulary, evidence criteria, and suggested roles. The
212
+ built-in options are:
213
+
214
+ | ID | Domain |
215
+ |---|---|
216
+ | `software` | Software development |
217
+ | `healthcare` | Healthcare and medicine |
218
+ | `legal` | Legal services |
219
+ | `finance` | Finance and operations |
220
+ | `marketing` | Marketing and growth |
221
+ | `sales` | Sales and customer success |
222
+ | `research` | Research and education |
223
+ | `operations` | Operations and delivery |
224
+ | `custom` | Another domain without assuming an industry |
225
+
226
+ ### 2. Seat role
227
+
228
+ This is the responsibility of the city lead. It is not the city name or runtime.
229
+ The seat remains chair even when you choose `blank`.
230
+
231
+ ### 3. Repositories and each agent's role
232
+
233
+ You can read repositories from disk, your GitHub account, or a GitHub
234
+ organisation. Each selected local repo receives:
235
+
236
+ - a tmux window;
237
+ - a private bus actor;
238
+ - its repository as working directory;
239
+ - an explicit operating role;
240
+ - the skills its runtime can already discover there.
241
+
242
+ A repo role may come from another domain. For example, a software city can give
243
+ `po` to its product repo, `seo` to a portfolio, and `data-engineer` to a
244
+ pipeline. None becomes chair.
245
+
246
+ Selecting zero repos is also valid: the city opens with only its seat.
247
+
248
+ ### 4. Goal
249
+
250
+ A goal may be quantitative or qualitative. It stores:
251
+
252
+ - title;
253
+ - observed signal;
254
+ - a command that returns the measure, when one exists;
255
+ - person and review frequency for a qualitative judgement;
256
+ - baseline;
257
+ - target;
258
+ - target date.
259
+
260
+ You may skip it and configure it later with `agents-city seat --goal`.
261
+
262
+ ### 5. Runtime for each window
263
+
264
+ Pressing Enter keeps Claude everywhere. You may instead choose per window:
265
+
266
+ - Claude and, optionally, model/effort;
267
+ - Codex;
268
+ - OpenCode;
269
+ - Kimi;
270
+ - an unknown command through the explicit terminal fallback.
271
+
272
+ Persistent choices live in the owner card. `seat --model` and `--effort` are
273
+ one-launch overrides only.
274
+
275
+ ### What gets created
276
+
277
+ ```text
278
+ ~/.agents-city/
279
+ ├── .runtime/ # bus endpoints, queues, and ephemeral state
280
+ ├── state/ # local map state, separated per city
281
+ ├── .backups/ # old migrations
282
+ └── <owner>/
283
+ ├── .current # selected city
284
+ ├── .backups/ # recoverable owner resets
285
+ └── <city>/
286
+ ├── city.yml # id, name, slug, owner, domain
287
+ ├── roads.json # allowed roads
288
+ ├── <owner>.md # role, repos, roles, goal, runtimes
289
+ ├── AGENTS.md # how to read this city
290
+ ├── domains/ # editable domain knowledge
291
+ ├── roles/ # editable role knowledge
292
+ ├── deliberations/ # committee state, events, and acts
293
+ ├── units.yml # map districts, when used
294
+ └── parcels.yml # map houses/parcels, when used
295
+ ```
296
+
297
+ The `~/.agents-city` root is a container, never a city. `home` is simply the
298
+ first city and is isolated exactly like `product` or `client-a`.
299
+
300
+ ## Working inside tmux
301
+
302
+ A session is named `<owner>-<city>` and contains:
303
+
304
+ - a `seat` window, located in the city folder;
305
+ - one window per locally found repo;
306
+ - the configured runtime already started in each window.
307
+
308
+ Shortcuts are added only to the currently running tmux server:
309
+
310
+ | Action | Shortcut |
311
+ |---|---|
312
+ | Switch to windows 1–9 | `Alt+1` … `Alt+9` |
313
+ | Previous/next window | `Alt+←` / `Alt+→` |
314
+ | Select with mouse | click the bottom status bar |
315
+ | Scroll | mouse wheel |
316
+ | Detach without closing | `Ctrl-b`, then `d` |
317
+ | Return to the city | `agents-city seat --city <name>` |
318
+
319
+ If the session already exists, `seat` reattaches to it; it does not create a
320
+ duplicate set of agents. A bell or activity-coloured tab means that window may
321
+ need attention.
322
+
323
+ Claude starts in a stagger because multiple instances share its OAuth token.
324
+ Codex, OpenCode, and Kimi do not wait for that stagger. Use
325
+ `CITY_SETTLE=0 CITY_STAGGER=0` only when you deliberately want to disable it.
326
+
327
+ Do not close a city by killing generic processes. Use:
328
+
329
+ ```bash
330
+ agents-city exit <city> --dry-run
331
+ agents-city exit <city>
332
+ ```
333
+
334
+ ## Runtimes and transports
335
+
336
+ All runtimes receive typed envelopes from the same local WebSocket bus, but each
337
+ provider has a native last mile:
338
+
339
+ | Runtime | Bus task delivery | Visible interface | Requirement |
340
+ |---|---|---|---|
341
+ | Claude | persistent `stream-json` over stdin/stdout | interactive `city>` gateway plus visible Claude transcript | authenticated `claude` CLI; no Team account or admin policy |
342
+ | Codex | `app-server` WebSocket | official TUI connected with `codex --remote` | authenticated `codex` CLI |
343
+ | OpenCode | HTTP/SSE API | interactive gateway `city>` console | configured `opencode` CLI |
344
+ | Kimi | REST + WebSocket | interactive gateway `city>` console | configured `kimi` or `kimi-code` CLI |
345
+ | Unknown CLI | compatibility adapter | its own TUI/command inside tmux | explicit `terminal:<command>` setting |
346
+
347
+ Claude, Codex, OpenCode, and Kimi tasks are **not** pasted into tmux and do not
348
+ use the clipboard. Terminal fallback exists only for an explicitly selected
349
+ unknown command.
350
+
351
+ Agents City does **not** use custom Claude Channels in its normal launch path.
352
+ The same official Claude Code process stays open in print/streaming mode and
353
+ receives JSONL turns directly from the city gateway. A personal Pro/Max account
354
+ therefore needs no `sudo`, `managed-settings.json`, Team console, Channel
355
+ allowlist, development bypass, or per-window confirmation. The installed plugin
356
+ still supplies its MCP tools, skills and hooks normally. Custom Channels remain
357
+ an optional upstream preview mechanism, not a prerequisite for Agents City.
358
+
359
+ Conceptual multi-model card settings:
360
+
361
+ ```yaml
362
+ runs.seat: codex
363
+ runs.api: codex --model gpt-5
364
+ runs.analytics: opencode -m lmstudio/qwen3-coder
365
+ runs.research: kimi
366
+ runs.legacy: terminal:gemini
367
+ model.docs: sonnet
368
+ effort.docs: high
369
+ ```
370
+
371
+ When the seat does not use Claude, it has no `/city:` commands. Everything
372
+ fundamental remains available through `agents-city committee`, `road`, `bus`,
373
+ `skills`, `seat`, `reset`, and `exit`.
374
+
375
+ ## Domains, roles, and knowledge
376
+
377
+ ### Built-in roles by domain
378
+
379
+ | Domain | Available role IDs |
380
+ |---|---|
381
+ | `software` | `cpto`, `dev`, `data-engineer`, `devops`, `data`, `product-design`, `po`, `llm-engineer`, `ai-manager`, `blank` |
382
+ | `healthcare` | `clinical-director`, `clinician`, `patient-safety`, `clinical-ops`, `health-data`, `health-compliance`, `blank` |
383
+ | `legal` | `managing-partner`, `associate`, `compliance`, `knowledge`, `ops`, `blank` |
384
+ | `finance` | `cfo`, `controller`, `fin-analytics`, `ops`, `compliance`, `blank` |
385
+ | `marketing` | `brand-lead`, `content`, `performance`, `seo`, `lifecycle`, `data`, `product-design`, `blank` |
386
+ | `sales` | `revenue-lead`, `account-executive`, `revops`, `customer-success`, `enablement`, `blank` |
387
+ | `research` | `research-director`, `researcher`, `methods`, `research-ops`, `ethics`, `knowledge`, `blank` |
388
+ | `operations` | `operations-lead`, `program-manager`, `process-owner`, `quality`, `knowledge`, `blank` |
389
+ | `custom` | `city-lead`, `specialist`, `quality`, `knowledge`, `blank` |
390
+
391
+ `blank` is a complete choice: it creates no role file, applies no hidden
392
+ profile, and infers no responsibility. You may assign it to the seat or any repo
393
+ and change it later.
394
+
395
+ When you select a domain/role, Agents City copies initial packs into the city:
396
+
397
+ ```text
398
+ domains/<domain>.md
399
+ roles/<role>.md
400
+ ```
401
+
402
+ They are ordinary Markdown. You can edit, remove, or extend their contents. A
403
+ later role change does not overwrite an existing file, so your adaptations are
404
+ preserved. This knowledge is not a skill.
405
+
406
+ ## Complete command reference
407
+
408
+ ### Overview
409
+
410
+ ```text
411
+ agents-city [hall]
412
+ agents-city setup
413
+ agents-city seat
414
+ agents-city cities
415
+ agents-city road
416
+ agents-city bus
417
+ agents-city committee
418
+ agents-city skills
419
+ agents-city city
420
+ agents-city demo
421
+ agents-city report
422
+ agents-city tokens
423
+ agents-city logs
424
+ agents-city benchmark
425
+ agents-city reset
426
+ agents-city exit
427
+ agents-city test
428
+ ```
429
+
430
+ Global commands:
431
+
432
+ ```bash
433
+ agents-city --help
434
+ agents-city --version
435
+ ```
436
+
437
+ ### `agents-city` and `agents-city hall`
438
+
439
+ Open the local Hall for the selected city.
440
+
441
+ ```bash
442
+ agents-city
443
+ agents-city hall
444
+ agents-city hall --city product
445
+ agents-city hall --no-browser
446
+ ```
447
+
448
+ | Option | Effect |
449
+ |---|---|
450
+ | `--city NAME|ID|PATH` | select a known city and open it |
451
+ | `--no-browser` | do not open the browser; print the local URL and temporary token |
452
+
453
+ The server binds only to `127.0.0.1` and requires a per-run token for writes.
454
+ The **City live** column on the right connects as a spectator to the same local
455
+ WebSocket bus used by the agents. It shows ordinary visible user/agent messages,
456
+ runtime failures, and the complete moderated committee flow as a conversation:
457
+ one avatar per repo, the seat marked as chair, and one visible turn per revealed
458
+ position or granted reply. Routine commands and lifecycle noise are collapsed
459
+ behind **show work**; the selected conversation opens by default.
460
+
461
+ The Hall opens directly on **The map**. The city owns the whole centre canvas: state, controls, and
462
+ history stay in the side rails, never above or below the map. Every semantic
463
+ turn arriving on that same WebSocket also creates a short game-style bubble,
464
+ anchored to the speaking character and prefixed with its recipient (`Para
465
+ seat:`, `Para committee:`, and so on). The bubble is only the transient summary;
466
+ the complete message and evidence remain in **City live**. No decorative
467
+ dialogue, commands, private reasoning, or raw envelopes become speech.
468
+
469
+ Codex uses completed visible app-server items; Claude uses its documented prompt
470
+ and stop hooks. Provider reasoning items, chain-of-thought, credentials, and raw
471
+ transport frames are neither shown nor written to the activity log. The
472
+ spectator token rotates with the hub, accepts only an origin on this computer,
473
+ and is read-only: the browser cannot direct the committee. `Ctrl-c` stops the
474
+ Hall.
475
+
476
+ ### `agents-city setup`
477
+
478
+ Creates or selects a city and opens the Hall; `--tui` hands the flow to `seat`.
479
+
480
+ ```bash
481
+ agents-city setup
482
+ agents-city setup --city product
483
+ agents-city setup --city product --tui
484
+ agents-city setup --out /path/to/a/city
485
+ agents-city setup --demo
486
+ agents-city setup --no-browser
487
+ ```
488
+
489
+ | Option | Effect |
490
+ |---|---|
491
+ | `--city NAME` | create the managed city when missing or select the existing one |
492
+ | `--out PATH` | register/import an explicit compatible folder; advanced use |
493
+ | `--demo` | open the complete guided Aurora Games demo |
494
+ | `--tui` | use terminal onboarding and open the session |
495
+ | `--no-browser` | keep the Hall in the terminal and print its URL |
496
+
497
+ ### `agents-city seat`
498
+
499
+ Configures requested settings, ensures tmux/plugin, and opens or resumes the city
500
+ session.
501
+
502
+ ```bash
503
+ agents-city seat
504
+ agents-city seat --city product
505
+ agents-city seat --repos
506
+ agents-city seat --agent-roles
507
+ agents-city seat --goal
508
+ agents-city seat --engines
509
+ agents-city seat --domain marketing
510
+ agents-city seat --domain marketing --role brand-lead
511
+ agents-city seat --role blank
512
+ agents-city seat --only api,web
513
+ agents-city seat --model sonnet --effort high
514
+ agents-city seat --seat-yolo on
515
+ agents-city seat --no-yolo --no-sync
516
+ ```
517
+
518
+ | Option | Persistence and effect |
519
+ |---|---|
520
+ | `--city NAME|PATH` | select this city and open its session |
521
+ | `--repos` | choose repos again, then their agent roles; persists |
522
+ | `--agent-roles`, `--agents` | choose only each repo role again; persists |
523
+ | `--goal` | redefine the goal; persists |
524
+ | `--engines` | choose runtime/model per window; persists |
525
+ | `--domain DOMAIN` | change domain; persists and asks for a compatible role unless `--role` is supplied |
526
+ | `--role ROLE` | change the seat role without a picker; persists |
527
+ | `--only a,b` | open only those repos this run; does not alter the card |
528
+ | `--model ALIAS` | model override for all windows in this launch |
529
+ | `--effort LEVEL` | `low`, `medium`, `high`, `xhigh`, or `max` override for this launch |
530
+ | `--seat-yolo on\|off` | whether the chair itself runs without permission prompts; persists per city (`city.yml seat_yolo`, also question six of the wizard). Locally the seat is the owner's own hands; repo windows keep their own yolo/cage story either way |
531
+ | `--no-yolo` | disable auto-approval for this launch — seat included, whatever `seat_yolo` says |
532
+ | `--no-sync` | skip initial `git fetch/pull` in repos for this launch |
533
+
534
+ `seat` accepts a positional user for compatibility, but only when it matches the
535
+ resolved local owner. Use `--city` for another city belonging to the same user.
536
+
537
+ ### `agents-city cities`
538
+
539
+ Manages the local catalogue. Creating or selecting does not start tmux.
540
+
541
+ ```bash
542
+ agents-city cities list
543
+ agents-city cities current
544
+ agents-city cities create product
545
+ agents-city cities use product
546
+ agents-city cities use /path/to/city
547
+ ```
548
+
549
+ | Subcommand | Output/effect |
550
+ |---|---|
551
+ | `list` | known cities; `*` marks the selected one |
552
+ | `current` | absolute path of the selected city |
553
+ | `create NAME` | create `~/.agents-city/<owner>/<slug>/` and select it |
554
+ | `use NAME|PATH` | select an existing city without starting it |
555
+
556
+ ### `agents-city road`
557
+
558
+ Opens and closes the allowlist of connections between seats.
559
+
560
+ ```bash
561
+ agents-city road list product
562
+ agents-city road connect product client-a
563
+ agents-city road invite product
564
+ agents-city road invite product > product.invitation.json
565
+ agents-city road connect product research.invitation.json
566
+ agents-city road disconnect product client-a
567
+ agents-city road disconnect product <remote-city-id>
568
+ ```
569
+
570
+ | Subcommand | Effect |
571
+ |---|---|
572
+ | `list CITY` | show destination, address, and local/remote status |
573
+ | `connect A B` | when B is local, write both ends symmetrically |
574
+ | `connect A invitation.json` | add only the local end of a remote road |
575
+ | `invite CITY` | print public JSON without a token |
576
+ | `disconnect A B|ID` | remove both local ends or the specified remote ID |
577
+
578
+ A city cannot connect to itself. Each machine must independently accept the
579
+ other remote invitation.
580
+
581
+ ### `agents-city bus`
582
+
583
+ Operates messages between seats over declared roads.
584
+
585
+ ```bash
586
+ agents-city bus roster
587
+ agents-city bus inbox
588
+ agents-city bus send alice/research "Please confirm the event X contract"
589
+ agents-city bus send '*' "Notice for every connected city"
590
+ ```
591
+
592
+ | Subcommand | Effect |
593
+ |---|---|
594
+ | `roster` | return roads and known online presence |
595
+ | `inbox` | return and consume pending inbox; append-only history remains |
596
+ | `send owner/city TEXT` | send to one allowed destination |
597
+ | `send '*' TEXT` | send to all roads; requires at least one |
598
+
599
+ Only `seat` may run these operations. A repo actor is rejected by the ACL even
600
+ if it knows the destination address.
601
+
602
+ ### `agents-city committee`
603
+
604
+ Manages structured deliberations inside one city. Every command accepts fields
605
+ as flags or as a JSON object through `--input`.
606
+
607
+ ```bash
608
+ agents-city committee list
609
+ agents-city committee history
610
+ agents-city committee show <deliberation-id>
611
+ agents-city committee status <deliberation-id> # alias for show
612
+ agents-city committee schema open
613
+ agents-city committee open --input proposal.json
614
+ agents-city committee open --input - < proposal.json
615
+ ```
616
+
617
+ | Subcommand | Allowed actor | Purpose |
618
+ |---|---|---|
619
+ | `list` | any involved city actor | open deliberations visible to that actor |
620
+ | `history` | seat | finished decision history and contributor counts |
621
+ | `show ID`, `status ID` | involved city actor | complete actor-visible state and events |
622
+ | `schema VERB` | anyone | JSON contract for a mutation verb |
623
+ | `open` | seat | state question, outcome, members, and boundaries |
624
+ | `respond` | invited member | record one independent initial position |
625
+ | `synthesize` | seat | publish agreements, conflicts, and unknowns |
626
+ | `floor-request` | member | request a turn for evidence, contradiction, risk, or dependency |
627
+ | `floor-grant` | seat | grant one floor request |
628
+ | `floor-deny` | seat | deny one floor request with a reason |
629
+ | `reply` | member holding the floor | submit one bounded, evidence-based reply |
630
+ | `decide` | seat | record outcome, owners, verifier, and reopen conditions |
631
+ | `verify` | assigned verifier | return `pass` or `fail` with checks |
632
+ | `replan` | seat | reopen a failed verification with a new plan |
633
+ | `close` | seat | close an already verified outcome |
634
+ | `cancel` | seat | cancel a deliberation with a reason |
635
+
636
+ Opening with flags:
637
+
638
+ ```bash
639
+ agents-city committee open \
640
+ --question "Should we ship today?" \
641
+ --outcome-wanted "A reversible decision with an owner and verification" \
642
+ --context "The release candidate passed the local suite" \
643
+ --constraint "Do not lose data" \
644
+ --constraint "Rollback within ten minutes" \
645
+ --done "The decision names an executor and verifier" \
646
+ --authority execute \
647
+ --member api \
648
+ --member web \
649
+ --member qa \
650
+ --max-rebuttals 1
651
+ ```
652
+
653
+ The result prints a `deliberationId`. Keep it for later transitions. JSON is
654
+ usually clearer for large payloads:
655
+
656
+ ```json
657
+ {
658
+ "question": "Should we ship today?",
659
+ "desiredOutcome": "A reversible decision with an owner and verification",
660
+ "context": "The release candidate passed the local suite",
661
+ "constraints": ["Do not lose data", "Rollback within ten minutes"],
662
+ "definitionOfDone": ["Executor and verifier assigned"],
663
+ "authority": "execute",
664
+ "participants": ["api", "web", "qa"],
665
+ "maxRebuttals": 1
666
+ }
667
+ ```
668
+
669
+ ```bash
670
+ agents-city committee open --input proposal.json
671
+ ```
672
+
673
+ `--input -` reads stdin. When JSON and flags are mixed, explicit flags override
674
+ the equivalent field. Repeatable flags are `--member`, `--constraint`, `--done`,
675
+ `--evidence`, `--risk`, `--unknown`, `--agreement`, `--conflict`, `--check`,
676
+ `--residual-risk`, `--selected-evidence`, `--rejected-option`, `--dissent`,
677
+ `--reopen-if`, `--learning`, and `--followup`.
678
+
679
+ Always inspect the exact contract shipped by the installed version:
680
+
681
+ ```bash
682
+ agents-city committee schema respond
683
+ agents-city committee schema decide
684
+ agents-city committee schema verify
685
+ ```
686
+
687
+ Member commands (`respond`, `floor-request`, and `reply`) are normally executed
688
+ by the authenticated repo agent after receiving an envelope. Running one from
689
+ the seat correctly fails its ACL: accepting an actor name as text would not let
690
+ the bus pretend to be that actor.
691
+
692
+ ### `agents-city skills`
693
+
694
+ Lists skills already present in a city's repos. This is read-only: it does not
695
+ install, copy, enable, or remove anything.
696
+
697
+ ```bash
698
+ agents-city skills
699
+ agents-city skills product
700
+ ```
701
+
702
+ Recognised layouts per repository:
703
+
704
+ ```text
705
+ SKILL.md
706
+ .claude/skills/*/SKILL.md
707
+ .codex/skills/*/SKILL.md
708
+ .agents/skills/*/SKILL.md
709
+ skills/*/SKILL.md
710
+ ```
711
+
712
+ Actual invocation depends on the runtime. Agents City advertises the capability
713
+ for the member and lets the provider enforce its own discovery and use rules.
714
+
715
+ ### `agents-city city`
716
+
717
+ Opens one city's local map without starting an agent session.
718
+
719
+ ```bash
720
+ agents-city city
721
+ agents-city city ~/.agents-city/alice/product
722
+ ```
723
+
724
+ It uses port `8787` or the next free port, binds to loopback, and opens the
725
+ browser. `Ctrl-c` stops the server. `units.yml`, `parcels.yml`, the card, and bus
726
+ state feed the visualisation.
727
+
728
+ The map is live, not a postcard. Three layers stage what is happening right
729
+ now, all derived from data the product already emits: presence (a mid-turn
730
+ house glows and breathes, a stopped one cools), the town hall (committee
731
+ sessions play on stage — sealed positions fly in face down, the floor is a
732
+ raised hand, verification stamps the door, closing files the act — with the
733
+ camera flying to the session and members walking over), and one gate per road,
734
+ which letters to other cities leave through. Agents get deterministic
735
+ identicon faces, `knowledge`/`coordinator` parcels wear a different building
736
+ family than `code`, the town hall and the gates are clickable, `P` (or the ⛶
737
+ control) toggles fullscreen, and the Hall's live rail is resizable by dragging
738
+ its edge. The full contract is in
739
+ [docs/map-live-layers.md](docs/map-live-layers.md).
740
+
741
+ ### `agents-city demo`
742
+
743
+ Opens one fictional, disposable demo city in the complete Hall. The map owns
744
+ the centre; the right rail plays a guided deliberation and those same turns
745
+ appear as `Para …:` speech bubbles over their agents. There is one demo per
746
+ domain — real chaos told in plain words, not programmer phrases:
747
+
748
+ ```bash
749
+ agents-city demo # software · Aurora Games — the night the saves vanished
750
+ agents-city demo --domain medicina # Clínica Alba — the morning the appointments doubled
751
+ agents-city demo --domain legal # Costa & Ley — the deadline at nine tomorrow
752
+ agents-city demo --no-browser
753
+ ```
754
+
755
+ It starts no models and needs no Claude, Codex, OpenCode or Kimi account. The
756
+ stories are declared presentation content, but their engineering is not an
757
+ animation: all 22 events cross the real authenticated WebSocket, committee
758
+ state machine, durable ledger and spectator feed. Every story walks the WHOLE
759
+ machine, including the part demos usually hide: three isolated positions, two
760
+ chair-granted floor requests, a decision, a verification that FAILS, a replan,
761
+ and only then a verified close. The clinic and the firm are agents-first
762
+ cities — knowledge and coordinator agents, no repositories — so they also
763
+ exercise the roster and the map's building families.
764
+
765
+ The Hall's live rail shows a framed **guided committee** control for demo
766
+ cities only: `⟳ replay` plays the domain's story again, and `⏸ pause` /
767
+ `▶ resume` stop and continue the storyteller process itself (`SIGSTOP`, a real
768
+ pause). `/api/demo` refuses any city that is not a packaged demo: a real
769
+ city's committee is real, and a replay there would publish fiction onto a real
770
+ bus.
771
+
772
+ The demo copies its city and runtime into a temporary directory. `Ctrl-c` stops
773
+ its Hall, map and hub and removes that copy; it never selects, rewrites or starts
774
+ your cities. If another map already owns `8787`, the demo uses another port and
775
+ the Hall checks city identity instead of accidentally framing the wrong map.
776
+
777
+ ### `agents-city report`
778
+
779
+ Computes growth that can be represented on the map and optionally pushes it to
780
+ the configured city service.
781
+
782
+ ```bash
783
+ agents-city report
784
+ agents-city report --data ~/.agents-city/alice/product
785
+ agents-city report --url https://city.example.com --token "$CITY_TOKEN"
786
+ agents-city report --push --quiet
787
+ ```
788
+
789
+ | Option | Effect |
790
+ |---|---|
791
+ | `--data PATH` | use another city data folder |
792
+ | `--url URL` | override the service URL |
793
+ | `--token TOKEN` | override the authentication token |
794
+ | `--push` | send the report; without it, only compute/show |
795
+ | `--quiet` | reduce human-readable output |
796
+
797
+ ### `agents-city tokens`
798
+
799
+ Aggregates local Claude transcript usage and can send totals only. It does not
800
+ send prompts, responses, or file paths.
801
+
802
+ ```bash
803
+ agents-city tokens
804
+ agents-city tokens --days 7
805
+ agents-city tokens --all
806
+ agents-city tokens --push --quiet
807
+ agents-city tokens --url https://city.example.com --token "$CITY_TOKEN"
808
+ ```
809
+
810
+ | Option | Effect |
811
+ |---|---|
812
+ | `--days N` | time window; default 30 days |
813
+ | `--all` | re-read transcripts inside `--days`, ignoring the incremental cache |
814
+ | `--url URL` | override the service URL |
815
+ | `--token TOKEN` | override the authentication token |
816
+ | `--push` | send aggregates; without it, only show them |
817
+ | `--quiet` | reduce human-readable output |
818
+
819
+ `tokens` does not automatically estimate Codex, OpenCode, or Kimi usage.
820
+
821
+ ### `agents-city logs`
822
+
823
+ Reads the selected city's two durable local streams: visible semantic activity
824
+ and secret-scrubbed operational diagnostics. It does not read provider reasoning.
825
+
826
+ ```bash
827
+ agents-city logs
828
+ agents-city logs --activity --lines 50
829
+ agents-city logs --diagnostics --lines 200
830
+ agents-city logs --follow
831
+ agents-city logs --json --follow
832
+ ```
833
+
834
+ | Option | Effect |
835
+ |---|---|
836
+ | `--activity` | only visible prompts, answers, work, and committee events |
837
+ | `--diagnostics` | only hub, socket, gateway, hook, and launcher diagnostics |
838
+ | `-n, --lines N` | initial number of records; default 100 |
839
+ | `-f, --follow` | continue streaming appended records until `Ctrl-c` |
840
+ | `--json` | emit the stored JSONL records unchanged |
841
+
842
+ The files live under the selected city's private runtime directory as
843
+ `activity.jsonl` and `diagnostics.jsonl`. They survive a Hall reload and a bus
844
+ restart, are mode `0600`, and can be inspected directly. Activity source IDs
845
+ make repeated provider notifications and hooks idempotent.
846
+
847
+ ### `agents-city benchmark`
848
+
849
+ Measures transport, real runtimes, or the structure of the committee protocol.
850
+
851
+ #### Local stress without model quota
852
+
853
+ ```bash
854
+ agents-city benchmark stress
855
+ agents-city benchmark stress --agents 40 --rounds 2 --timeout 20
856
+ agents-city benchmark stress --agents 80 --rounds 5 --json
857
+ agents-city benchmark stress --keep
858
+ ```
859
+
860
+ | Option | Effect |
861
+ |---|---|
862
+ | `--agents N` | simulated actors; must be even, default 40 |
863
+ | `--rounds N` | rounds per actor; default 2 |
864
+ | `--timeout SEC` | benchmark limit; default 20 |
865
+ | `--json` | machine-readable output |
866
+ | `--keep` | preserve the temporary workspace for inspection |
867
+
868
+ #### Real runtimes, consuming quota
869
+
870
+ ```bash
871
+ agents-city benchmark live --runtime claude --runtime codex
872
+ agents-city benchmark live \
873
+ --runtime codex \
874
+ --runtime kimi \
875
+ --timeout 180 \
876
+ --json
877
+ agents-city benchmark live \
878
+ --command codex="codex --model gpt-5" \
879
+ --command opencode="opencode -m lmstudio/qwen3-coder" \
880
+ --keep
881
+ ```
882
+
883
+ | Option | Effect |
884
+ |---|---|
885
+ | `--runtime RUNTIME` | runtime to measure; repeatable: `claude`, `codex`, `kimi`, `opencode` |
886
+ | `--command RUNTIME=COMMAND` | concrete command for that runtime; repeatable |
887
+ | `--timeout SEC` | limit per case; default 180 |
888
+ | `--json` | machine-readable output |
889
+ | `--no-save` | do not append the result to local history |
890
+ | `--keep` | preserve temporary workspaces |
891
+
892
+ `live` makes real calls to installed providers and can consume quota or money.
893
+ Check authentication and limits before running it.
894
+
895
+ #### Committee protocol
896
+
897
+ ```bash
898
+ agents-city benchmark committee
899
+ agents-city benchmark committee --json
900
+ ```
901
+
902
+ This compares the structured flow with an unbounded chat: response barrier,
903
+ floor control, decision, and verification. It is a deterministic structural
904
+ benchmark; by itself it proves neither higher answer quality nor a SOTA claim.
905
+
906
+ ### `agents-city reset`
907
+
908
+ Resets **one** managed city while preserving its stable identity and repositories.
909
+
910
+ ```bash
911
+ agents-city reset product --dry-run
912
+ agents-city reset product
913
+ ```
914
+
915
+ The reset plan:
916
+
917
+ 1. verifies the target is a managed city, not an arbitrary path;
918
+ 2. shows and stops only that city's session/runtime;
919
+ 3. creates a recoverable backup under its owner;
920
+ 4. preserves `id`, owner, name, and slug;
921
+ 5. removes that city's configuration, deliberations, and generated state;
922
+ 6. does not touch source repositories;
923
+ 7. symmetrically removes incident local roads;
924
+ 8. leaves the city ready for onboarding again.
925
+
926
+ There is no automatic `restore` command yet. The exact backup path is printed
927
+ for manual recovery. Always run `--dry-run` first.
928
+
929
+ ### `agents-city exit`
930
+
931
+ Stops Agents City sessions and processes without deleting configuration.
932
+
933
+ ```bash
934
+ agents-city exit product --dry-run
935
+ agents-city exit product
936
+ agents-city exit --dry-run
937
+ agents-city exit
938
+ ```
939
+
940
+ With a city, it closes only that city's tmux, gateway, and helper processes; the
941
+ Hall may stay up. Without a city, it shows or closes everything managed by
942
+ Agents City. A tmux session may contain unsaved work, so dry-run is the safe way
943
+ to confirm scope.
944
+
945
+ ### `agents-city test`
946
+
947
+ Runs checkout tests. With no arguments it runs every suite; with names it runs
948
+ only those suites.
949
+
950
+ ```bash
951
+ agents-city test
952
+ agents-city test seat runtime-ui
953
+ agents-city test committee stress benchmark
954
+ ```
955
+
956
+ Available suites:
957
+
958
+ ```text
959
+ widgets card parcels domains serve seat cities channel committee live-feed
960
+ runtime runtime-ui runtime-failures stress adapter benchmark contracts exit
961
+ cage broker launch
962
+ ```
963
+
964
+ This command is intended for contributors or local tarball validation. Normal
965
+ use does not require running tests at every startup.
966
+
967
+ ## Committee: complete workflow
968
+
969
+ The committee behaves like a management committee: the seat frames and chairs
970
+ the decision; specialists contribute evidence from their repos; nobody opens a
971
+ lateral conversation; the seat integrates and another identity verifies.
972
+
973
+ ```text
974
+ open
975
+ └─ collecting: independent, hidden positions
976
+ ├─ missing replies + proceedWithout ─┐
977
+ └─ all reply -> review │
978
+ v
979
+ synthesize
980
+
981
+ v
982
+ deliberating
983
+ ┌─ bounded floor ─┐
984
+ └─ request/reply ┘
985
+
986
+ decide
987
+
988
+ v
989
+ verifying
990
+ ┌─ fail ─└─ pass
991
+ v v
992
+ verification_failed verified
993
+ │ │
994
+ replan close
995
+ │ │
996
+ └─> review closed
997
+ ```
998
+
999
+ ### 1. Prepare the brief
1000
+
1001
+ A good question names a decision, not merely a topic. The desired outcome says
1002
+ what the committee must produce; `definitionOfDone` lists observable conditions.
1003
+ Select only repositories capable of producing relevant evidence.
1004
+
1005
+ | `open` field | Required | Values/meaning |
1006
+ |---|---|---|
1007
+ | `question` | yes | exact decision |
1008
+ | `desiredOutcome` | yes | concrete expected result |
1009
+ | `context` | no | minimum necessary facts |
1010
+ | `constraints` | no | time, cost, security, or policy boundaries |
1011
+ | `definitionOfDone` | yes, list | observable acceptance conditions |
1012
+ | `authority` | no | `recommend`, `decide`, or `execute`; default `recommend` |
1013
+ | `participants` | yes, list | repo actor names in this city |
1014
+ | `maxRebuttals` | no | integer 0–5; default 2 per member |
1015
+
1016
+ `authority` records the mandate; it does not change technical ACLs.
1017
+
1018
+ ### 2. Collect isolated positions
1019
+
1020
+ Each participant receives the same brief and responds once:
1021
+
1022
+ ```bash
1023
+ agents-city committee respond "$DELIBERATION_ID" \
1024
+ --stance conditional \
1025
+ --recommendation "Ship to 10% first" \
1026
+ --evidence "npm test: 844 checks passed" \
1027
+ --expected-impact "Detect regressions before full rollout" \
1028
+ --visible-when "After 30 minutes of telemetry" \
1029
+ --withdraw-if "The migration is not reversible" \
1030
+ --risk "Insufficient canary capacity" \
1031
+ --unknown "First-hour production load"
1032
+ ```
1033
+
1034
+ `stance` is `support`, `oppose`, `conditional`, or `abstain`. `evidence` is
1035
+ required and repeatable. The runtime executes the response inside the repo
1036
+ window under its real identity. Until the barrier opens, the seat sees progress,
1037
+ not initial-position contents; this reduces anchoring.
1038
+
1039
+ ### 3. Synthesise without voting
1040
+
1041
+ Once all positions are ready, the seat integrates evidence:
1042
+
1043
+ ```bash
1044
+ agents-city committee synthesize "$DELIBERATION_ID" \
1045
+ --summary "There is agreement on a reversible canary" \
1046
+ --agreement "The migration needs a tested rollback" \
1047
+ --conflict "10% versus 25% initial traffic" \
1048
+ --unknown "Capacity at expected peak"
1049
+ ```
1050
+
1051
+ If a member is missing, it cannot simply be ignored:
1052
+
1053
+ ```bash
1054
+ agents-city committee synthesize "$DELIBERATION_ID" \
1055
+ --summary "Provisional synthesis" \
1056
+ --proceed-without "QA is offline; the deadline is today and rollback remains available"
1057
+ ```
1058
+
1059
+ The decision integrates evidence, impact, and withdrawal conditions rather than
1060
+ counting votes.
1061
+
1062
+ ### 4. Request and grant the floor
1063
+
1064
+ After synthesis, a member may reply only with an admitted basis:
1065
+
1066
+ ```bash
1067
+ agents-city committee floor-request "$DELIBERATION_ID" \
1068
+ --basis new_evidence \
1069
+ --reason "The canary failed its rollback test" \
1070
+ --evidence "artifacts/rollback.log: exit 1"
1071
+ ```
1072
+
1073
+ `basis` accepts `new_evidence`, `contradiction`, `risk`, or `dependency`. The
1074
+ seat resolves the returned `requestId`:
1075
+
1076
+ ```bash
1077
+ agents-city committee floor-grant "$DELIBERATION_ID" --request-id "$REQUEST_ID"
1078
+ # or:
1079
+ agents-city committee floor-deny "$DELIBERATION_ID" \
1080
+ --request-id "$REQUEST_ID" \
1081
+ --reason "The evidence is already in the synthesis"
1082
+ ```
1083
+
1084
+ Once granted, that member has exactly one reply and releases the floor by using it:
1085
+
1086
+ ```bash
1087
+ agents-city committee reply "$DELIBERATION_ID" \
1088
+ --claim "Shipping with the current script is unsafe" \
1089
+ --evidence "artifacts/rollback.log: exit 1" \
1090
+ --consequence "Block until fixed and rerun rollback"
1091
+ ```
1092
+
1093
+ The reply reaches the seat **and is heard by the whole committee**. Other members
1094
+ do not answer the speaker directly: if one finds new evidence, a contradiction,
1095
+ a material risk, or a dependency, it asks the seat for another turn. The seat
1096
+ grants or denies it, and only then may that agent speak. This is real specialist
1097
+ conversation mediated like an executive committee, not an all-to-all chat. Two
1098
+ active turns cannot coexist; every grant permits one intervention;
1099
+ `maxRebuttals` bounds the cascade per member; and the seat must resolve every
1100
+ pending request before deciding.
1101
+
1102
+ ### 5. Decide and attribute
1103
+
1104
+ ```bash
1105
+ agents-city committee decide "$DELIBERATION_ID" \
1106
+ --outcome "Fix rollback and ship a 10% canary" \
1107
+ --rationale "This limits impact and satisfies reversibility" \
1108
+ --owner "Release owner" \
1109
+ --executor api \
1110
+ --verifier qa \
1111
+ --verification-question "Do rollback and canary pass end to end?" \
1112
+ --selected-evidence "full suite is green" \
1113
+ --selected-evidence "reproducible rollback failure" \
1114
+ --decisive-contributors qa \
1115
+ --rejected-option "Immediate full rollout" \
1116
+ --dissent "web prefers a 25% canary" \
1117
+ --reopen-if "5xx errors exceed 1% for five minutes"
1118
+ ```
1119
+
1120
+ `selectedEvidence`, `decisiveContributors`, and `reopenIf` are required. If
1121
+ another identity is available, `verifier` cannot equal `executor`. Dissent stays
1122
+ in the act even when it does not change the decision. Use JSON input when more
1123
+ than one decisive contributor must be recorded.
1124
+
1125
+ ### 6. Verify, replan, or close
1126
+
1127
+ Only the assigned verifier may run:
1128
+
1129
+ ```bash
1130
+ agents-city committee verify "$DELIBERATION_ID" \
1131
+ --result pass \
1132
+ --evidence "artifacts/e2e-rollback.txt" \
1133
+ --check "canary returns 200" \
1134
+ --check "rollback restores the previous version" \
1135
+ --residual-risk "The first hour at full load remains unobserved"
1136
+ ```
1137
+
1138
+ After `fail`, the seat must replan and then synthesise/decide again:
1139
+
1140
+ ```bash
1141
+ agents-city committee replan "$DELIBERATION_ID" \
1142
+ --reason "Rollback still leaves an incompatible schema"
1143
+ ```
1144
+
1145
+ After `pass`, the seat may close:
1146
+
1147
+ ```bash
1148
+ agents-city committee close "$DELIBERATION_ID" \
1149
+ --summary "Canary verified; rollout authorised" \
1150
+ --learning "Test rollback before fixing a release window" \
1151
+ --followup "Watch 5xx rates for the first hour"
1152
+ ```
1153
+
1154
+ A deliberation cannot close without reproducible passing verification. If it is
1155
+ no longer relevant, the seat may cancel it:
1156
+
1157
+ ```bash
1158
+ agents-city committee cancel "$DELIBERATION_ID" \
1159
+ --reason "The release was replaced by another candidate"
1160
+ ```
1161
+
1162
+ State, events, and a readable act remain in `deliberations/`. `history`
1163
+ summarises recent decisions and decisive contributions to expose repeated
1164
+ influence. That count is a review signal, not automatic evidence of capture.
1165
+
1166
+ ## Claude `/city:` commands
1167
+
1168
+ These commands come from the Claude plugin. They do not exist inside Codex,
1169
+ OpenCode, or Kimi TUIs; use the equivalent `agents-city` terminal commands there.
1170
+
1171
+ | Command | Use case |
1172
+ |---|---|
1173
+ | `/city:setup [--city N] [--tui] [--demo]` | create/open a city through the shared flow |
1174
+ | `/city:join [--domain D\|--role R\|--repos\|--agent-roles\|--goal\|--engines]` | compatibility name for configuring the seat; does not add a person |
1175
+ | `/city:session [--no-yolo] [--only a,b]` | open or resume this city's tmux |
1176
+ | `/city:settings [domain\|role\|repos\|agent-roles\|goal\|engines\|roads\|skills]` | read or change one configuration area |
1177
+ | `/city:goals` | show or edit the current goal |
1178
+ | `/city:committee QUESTION` | prepare and open a chaired deliberation |
1179
+ | `/city:committee status ID` | inspect the next legal transition |
1180
+ | `/city:round [--to owner/city] [--since DATE]` | compare goal and local evidence; consult relevant roads |
1181
+ | `/city:notice [--pr N\|--since REF] [--dry]` | notify only affected cities about a verified change |
1182
+ | `/city:propose owner/city [SUBJECT]` | send an evidence-backed proposal |
1183
+ | `/city:team` | historical alias: list cities, active city, repos, and roads; not people |
1184
+ | `/city:exit [CITY] [--dry-run]` | show or close managed processes |
1185
+
1186
+ `/city:notice --dry` sends nothing. `/city:round` and `/city:propose` can only use
1187
+ destinations present in `road list`. A reply from another city informs the seat;
1188
+ it never gains authority to command a local repo directly.
1189
+
1190
+ ## Use-case cookbook
1191
+
1192
+ ### Case 1: start from zero with one city and Claude
1193
+
1194
+ ```bash
1195
+ cd /path/to/agents-city
1196
+ npm pack
1197
+ npm install -g ./agents-city-0.3.0-beta.21.tgz
1198
+ agents-city seat
1199
+ ```
1200
+
1201
+ 1. Choose the domain.
1202
+ 2. Choose the seat role.
1203
+ 3. Select repositories or continue with none.
1204
+ 4. Define or skip the goal.
1205
+ 5. Press Enter in the runtime picker to keep Claude.
1206
+
1207
+ Result: a `home` city, an `<owner>-home` session, one `seat` window, and one
1208
+ window per selected local repo. Agents City keeps one official Claude Code
1209
+ process per window and feeds it through persistent `stream-json`; it does not
1210
+ request a custom Channel or require admin/per-window approval.
1211
+
1212
+ ### Case 2: use Codex as the main seat
1213
+
1214
+ ```bash
1215
+ agents-city seat --engines
1216
+ ```
1217
+
1218
+ Choose Codex on the `seat` row, confirm the other rows, and open the city. Agents
1219
+ City starts `codex app-server` on loopback and opens the official TUI with
1220
+ `codex --remote`. The TUI creates its persisted thread; the gateway detects only
1221
+ the new thread for that working directory and joins it through `thread/resume`.
1222
+ You should type directly into Codex. A `city>` prompt in a Codex seat means an
1223
+ old version or a failed launch; it is not the intended Codex interface.
1224
+
1225
+ ### Case 3: mix runtimes per repository
1226
+
1227
+ ```bash
1228
+ agents-city seat --city product --engines
1229
+ ```
1230
+
1231
+ Example selection:
1232
+
1233
+ ```text
1234
+ seat Codex
1235
+ api Claude / opus model / high effort
1236
+ web Codex
1237
+ analytics OpenCode
1238
+ research Kimi
1239
+ ```
1240
+
1241
+ Each choice persists in the card. The next `seat` run reuses it. To test another
1242
+ combination without retaining old processes:
1243
+
1244
+ ```bash
1245
+ agents-city exit product --dry-run
1246
+ agents-city exit product
1247
+ agents-city seat --city product --engines
1248
+ ```
1249
+
1250
+ ### Case 4: use a local model through OpenCode
1251
+
1252
+ Agents City does not choose OpenCode's provider. In the runtime picker, select
1253
+ OpenCode and enter the command/model accepted by your installation, for example:
1254
+
1255
+ ```text
1256
+ opencode -m lmstudio/qwen3-coder
1257
+ ```
1258
+
1259
+ Validate it independently first:
1260
+
1261
+ ```bash
1262
+ opencode -m lmstudio/qwen3-coder
1263
+ ```
1264
+
1265
+ Then run `agents-city seat --engines`. Bus delivery reaches OpenCode through
1266
+ HTTP/SSE; the model may be local while Agents City keeps the same typed envelope.
1267
+
1268
+ ### Case 5: use a CLI that is not natively integrated yet
1269
+
1270
+ Choose “another command (terminal fallback)” under `--engines` and enter, for
1271
+ example, `gemini`. Agents City stores:
1272
+
1273
+ ```yaml
1274
+ runs.api: terminal:gemini
1275
+ ```
1276
+
1277
+ The prefix makes it explicit that this window may need visible tmux injection.
1278
+ An unknown command without `terminal:` is rejected when reading a hand-edited
1279
+ card; known runtimes never silently degrade to terminal transport.
1280
+
1281
+ ### Case 6: create several cities for the same user
1282
+
1283
+ ```bash
1284
+ agents-city cities create product
1285
+ agents-city seat --city product
1286
+
1287
+ agents-city cities create client-a
1288
+ agents-city seat --city client-a
1289
+
1290
+ agents-city cities list
1291
+ ```
1292
+
1293
+ Expected result:
1294
+
1295
+ ```text
1296
+ ~/.agents-city/<owner>/product/
1297
+ ~/.agents-city/<owner>/client-a/
1298
+ ```
1299
+
1300
+ Each city has its own domain, role, goal, repos, recognised skills,
1301
+ deliberations, roads, runtime, and tmux session. `home` has no special privilege.
1302
+
1303
+ ### Case 7: give every repo a different speciality
1304
+
1305
+ ```bash
1306
+ agents-city seat --city product --agent-roles
1307
+ ```
1308
+
1309
+ Assign `po` to the main repo, `seo` to the portfolio, and `data-engineer` to the
1310
+ pipeline even when the seat domain is `software`. The picker can search roles
1311
+ from other domains. Speciality changes perspective and editable context; all
1312
+ repo agents retain technical `member` authority.
1313
+
1314
+ ### Case 8: work without a preloaded profile
1315
+
1316
+ ```bash
1317
+ agents-city seat --city lab --role blank
1318
+ agents-city seat --city lab --agent-roles
1319
+ ```
1320
+
1321
+ Also select `blank` for repos that should receive no profile. No role knowledge
1322
+ file is created and no hidden role is inferred. Repo instructions and skills
1323
+ continue to work normally.
1324
+
1325
+ ### Case 9: connect two local cities
1326
+
1327
+ ```bash
1328
+ agents-city road connect product client-a
1329
+ agents-city road list product
1330
+ agents-city road list client-a
1331
+ ```
1332
+
1333
+ The road is written at both ends. Start both cities and, from one seat:
1334
+
1335
+ ```bash
1336
+ CITY_OWNER=alice
1337
+ AGENTS_CITY_DATA="$HOME/.agents-city/$CITY_OWNER/product" \
1338
+ agents-city bus send "$CITY_OWNER/client-a" "Does this change affect your contract?"
1339
+ ```
1340
+
1341
+ Inside a normal session, you do not need to set `AGENTS_CITY_DATA`; it is already
1342
+ injected into each window. The example makes it explicit for an outside terminal.
1343
+
1344
+ ### Case 10: connect cities belonging to different machines or people
1345
+
1346
+ On machine A:
1347
+
1348
+ ```bash
1349
+ agents-city road invite product > product.invitation.json
1350
+ ```
1351
+
1352
+ Transfer that JSON over an appropriate channel. It contains no bus token. On
1353
+ machine B:
1354
+
1355
+ ```bash
1356
+ agents-city road connect research product.invitation.json
1357
+ agents-city road invite research > research.invitation.json
1358
+ ```
1359
+
1360
+ Return B's invitation and accept it on A:
1361
+
1362
+ ```bash
1363
+ agents-city road connect product research.invitation.json
1364
+ ```
1365
+
1366
+ Both machines need the same compatible remote transport and valid credentials
1367
+ through `CITY_BUS_URL`/`CITY_BUS_TOKEN`. Invitations only declare the allowlist;
1368
+ they neither deploy infrastructure nor share secrets. See
1369
+ [docs/self-host.md](docs/self-host.md) for the remote Worker.
1370
+
1371
+ ### Case 11: ask several repos for a decision without a group chat
1372
+
1373
+ From a Claude seat:
1374
+
1375
+ ```text
1376
+ /city:committee Can we enable the new migration in production?
1377
+ ```
1378
+
1379
+ From any other runtime, prepare the brief and use:
1380
+
1381
+ ```bash
1382
+ agents-city committee open --input migration-decision.json
1383
+ ```
1384
+
1385
+ The seat selects only relevant repos. Initial responses stay isolated; synthesis,
1386
+ floor requests, an attributed decision, and verification follow. Use
1387
+ `agents-city committee show ID` to inspect state, not to bypass the next legal
1388
+ actor.
1389
+
1390
+ ### Case 12: start only one or two repos in a large city
1391
+
1392
+ ```bash
1393
+ agents-city seat --city product --only api
1394
+ agents-city seat --city product --only api,web
1395
+ ```
1396
+
1397
+ `--only` filters windows for this launch; it does not remove repos or roles from
1398
+ the card. If a session with another composition already exists, close it first:
1399
+
1400
+ ```bash
1401
+ agents-city exit product --dry-run
1402
+ agents-city exit product
1403
+ ```
1404
+
1405
+ ### Case 13: select or clone private GitHub repositories
1406
+
1407
+ ```bash
1408
+ agents-city seat --repos
1409
+ ```
1410
+
1411
+ Choose “my GitHub account” or “GitHub organisation”. If `gh` is missing, the
1412
+ wizard tries to install it; if unauthenticated, it opens `gh auth login --web`.
1413
+ The browser or device code authenticates `gh`, not Agents City. Private repos
1414
+ appear only when the token has access. A selected but uncloned repo may stay on
1415
+ the card without a window or be cloned, after confirmation, beneath
1416
+ `CITY_CODE_DIR` (default `~/codigo`).
1417
+
1418
+ ### Case 14: inspect skills without installing them
1419
+
1420
+ ```bash
1421
+ agents-city skills product
1422
+ ```
1423
+
1424
+ If `api/.codex/skills/migrations/SKILL.md` appears, the repo already owns that
1425
+ skill. Agents City neither copies it into the city nor forces the agent to use
1426
+ it. Adding, editing, or removing the `SKILL.md` changes the next read without
1427
+ reinstalling Agents City.
1428
+
1429
+ ### Case 15: open only the map or the guided demo
1430
+
1431
+ ```bash
1432
+ agents-city city ~/.agents-city/<owner>/product
1433
+ agents-city demo
1434
+ ```
1435
+
1436
+ `city` renders that city's real data. `demo` opens the complete Aurora Games Hall
1437
+ and plays presentation agents over the real infrastructure without invoking
1438
+ models. Use `agents-city hall` to manage your own cities.
1439
+
1440
+ ### Case 16: measure performance and detect regressions
1441
+
1442
+ Measure the deterministic bus first, without models:
1443
+
1444
+ ```bash
1445
+ agents-city benchmark stress --agents 40 --rounds 2 --json
1446
+ ```
1447
+
1448
+ Keep the JSON as a baseline. Then, if model quota use is acceptable, measure the
1449
+ real path:
1450
+
1451
+ ```bash
1452
+ agents-city benchmark live \
1453
+ --runtime claude \
1454
+ --runtime codex \
1455
+ --runtime kimi \
1456
+ --timeout 180 \
1457
+ --json
1458
+ ```
1459
+
1460
+ Compare bus-to-runtime acceptance separately from end-to-end completion. A
1461
+ correct model response does not turn transport delay into “reasoning time”; an
1462
+ authentication failure is not counted as a fast sample.
1463
+
1464
+ ### Case 17: update without leaving old code in live sessions
1465
+
1466
+ ```bash
1467
+ cd /path/to/agents-city
1468
+ npm pack
1469
+ npm install -g ./agents-city-0.3.0-beta.21.tgz
1470
+ agents-city --version
1471
+ agents-city exit product --dry-run
1472
+ agents-city exit product
1473
+ agents-city seat --city product
1474
+ ```
1475
+
1476
+ Installing a tarball does not rewrite live processes. Restarting only the target
1477
+ city avoids closing another city or an unrelated tmux session.
1478
+
1479
+ ### Case 18: clear one city's configuration and repeat onboarding
1480
+
1481
+ ```bash
1482
+ agents-city reset lab --dry-run
1483
+ agents-city reset lab
1484
+ agents-city seat --city lab
1485
+ ```
1486
+
1487
+ Reset preserves the `lab` identity, creates a backup, and does not touch repos.
1488
+ Use `exit`, not `reset`, when you only need to stop processes.
1489
+
1490
+ ## Files and environment variables
1491
+
1492
+ ### `city.yml`: city identity
1493
+
1494
+ This file stores stable identity and domain. Do not create a city by copying a
1495
+ folder and reusing its `id`; use `cities create`.
1496
+
1497
+ ```yaml
1498
+ id: city_a1b2c3d4
1499
+ name: product
1500
+ slug: product
1501
+ owner: alice
1502
+ domain: software
1503
+ seat_yolo: 1
1504
+ ```
1505
+
1506
+ The public address is derived as `owner/slug`. It is not stored as one global
1507
+ plugin identity because several cities may run concurrently. `seat_yolo: 1`
1508
+ launches the chair itself without permission prompts — set at the wizard's
1509
+ sixth question or with `agents-city seat --seat-yolo on|off`; `--no-yolo`
1510
+ still brakes the whole session.
1511
+
1512
+ ### `<owner>.md`: seat card
1513
+
1514
+ This is Markdown with frontmatter. It stores the seat role, repos, each repo
1515
+ role, goal, and runtime per window. Reduced example:
1516
+
1517
+ ```yaml
1518
+ ---
1519
+ user: alice
1520
+ name: alice
1521
+ role: cpto
1522
+ agent: alice-product-cpto
1523
+ repos: [api, web, portfolio]
1524
+ role.api: data-engineer
1525
+ role.web: dev
1526
+ role.portfolio: seo
1527
+ goals_defined: true
1528
+ runs.seat: codex
1529
+ runs.api: claude
1530
+ model.api: opus
1531
+ effort.api: high
1532
+ runs.web: codex
1533
+ runs.portfolio: terminal:gemini
1534
+ ---
1535
+ ```
1536
+
1537
+ Names after the dot use the normalised window actor: lowercase letters, digits,
1538
+ and hyphens. Prefer `seat --repos`, `--agent-roles`, `--goal`, and `--engines` to
1539
+ maintain the card safely. A malformed manual edit degrades the operating role to
1540
+ `blank` or may block startup; it is not evaluated as code.
1541
+
1542
+ The card body retains the goal and round history. Changing the goal rewrites
1543
+ only that section, not the history.
1544
+
1545
+ ### Editable knowledge
1546
+
1547
+ ```text
1548
+ domains/<domain>.md
1549
+ roles/<role>.md
1550
+ AGENTS.md
1551
+ ```
1552
+
1553
+ The first two begin as initial profiles and then belong to the city. You may
1554
+ edit, replace, or remove them. Agents City does not overwrite an existing file
1555
+ during a later configuration change. `AGENTS.md` tells runtimes how to interpret
1556
+ the city; review it after deep customisation.
1557
+
1558
+ Skills remain inside repositories and are independent of these files.
1559
+
1560
+ ### Runtime state
1561
+
1562
+ The local hub keeps ephemeral state separate from readable configuration:
1563
+
1564
+ ```text
1565
+ ~/.agents-city/.runtime/bus/<city-id>/
1566
+ ├── endpoint.json
1567
+ ├── hub.lock
1568
+ ├── road-token
1569
+ ├── actors/*.json
1570
+ ├── outbox/<actor>/*.json
1571
+ ├── road-queue/*.json
1572
+ ├── road-inbox/*.json
1573
+ └── road-history.jsonl
1574
+ ```
1575
+
1576
+ Credentials and runtime files are created with private permissions. Outboxes let
1577
+ an actor reconnect without losing an already accepted task; its ACK removes the
1578
+ pending item. Current limits are 200 pending items per queue and a 72-hour
1579
+ message lifetime. `bus inbox` consumes `road-inbox`, not append-only history.
1580
+
1581
+ ### Configurable variables
1582
+
1583
+ | Variable | Default | Use |
1584
+ |---|---|---|
1585
+ | `AGENTS_CITY_HOME` | `~/.agents-city` | root for all data and runtimes |
1586
+ | `AGENTS_CITY_USER` | resolved local identity | force an owner for tests/migrations |
1587
+ | `AGENTS_CITY_DATA` | selected city | force a city folder from an outside terminal |
1588
+ | `CITY_CODE_DIR` | `~/codigo` | destination for accepted GitHub clones |
1589
+ | `CITY_SEARCH_IN` | common home roots | colon-separated roots for local repo search |
1590
+ | `CITY_SEARCH_DEPTH` | `4` | maximum depth of that search |
1591
+ | `AGENTS_CITY_ORG` | empty | filter repositories by organisation; empty means all |
1592
+ | `CITY_SETTLE` | `8` | initial Claude startup wait in seconds |
1593
+ | `CITY_STAGGER` | `1` | extra separation per Claude window |
1594
+ | `CITY_BUS_URL` | empty | optional remote bus endpoint |
1595
+ | `CITY_BUS_TOKEN` | empty | credential for remote transport/map |
1596
+ | `AGENTS_CITY_URL` | `CITY_BUS_URL` | reporting/map endpoint when separate |
1597
+ | `CITY_DIR` | `~/.claude/channels/city-bus` | compatibility folder for `.env` and hooks |
1598
+ | `CITY_HOOKS` | `city` | `everywhere` runs the conscience hooks in every Claude session, not only city runtimes |
1599
+
1600
+ Examples:
1601
+
1602
+ ```bash
1603
+ CITY_SEARCH_IN="$HOME/clients:$HOME/code" \
1604
+ CITY_SEARCH_DEPTH=6 \
1605
+ agents-city seat --repos
1606
+
1607
+ AGENTS_CITY_HOME="$(mktemp -d)" \
1608
+ AGENTS_CITY_USER=tester \
1609
+ agents-city cities create lab
1610
+
1611
+ CITY_SETTLE=0 CITY_STAGGER=0 agents-city seat --city product
1612
+ ```
1613
+
1614
+ The local repository index is cached for one day at
1615
+ `$XDG_CACHE_HOME/agents-city/repos.tsv` or `~/.cache/agents-city/repos.tsv`. The
1616
+ Hall offers a refresh. From a terminal, if you change `CITY_SEARCH_IN` while the
1617
+ cache is still valid, remove **only that index file** and repeat `seat --repos`.
1618
+
1619
+ Transport setting precedence is:
1620
+
1621
+ 1. an environment variable already present;
1622
+ 2. a recognised key in `~/.claude/channels/city-bus/.env`;
1623
+ 3. for the token only on macOS, the Keychain service `city@agents-city`.
1624
+
1625
+ The `.env` loader accepts known keys only and cannot redefine `PATH`. The session
1626
+ injects `CITY_ADDRESS`, `CITY_BUS_ACTOR`, `CITY_RUNTIME_KIND`, and
1627
+ `CITY_AGENT_ROLE` to authenticate each window; do not store them as global
1628
+ configuration.
1629
+
1630
+ ## Security and trust boundaries
1631
+
1632
+ - The plugin's conscience stays inside the city: every hook checks for a city
1633
+ identity (`CITY_BUS_ACTOR`) first and is silent in plain Claude sessions —
1634
+ installing the plugin does not enrol every conversation on the machine.
1635
+ `CITY_HOOKS=everywhere` is the explicit machine-wide opt-in.
1636
+ - Each city's hub binds a random port on `127.0.0.1`; it is not published to the
1637
+ LAN.
1638
+ - Every actor has its own token and role. The seat is `chair`; each repo is
1639
+ `member`.
1640
+ - Members receive no road credentials, cannot call `road.send`, and have no
1641
+ member-to-member route.
1642
+ - Only a `seat -> seat` envelope addressed to a declared road may leave a city.
1643
+ - An invitation contains identity/address, never the remote token.
1644
+ - Protocol text fields are limited to 64,000 characters and IDs/paths are
1645
+ normalised before use.
1646
+ - Known runtimes use native APIs. Only `terminal:<command>` permits the visible
1647
+ tmux fallback.
1648
+ - `report` and `tokens` are dry-run by default; sending requires `--push`.
1649
+ - `reset` and `exit` have `--dry-run`; reset creates a backup, and neither should
1650
+ touch unrelated tmux sessions.
1651
+
1652
+ ### The cage, the broker, and the audit chain
1653
+
1654
+ Yolo mode stays — a committee cannot work if every bus command needs a human —
1655
+ but "do not ask" and "touch everything" are different axes, and only the first
1656
+ one is yolo. On macOS Claude, OpenCode and Kimi repo windows launch inside a
1657
+ generated seatbelt profile: writes land only in their own repo and runtime state, and the files
1658
+ that turn a prompt injection into a credential theft (`~/.ssh`,
1659
+ `~/.git-credentials`, `~/.aws`, gh and cloud configs, remote road tokens) are
1660
+ sealed at the kernel — reads and writes, children and grandchildren included.
1661
+ The agent is never asked anything; forbidden paths simply do not exist for it.
1662
+ Codex instead applies its native `workspace-write` sandbox and is not wrapped
1663
+ in seatbelt: MCP workers such as `node_repl` apply their own sandbox, and macOS
1664
+ rejects that operation inside an already-caged process. `CITY_CAGE=0`
1665
+ deliberately disables the applicable confinement layer.
1666
+
1667
+ Because a caged window cannot read the `gh` token, PRs and pushes go through
1668
+ an opt-in credential broker (`CITY_BROKER=1`): a small owner-side process that
1669
+ holds the credentials, accepts per-window tokens bound to a single repo,
1670
+ refuses any action on the default branch, and writes every request — served or
1671
+ refused — to a hash-chained audit log the windows cannot touch. One rewritten
1672
+ byte breaks the chain and `broker.py verify` says so. The live kernel checks
1673
+ and both broker paths, happy and refused, run in `bin/test-cage.py` and
1674
+ `bin/test-broker.py`. The full model, its dials and its honest limits are in
1675
+ [docs/security.md](docs/security.md).
1676
+
1677
+ Agents City isolates protocol responsibilities; it is not a hostile sandbox
1678
+ against the operating-system owner. Another process running as your user can
1679
+ read your repos, attach to tmux, or read private files in your home. Use separate
1680
+ accounts, VMs, or containers for untrusted code, and also apply each provider
1681
+ CLI's permission controls.
1682
+
1683
+ A remote bus expands the trust surface. Deploy HTTPS/WSS, rotate tokens, limit
1684
+ scopes, and read [docs/self-host.md](docs/self-host.md). A road authorises message
1685
+ exchange between seats; it neither authorises execution of received commands nor
1686
+ grants remote filesystem access.
1687
+
1688
+ ## Troubleshooting
1689
+
1690
+ ### `agents-city seat` returns to an already open session
1691
+
1692
+ This is expected. The tmux name is stable per owner/city. Detach with `Ctrl-b d`
1693
+ or inspect before closing:
1694
+
1695
+ ```bash
1696
+ agents-city exit <city> --dry-run
1697
+ ```
1698
+
1699
+ ### I updated the package but still see the old behaviour
1700
+
1701
+ A new global npm package does not replace live processes or tmux sessions. Check
1702
+ the binary being executed and restart only the city:
1703
+
1704
+ ```bash
1705
+ type -a agents-city
1706
+ agents-city --version
1707
+ npm root -g
1708
+ agents-city exit <city> --dry-run
1709
+ agents-city exit <city>
1710
+ agents-city seat --city <city>
1711
+ ```
1712
+
1713
+ With `fnm`, `nvm`, or `asdf`, every Node version may have a different global
1714
+ package set. Install the tarball under the Node version that will execute it.
1715
+
1716
+ ### Codex shows `city>` instead of its TUI
1717
+
1718
+ Codex should show its official TUI. Verify a Codex version supporting
1719
+ `app-server`/`--remote`, update Agents City, and restart the city. Startup logs
1720
+ should show the WebSocket endpoint, the wait for the TUI thread, `Codex TUI
1721
+ thread ... adopted over WebSocket`, and bus authentication. After the first turn
1722
+ it will also show `joined over WebSocket`. `city>` is currently the expected
1723
+ console for OpenCode and Kimi.
1724
+
1725
+ If you see `Failed to resume session ... no rollout found`, you are running the
1726
+ broken `0.3.0-beta.10` path, which tried to open a newly created thread through
1727
+ `codex resume --remote`. `0.3.0-beta.11` opened the right TUI but could wait
1728
+ indefinitely for an empty thread to materialize its first rollout. Install
1729
+ `0.3.0-beta.21` or later and restart only that
1730
+ city with `agents-city exit <city>` followed by `agents-city seat --city <city>`.
1731
+
1732
+ ### The `seat` window prints `fatal: not a git repository`
1733
+
1734
+ The seat lives in the city data folder, which need not be a Git repository.
1735
+ Current launchers skip sync there. Seeing this error before Codex starts usually
1736
+ means the session still runs an old launcher: update, run `exit <city>`, and open
1737
+ it again. A real repo window without `.git` should be diagnosed separately.
1738
+
1739
+ ### Claude says the plugin is not on the Channels allowlist
1740
+
1741
+ Agents City `0.3.0-beta.21` and later do not launch Claude with `--channels`.
1742
+ That message therefore identifies an old live session or a manual Channel
1743
+ invocation, not missing personal-account configuration. Do **not** create a
1744
+ machine-wide managed settings file or use `sudo`. Update Agents City, verify the
1745
+ version, then restart only the affected city with `agents-city exit <city>` and
1746
+ `agents-city seat --city <city>`. The normal log should say
1747
+ `Claude Code ready over persistent stream-json` and
1748
+ `claude-stream-json ready`.
1749
+
1750
+ ### Claude shows `Claude API` or asks for usage credits on a Team/Max account
1751
+
1752
+ An inherited `CLAUDE_CODE_OAUTH_TOKEN`, API key, gateway URL, Bedrock, Vertex,
1753
+ or Foundry selector can take precedence over the healthy Claude.ai login stored
1754
+ by the CLI. Inspect names only — never print credential values:
1755
+
1756
+ ```bash
1757
+ claude auth status
1758
+ tmux show-environment -g | cut -d= -f1 | \
1759
+ grep -E 'CLAUDE_CODE_OAUTH_TOKEN|ANTHROPIC_(API_KEY|AUTH_TOKEN|BASE_URL)|CLAUDE_CODE_USE_'
1760
+ env -u CLAUDE_CODE_OAUTH_TOKEN \
1761
+ -u ANTHROPIC_API_KEY -u ANTHROPIC_AUTH_TOKEN -u ANTHROPIC_BASE_URL \
1762
+ -u CLAUDE_CODE_USE_BEDROCK -u CLAUDE_CODE_USE_VERTEX \
1763
+ -u CLAUDE_CODE_USE_FOUNDRY claude auth status
1764
+ ```
1765
+
1766
+ If the last command reports `authMethod: claude.ai`, Agents City uses that login
1767
+ and removes only those overrides from each new city child. It never deletes a
1768
+ token, logs out, or rewrites the credential store. Restart only that city after
1769
+ updating. To deliberately use environment/API authentication instead:
1770
+
1771
+ ```bash
1772
+ CITY_CLAUDE_AUTH=environment agents-city seat --city <city>
1773
+ ```
1774
+
1775
+ ### Codex tools fail with `sandbox_apply: Operation not permitted`
1776
+
1777
+ This is the macOS nested-sandbox failure: an older launcher put Codex's own
1778
+ sandbox (or an MCP worker sandbox) inside the city's seatbelt cage. Install the
1779
+ current beta and restart only the affected city. Codex now runs without the
1780
+ outer seatbelt and keeps its native `workspace-write` confinement, so repo reads
1781
+ and tools work without a nested `sandbox_apply`.
1782
+
1783
+ ### Codex reports an MCP executable is missing
1784
+
1785
+ Codex inherits your global MCP registry. Agents City checks that registry
1786
+ without printing its environment values. If an enabled stdio MCP points to an
1787
+ executable that provably does not exist, it is disabled only for that city
1788
+ process; `~/.codex/config.toml` is not changed and healthy MCPs remain enabled.
1789
+ Inspect the scoped decision with:
1790
+
1791
+ ```bash
1792
+ agents-city logs --diagnostics | grep codex.mcp.unavailable.disabled
1793
+ ```
1794
+
1795
+ Fix or remove the original global entry later with `codex mcp`; a URL failure
1796
+ or another uncertain startup error is left visible rather than guessed away.
1797
+
1798
+ ### Text or JSON appears to be pasted into a window
1799
+
1800
+ Claude, Codex, OpenCode, and Kimi do not use the clipboard or `tmux paste`.
1801
+ Inspect the card through:
1802
+
1803
+ ```bash
1804
+ agents-city seat --engines
1805
+ ```
1806
+
1807
+ If that row uses `terminal:<command>`, you selected the compatibility adapter and
1808
+ visible injection is expected. If a known runtime appears that way, select its
1809
+ native runtime again.
1810
+
1811
+ ### A Claude window shows a command ending in `--da`, `--dangerously`, or `-`
1812
+
1813
+ That is a truncated legacy launch command, not a Claude or WebSocket message.
1814
+ Current versions write the full command into a private audited launcher and type
1815
+ only its short path into tmux. Update the package and restart only that city:
1816
+
1817
+ ```bash
1818
+ agents-city --version
1819
+ agents-city exit <city> --dry-run
1820
+ agents-city exit <city>
1821
+ agents-city seat --city <city>
1822
+ agents-city logs --diagnostics --follow
1823
+ ```
1824
+
1825
+ A failed launcher records `launch.failed`, prints its exit code and log path in
1826
+ the pane, and emits `runtime.launch.failed` to City live. It never logs the full
1827
+ command or credentials.
1828
+
1829
+ ### My repositories do not appear
1830
+
1831
+ ```bash
1832
+ command -v git
1833
+ git -C /path/to/repo remote get-url origin
1834
+ CITY_SEARCH_IN="/root/one:/root/two" \
1835
+ CITY_SEARCH_DEPTH=6 \
1836
+ agents-city seat --repos
1837
+ ```
1838
+
1839
+ Discovery requires `.git` (a directory or worktree file) and an `origin` remote.
1840
+ If roots just changed, refresh in the Hall or remove only
1841
+ `~/.cache/agents-city/repos.tsv`. `AGENTS_CITY_ORG` may be filtering the repo;
1842
+ leave it empty to index every remote.
1843
+
1844
+ ### GitHub does not show private repos or organisations
1845
+
1846
+ ```bash
1847
+ gh auth status
1848
+ gh api user --jq .login
1849
+ gh auth refresh -s read:org
1850
+ ```
1851
+
1852
+ Test access directly with `gh`; Agents City only consumes that session. An SSO
1853
+ organisation may require authorising the token in GitHub. Disk selection always
1854
+ works without OAuth.
1855
+
1856
+ ### A repo on the card gets no window
1857
+
1858
+ The card may reference a repo that is not cloned. Run `seat --repos` and accept
1859
+ the clone, or clone it manually under an indexed root. If two names normalise to
1860
+ the same actor (for example, they differ only in punctuation), Agents City
1861
+ rejects the collision instead of mixing credentials.
1862
+
1863
+ ### The bus says it is already starting or running
1864
+
1865
+ Do not delete locks while a process is alive. Inspect scope:
1866
+
1867
+ ```bash
1868
+ agents-city exit <city> --dry-run
1869
+ ```
1870
+
1871
+ If the expected session exists, reattach with `seat`. If it is a managed orphan,
1872
+ `exit <city>` stops it. The hub recovers a stale lock whose PID no longer exists;
1873
+ a newly created unreadable lock is preserved to prevent two simultaneous hubs.
1874
+
1875
+ ### An agent was offline when a task arrived
1876
+
1877
+ Accepted internal envelopes remain in its outbox until ACK, with a 72-hour TTL.
1878
+ Reopen the same city/runtime to drain the queue. If the provider rejected the
1879
+ task, delivery remains failed and no ACK is invented. Use logs and the runtime
1880
+ benchmark to distinguish native rejection, authentication, and latency.
1881
+
1882
+ ### A local road exists but the destination is offline
1883
+
1884
+ `road connect` configures reachability; it does not start the other city. Open
1885
+ both sessions:
1886
+
1887
+ ```bash
1888
+ agents-city seat --city source
1889
+ agents-city seat --city destination
1890
+ ```
1891
+
1892
+ A remote road additionally requires valid `CITY_BUS_URL` and `CITY_BUS_TOKEN` at
1893
+ both ends. A queued message does not mean the destination accepted or agreed.
1894
+
1895
+ ### The committee rejects my command
1896
+
1897
+ Inspect state and schema first:
1898
+
1899
+ ```bash
1900
+ agents-city committee show <id>
1901
+ agents-city committee schema <verb>
1902
+ ```
1903
+
1904
+ Common rejections are deliberate: the seat tries to respond as a member; a
1905
+ member tries to decide; a position is missing without `--proceed-without`; a
1906
+ floor request remains pending; verifier equals executor when another identity is
1907
+ available; or closure is attempted before a passing verification.
1908
+
1909
+ ### I want to start over
1910
+
1911
+ Do not delete all of `~/.agents-city` when only one city needs a reset:
1912
+
1913
+ ```bash
1914
+ agents-city reset <city> --dry-run
1915
+ agents-city reset <city>
1916
+ agents-city seat --city <city>
1917
+ ```
1918
+
1919
+ The output names the backup. Use `exit` when you only need to restart processes.
1920
+
1921
+ ## Development and testing
1922
+
1923
+ ### Full validation
1924
+
1925
+ ```bash
1926
+ git clone https://github.com/jlcases/agents-city.git
1927
+ cd agents-city
1928
+ npm install
1929
+ npm test
1930
+ ```
1931
+
1932
+ `npm test` runs `./bin/test`: Python/shell suites, buses and native runtimes with
1933
+ deterministic doubles, one throwaway tmux for unknown fallback only, a 40-actor
1934
+ stress test, cross-component contracts, and tarball allowlist checks. The default
1935
+ run is offline and uses temporary homes/repos.
1936
+
1937
+ Focused tests:
1938
+
1939
+ ```bash
1940
+ ./bin/test seat runtime-ui
1941
+ ./bin/test channel committee runtime runtime-failures
1942
+ ./bin/test stress benchmark contracts exit
1943
+ ```
1944
+
1945
+ ### Typecheck and bundles
1946
+
1947
+ ```bash
1948
+ cd city/web
1949
+ npm run typecheck
1950
+ npm run build
1951
+
1952
+ cd ../../plugin/channel
1953
+ npm run typecheck
1954
+ npm run build
1955
+ ```
1956
+
1957
+ Generated `plugin/channel` JavaScript ships in the package. Editing TypeScript
1958
+ without rebuilding leaves the tarball running old code.
1959
+
1960
+ ### Validate the exact package without publishing
1961
+
1962
+ ```bash
1963
+ npm pack --dry-run
1964
+ npm pack
1965
+
1966
+ CITY_TEST_PREFIX="$(mktemp -d)"
1967
+ npm install -g --prefix "$CITY_TEST_PREFIX" ./agents-city-0.3.0-beta.21.tgz
1968
+ "$CITY_TEST_PREFIX/bin/agents-city" --version
1969
+ "$CITY_TEST_PREFIX/bin/agents-city" --help
1970
+ ```
1971
+
1972
+ For onboarding tests, also use temporary `HOME`, `AGENTS_CITY_HOME`, and
1973
+ `AGENTS_CITY_USER` values. Never point a suite at real city data.
1974
+
1975
+ The full matrix and invariants live in [docs/testing.md](docs/testing.md).
1976
+ Benchmarks have dedicated guides in
1977
+ [benchmarks/stress/README.md](benchmarks/stress/README.md),
1978
+ [benchmarks/latency/README.md](benchmarks/latency/README.md), and
1979
+ [benchmarks/committee/README.md](benchmarks/committee/README.md).
1980
+
1981
+ ## Editions, license, and trust
1982
+
1983
+ This repository is the **Community Edition**, licensed under
1984
+ [Apache-2.0](LICENSE): free to use, modify, self-host and build on, with an
1985
+ explicit patent grant. The license does not grant rights to the *Agents City*
1986
+ name — code travels, the name stays.
1987
+
1988
+ An **Enterprise Edition** exists on top of this core: semantic city memory
1989
+ (vector search across acts, notices and deliberations), SSO, cross-city audit
1990
+ and fleet management. It is not in this repository. Agents City is built by
1991
+ [Arkatai](https://arkatai.com), an agentic-development studio — for the
1992
+ Enterprise Edition write to <hello@arkatai.com> or open an issue tagged
1993
+ `enterprise`.
1994
+
1995
+ **No telemetry.** The product phones nobody home: everything runs on loopback
1996
+ and local files, and nothing about your work leaves the machine except what
1997
+ you configure yourself — a remote road, or a `--push` to your own worker. The
1998
+ only third-party request the web pages make is loading their typefaces from
1999
+ Google Fonts.