agentshire 2026.4.12

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 (406) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/LICENSE +21 -0
  3. package/README.md +437 -0
  4. package/README.zh-CN.md +441 -0
  5. package/ROADMAP.md +207 -0
  6. package/THIRD_PARTY_NOTICES.md +49 -0
  7. package/VISION.md +101 -0
  8. package/index.ts +386 -0
  9. package/openclaw.plugin.json +27 -0
  10. package/package.json +94 -0
  11. package/src/bridge/AGENTS.md +136 -0
  12. package/src/bridge/ActivityStream.ts +184 -0
  13. package/src/bridge/CitizenManager.ts +280 -0
  14. package/src/bridge/DirectorBridge.ts +1076 -0
  15. package/src/bridge/EventTranslator.ts +142 -0
  16. package/src/bridge/NpcEventQueue.ts +61 -0
  17. package/src/bridge/ReconnectManager.ts +42 -0
  18. package/src/bridge/RouteManager.ts +270 -0
  19. package/src/bridge/StateTracker.ts +100 -0
  20. package/src/bridge/ToolVfxMapper.ts +94 -0
  21. package/src/bridge/__tests__/ActivityStream.test.ts +156 -0
  22. package/src/bridge/__tests__/CitizenManager.test.ts +174 -0
  23. package/src/bridge/__tests__/EventTranslator.test.ts +292 -0
  24. package/src/bridge/__tests__/NpcEventQueue.test.ts +92 -0
  25. package/src/bridge/__tests__/RouteManager.test.ts +106 -0
  26. package/src/bridge/data/route-config.json +36 -0
  27. package/src/bridge/data/route-config.ts +19 -0
  28. package/src/bridge/implicit-chat.ts +192 -0
  29. package/src/bridge/index.ts +12 -0
  30. package/src/contracts/agent-state.ts +87 -0
  31. package/src/contracts/agui.ts +212 -0
  32. package/src/contracts/chat.ts +67 -0
  33. package/src/contracts/events.ts +170 -0
  34. package/src/contracts/index.ts +71 -0
  35. package/src/contracts/media.ts +77 -0
  36. package/src/contracts/registry.ts +32 -0
  37. package/src/plugin/AGENTS.md +192 -0
  38. package/src/plugin/__tests__/editor-serve-megapack.test.ts +150 -0
  39. package/src/plugin/__tests__/hook-translator.test.ts +197 -0
  40. package/src/plugin/auto-config.ts +126 -0
  41. package/src/plugin/channel.ts +399 -0
  42. package/src/plugin/chat-asset-resolver.ts +75 -0
  43. package/src/plugin/chat-session-watcher.ts +98 -0
  44. package/src/plugin/citizen-agent-manager.ts +178 -0
  45. package/src/plugin/citizen-chat-router.ts +83 -0
  46. package/src/plugin/citizen-workshop-manager.ts +96 -0
  47. package/src/plugin/custom-asset-manager.ts +250 -0
  48. package/src/plugin/editor-serve.ts +1368 -0
  49. package/src/plugin/group-discussion.ts +223 -0
  50. package/src/plugin/hook-translator.ts +202 -0
  51. package/src/plugin/llm-agent-proxy.ts +193 -0
  52. package/src/plugin/outbound-adapter.ts +187 -0
  53. package/src/plugin/paths.ts +33 -0
  54. package/src/plugin/plan-manager.ts +594 -0
  55. package/src/plugin/runtime.ts +9 -0
  56. package/src/plugin/session-history.ts +838 -0
  57. package/src/plugin/session-log-watcher.ts +221 -0
  58. package/src/plugin/soul-prompt-template.ts +290 -0
  59. package/src/plugin/subagent-tracker.ts +205 -0
  60. package/src/plugin/tools.ts +493 -0
  61. package/src/plugin/town-session.ts +40 -0
  62. package/src/plugin/ws-server.ts +680 -0
  63. package/src/town-souls.ts +134 -0
  64. package/town-frontend/dist/assets/CustomAssetStore-oi8aIurt.js +2 -0
  65. package/town-frontend/dist/assets/GLTFLoader-BA5RqSME.js +3804 -0
  66. package/town-frontend/dist/assets/OrbitControls-ZmySp9sQ.js +2 -0
  67. package/town-frontend/dist/assets/SettingsPanel-BO52reJe.js +2 -0
  68. package/town-frontend/dist/assets/SkeletonUtils-BCVmgslc.js +2 -0
  69. package/town-frontend/dist/assets/SkillLearnCard-Dk38iDpy.js +6 -0
  70. package/town-frontend/dist/assets/TopicSetupPanel-DLaLHB_Z.js +2 -0
  71. package/town-frontend/dist/assets/Trap-Bold-CT0JBE39.woff2 +0 -0
  72. package/town-frontend/dist/assets/Trap-SemiBold-R4_-Ld0j.woff2 +0 -0
  73. package/town-frontend/dist/assets/WeatherSystem-Cb3BvHes.js +550 -0
  74. package/town-frontend/dist/assets/avatars/char-female-a.webp +0 -0
  75. package/town-frontend/dist/assets/avatars/char-female-b.webp +0 -0
  76. package/town-frontend/dist/assets/avatars/char-female-c.webp +0 -0
  77. package/town-frontend/dist/assets/avatars/char-female-d.webp +0 -0
  78. package/town-frontend/dist/assets/avatars/char-female-e.webp +0 -0
  79. package/town-frontend/dist/assets/avatars/char-female-f.webp +0 -0
  80. package/town-frontend/dist/assets/avatars/char-male-a.webp +0 -0
  81. package/town-frontend/dist/assets/avatars/char-male-b.webp +0 -0
  82. package/town-frontend/dist/assets/avatars/char-male-c.webp +0 -0
  83. package/town-frontend/dist/assets/avatars/char-male-d.webp +0 -0
  84. package/town-frontend/dist/assets/avatars/char-male-e.webp +0 -0
  85. package/town-frontend/dist/assets/avatars/char-male-f.webp +0 -0
  86. package/town-frontend/dist/assets/avatars/char-pet-beaver.webp +0 -0
  87. package/town-frontend/dist/assets/avatars/char-pet-bee.webp +0 -0
  88. package/town-frontend/dist/assets/avatars/char-pet-bunny.webp +0 -0
  89. package/town-frontend/dist/assets/avatars/char-pet-cat.webp +0 -0
  90. package/town-frontend/dist/assets/avatars/char-pet-caterpillar.webp +0 -0
  91. package/town-frontend/dist/assets/avatars/char-pet-chick.webp +0 -0
  92. package/town-frontend/dist/assets/avatars/char-pet-cow.webp +0 -0
  93. package/town-frontend/dist/assets/avatars/char-pet-crab.webp +0 -0
  94. package/town-frontend/dist/assets/avatars/char-pet-deer.webp +0 -0
  95. package/town-frontend/dist/assets/avatars/char-pet-dog.webp +0 -0
  96. package/town-frontend/dist/assets/avatars/char-pet-elephant.webp +0 -0
  97. package/town-frontend/dist/assets/avatars/char-pet-fish.webp +0 -0
  98. package/town-frontend/dist/assets/avatars/char-pet-fox.webp +0 -0
  99. package/town-frontend/dist/assets/avatars/char-pet-giraffe.webp +0 -0
  100. package/town-frontend/dist/assets/avatars/char-pet-hog.webp +0 -0
  101. package/town-frontend/dist/assets/avatars/char-pet-koala.webp +0 -0
  102. package/town-frontend/dist/assets/avatars/char-pet-lion.webp +0 -0
  103. package/town-frontend/dist/assets/avatars/char-pet-monkey.webp +0 -0
  104. package/town-frontend/dist/assets/avatars/char-pet-panda.webp +0 -0
  105. package/town-frontend/dist/assets/avatars/char-pet-parrot.webp +0 -0
  106. package/town-frontend/dist/assets/avatars/char-pet-penguin.webp +0 -0
  107. package/town-frontend/dist/assets/avatars/char-pet-pig.webp +0 -0
  108. package/town-frontend/dist/assets/avatars/char-pet-polar.webp +0 -0
  109. package/town-frontend/dist/assets/avatars/char-pet-tiger.webp +0 -0
  110. package/town-frontend/dist/assets/character-catalog-DSmLtlNC.js +2 -0
  111. package/town-frontend/dist/assets/citizenEditor-DubGSJOQ.js +296 -0
  112. package/town-frontend/dist/assets/command-parser-BUd15Bmv.js +12 -0
  113. package/town-frontend/dist/assets/editor-B5QO0OtX.js +258 -0
  114. package/town-frontend/dist/assets/editor-Bk8g1NCD.css +1 -0
  115. package/town-frontend/dist/assets/index-BWfrufil.js +2 -0
  116. package/town-frontend/dist/assets/index-faS20RJk.js +6 -0
  117. package/town-frontend/dist/assets/logo-DJI6EtST.png +0 -0
  118. package/town-frontend/dist/assets/logo-title-AdKPZX5E.png +0 -0
  119. package/town-frontend/dist/assets/main-CqsN43aT.js +224 -0
  120. package/town-frontend/dist/assets/main-D7neuy3w.css +1 -0
  121. package/town-frontend/dist/assets/models/buildings/base.bin +0 -0
  122. package/town-frontend/dist/assets/models/buildings/base.gltf +136 -0
  123. package/town-frontend/dist/assets/models/buildings/bench.bin +0 -0
  124. package/town-frontend/dist/assets/models/buildings/bench.gltf +136 -0
  125. package/town-frontend/dist/assets/models/buildings/box_A.bin +0 -0
  126. package/town-frontend/dist/assets/models/buildings/box_A.gltf +136 -0
  127. package/town-frontend/dist/assets/models/buildings/box_B.bin +0 -0
  128. package/town-frontend/dist/assets/models/buildings/box_B.gltf +136 -0
  129. package/town-frontend/dist/assets/models/buildings/building_A.bin +0 -0
  130. package/town-frontend/dist/assets/models/buildings/building_A.gltf +136 -0
  131. package/town-frontend/dist/assets/models/buildings/building_A_withoutBase.bin +0 -0
  132. package/town-frontend/dist/assets/models/buildings/building_A_withoutBase.gltf +136 -0
  133. package/town-frontend/dist/assets/models/buildings/building_B.bin +0 -0
  134. package/town-frontend/dist/assets/models/buildings/building_B.gltf +136 -0
  135. package/town-frontend/dist/assets/models/buildings/building_B_withoutBase.bin +0 -0
  136. package/town-frontend/dist/assets/models/buildings/building_B_withoutBase.gltf +136 -0
  137. package/town-frontend/dist/assets/models/buildings/building_C.bin +0 -0
  138. package/town-frontend/dist/assets/models/buildings/building_C.gltf +136 -0
  139. package/town-frontend/dist/assets/models/buildings/building_C_withoutBase.bin +0 -0
  140. package/town-frontend/dist/assets/models/buildings/building_C_withoutBase.gltf +136 -0
  141. package/town-frontend/dist/assets/models/buildings/building_D.bin +0 -0
  142. package/town-frontend/dist/assets/models/buildings/building_D.gltf +136 -0
  143. package/town-frontend/dist/assets/models/buildings/building_D_withoutBase.bin +0 -0
  144. package/town-frontend/dist/assets/models/buildings/building_D_withoutBase.gltf +136 -0
  145. package/town-frontend/dist/assets/models/buildings/building_E.bin +0 -0
  146. package/town-frontend/dist/assets/models/buildings/building_E.gltf +136 -0
  147. package/town-frontend/dist/assets/models/buildings/building_E_withoutBase.bin +0 -0
  148. package/town-frontend/dist/assets/models/buildings/building_E_withoutBase.gltf +136 -0
  149. package/town-frontend/dist/assets/models/buildings/building_F.bin +0 -0
  150. package/town-frontend/dist/assets/models/buildings/building_F.gltf +136 -0
  151. package/town-frontend/dist/assets/models/buildings/building_F_withoutBase.bin +0 -0
  152. package/town-frontend/dist/assets/models/buildings/building_F_withoutBase.gltf +136 -0
  153. package/town-frontend/dist/assets/models/buildings/building_G.bin +0 -0
  154. package/town-frontend/dist/assets/models/buildings/building_G.gltf +136 -0
  155. package/town-frontend/dist/assets/models/buildings/building_G_withoutBase.bin +0 -0
  156. package/town-frontend/dist/assets/models/buildings/building_G_withoutBase.gltf +136 -0
  157. package/town-frontend/dist/assets/models/buildings/building_H.bin +0 -0
  158. package/town-frontend/dist/assets/models/buildings/building_H.gltf +136 -0
  159. package/town-frontend/dist/assets/models/buildings/building_H_withoutBase.bin +0 -0
  160. package/town-frontend/dist/assets/models/buildings/building_H_withoutBase.gltf +136 -0
  161. package/town-frontend/dist/assets/models/buildings/bush.bin +0 -0
  162. package/town-frontend/dist/assets/models/buildings/bush.gltf +136 -0
  163. package/town-frontend/dist/assets/models/buildings/car_hatchback.bin +0 -0
  164. package/town-frontend/dist/assets/models/buildings/car_hatchback.gltf +442 -0
  165. package/town-frontend/dist/assets/models/buildings/car_police.bin +0 -0
  166. package/town-frontend/dist/assets/models/buildings/car_police.gltf +442 -0
  167. package/town-frontend/dist/assets/models/buildings/car_sedan.bin +0 -0
  168. package/town-frontend/dist/assets/models/buildings/car_sedan.gltf +442 -0
  169. package/town-frontend/dist/assets/models/buildings/car_stationwagon.bin +0 -0
  170. package/town-frontend/dist/assets/models/buildings/car_stationwagon.gltf +442 -0
  171. package/town-frontend/dist/assets/models/buildings/car_taxi.bin +0 -0
  172. package/town-frontend/dist/assets/models/buildings/car_taxi.gltf +442 -0
  173. package/town-frontend/dist/assets/models/buildings/citybits_texture.png +0 -0
  174. package/town-frontend/dist/assets/models/buildings/dumpster.bin +0 -0
  175. package/town-frontend/dist/assets/models/buildings/dumpster.gltf +136 -0
  176. package/town-frontend/dist/assets/models/buildings/firehydrant.bin +0 -0
  177. package/town-frontend/dist/assets/models/buildings/firehydrant.gltf +136 -0
  178. package/town-frontend/dist/assets/models/buildings/road_corner.bin +0 -0
  179. package/town-frontend/dist/assets/models/buildings/road_corner.gltf +136 -0
  180. package/town-frontend/dist/assets/models/buildings/road_corner_curved.bin +0 -0
  181. package/town-frontend/dist/assets/models/buildings/road_corner_curved.gltf +136 -0
  182. package/town-frontend/dist/assets/models/buildings/road_junction.bin +0 -0
  183. package/town-frontend/dist/assets/models/buildings/road_junction.gltf +136 -0
  184. package/town-frontend/dist/assets/models/buildings/road_straight.bin +0 -0
  185. package/town-frontend/dist/assets/models/buildings/road_straight.gltf +136 -0
  186. package/town-frontend/dist/assets/models/buildings/road_straight_crossing.bin +0 -0
  187. package/town-frontend/dist/assets/models/buildings/road_straight_crossing.gltf +136 -0
  188. package/town-frontend/dist/assets/models/buildings/road_tsplit.bin +0 -0
  189. package/town-frontend/dist/assets/models/buildings/road_tsplit.gltf +136 -0
  190. package/town-frontend/dist/assets/models/buildings/streetlight.bin +0 -0
  191. package/town-frontend/dist/assets/models/buildings/streetlight.gltf +136 -0
  192. package/town-frontend/dist/assets/models/buildings/trafficlight_A.bin +0 -0
  193. package/town-frontend/dist/assets/models/buildings/trafficlight_A.gltf +136 -0
  194. package/town-frontend/dist/assets/models/buildings/trafficlight_B.bin +0 -0
  195. package/town-frontend/dist/assets/models/buildings/trafficlight_B.gltf +136 -0
  196. package/town-frontend/dist/assets/models/buildings/trafficlight_C.bin +0 -0
  197. package/town-frontend/dist/assets/models/buildings/trafficlight_C.gltf +136 -0
  198. package/town-frontend/dist/assets/models/buildings/trash_A.bin +0 -0
  199. package/town-frontend/dist/assets/models/buildings/trash_A.gltf +136 -0
  200. package/town-frontend/dist/assets/models/buildings/trash_B.bin +0 -0
  201. package/town-frontend/dist/assets/models/buildings/trash_B.gltf +136 -0
  202. package/town-frontend/dist/assets/models/buildings/watertower.bin +0 -0
  203. package/town-frontend/dist/assets/models/buildings/watertower.gltf +136 -0
  204. package/town-frontend/dist/assets/models/characters/Textures/colormap.png +0 -0
  205. package/town-frontend/dist/assets/models/characters/character-female-a.glb +0 -0
  206. package/town-frontend/dist/assets/models/characters/character-female-b.glb +0 -0
  207. package/town-frontend/dist/assets/models/characters/character-female-c.glb +0 -0
  208. package/town-frontend/dist/assets/models/characters/character-female-d.glb +0 -0
  209. package/town-frontend/dist/assets/models/characters/character-female-e.glb +0 -0
  210. package/town-frontend/dist/assets/models/characters/character-female-f.glb +0 -0
  211. package/town-frontend/dist/assets/models/characters/character-male-a.glb +0 -0
  212. package/town-frontend/dist/assets/models/characters/character-male-b.glb +0 -0
  213. package/town-frontend/dist/assets/models/characters/character-male-c.glb +0 -0
  214. package/town-frontend/dist/assets/models/characters/character-male-d.glb +0 -0
  215. package/town-frontend/dist/assets/models/characters/character-male-e.glb +0 -0
  216. package/town-frontend/dist/assets/models/characters/character-male-f.glb +0 -0
  217. package/town-frontend/dist/assets/models/characters/character-pet-beaver.glb +0 -0
  218. package/town-frontend/dist/assets/models/characters/character-pet-bee.glb +0 -0
  219. package/town-frontend/dist/assets/models/characters/character-pet-bunny.glb +0 -0
  220. package/town-frontend/dist/assets/models/characters/character-pet-cat.glb +0 -0
  221. package/town-frontend/dist/assets/models/characters/character-pet-caterpillar.glb +0 -0
  222. package/town-frontend/dist/assets/models/characters/character-pet-chick.glb +0 -0
  223. package/town-frontend/dist/assets/models/characters/character-pet-cow.glb +0 -0
  224. package/town-frontend/dist/assets/models/characters/character-pet-crab.glb +0 -0
  225. package/town-frontend/dist/assets/models/characters/character-pet-deer.glb +0 -0
  226. package/town-frontend/dist/assets/models/characters/character-pet-dog.glb +0 -0
  227. package/town-frontend/dist/assets/models/characters/character-pet-elephant.glb +0 -0
  228. package/town-frontend/dist/assets/models/characters/character-pet-fish.glb +0 -0
  229. package/town-frontend/dist/assets/models/characters/character-pet-fox.glb +0 -0
  230. package/town-frontend/dist/assets/models/characters/character-pet-giraffe.glb +0 -0
  231. package/town-frontend/dist/assets/models/characters/character-pet-hog.glb +0 -0
  232. package/town-frontend/dist/assets/models/characters/character-pet-koala.glb +0 -0
  233. package/town-frontend/dist/assets/models/characters/character-pet-lion.glb +0 -0
  234. package/town-frontend/dist/assets/models/characters/character-pet-monkey.glb +0 -0
  235. package/town-frontend/dist/assets/models/characters/character-pet-panda.glb +0 -0
  236. package/town-frontend/dist/assets/models/characters/character-pet-parrot.glb +0 -0
  237. package/town-frontend/dist/assets/models/characters/character-pet-penguin.glb +0 -0
  238. package/town-frontend/dist/assets/models/characters/character-pet-pig.glb +0 -0
  239. package/town-frontend/dist/assets/models/characters/character-pet-polar.glb +0 -0
  240. package/town-frontend/dist/assets/models/characters/character-pet-tiger.glb +0 -0
  241. package/town-frontend/dist/assets/models/characters/colormap.png +0 -0
  242. package/town-frontend/dist/assets/models/furniture/armchair.bin +0 -0
  243. package/town-frontend/dist/assets/models/furniture/armchair.gltf +136 -0
  244. package/town-frontend/dist/assets/models/furniture/armchair_pillows.bin +0 -0
  245. package/town-frontend/dist/assets/models/furniture/armchair_pillows.gltf +136 -0
  246. package/town-frontend/dist/assets/models/furniture/bed_double_A.bin +0 -0
  247. package/town-frontend/dist/assets/models/furniture/bed_double_A.gltf +136 -0
  248. package/town-frontend/dist/assets/models/furniture/bed_double_B.bin +0 -0
  249. package/town-frontend/dist/assets/models/furniture/bed_double_B.gltf +136 -0
  250. package/town-frontend/dist/assets/models/furniture/bed_single_A.bin +0 -0
  251. package/town-frontend/dist/assets/models/furniture/bed_single_A.gltf +136 -0
  252. package/town-frontend/dist/assets/models/furniture/bed_single_B.bin +0 -0
  253. package/town-frontend/dist/assets/models/furniture/bed_single_B.gltf +136 -0
  254. package/town-frontend/dist/assets/models/furniture/book_set.bin +0 -0
  255. package/town-frontend/dist/assets/models/furniture/book_set.gltf +136 -0
  256. package/town-frontend/dist/assets/models/furniture/book_single.bin +0 -0
  257. package/town-frontend/dist/assets/models/furniture/book_single.gltf +136 -0
  258. package/town-frontend/dist/assets/models/furniture/cabinet_medium.bin +0 -0
  259. package/town-frontend/dist/assets/models/furniture/cabinet_medium.gltf +136 -0
  260. package/town-frontend/dist/assets/models/furniture/cabinet_medium_decorated.bin +0 -0
  261. package/town-frontend/dist/assets/models/furniture/cabinet_medium_decorated.gltf +136 -0
  262. package/town-frontend/dist/assets/models/furniture/cabinet_small.bin +0 -0
  263. package/town-frontend/dist/assets/models/furniture/cabinet_small.gltf +136 -0
  264. package/town-frontend/dist/assets/models/furniture/cabinet_small_decorated.bin +0 -0
  265. package/town-frontend/dist/assets/models/furniture/cabinet_small_decorated.gltf +136 -0
  266. package/town-frontend/dist/assets/models/furniture/cactus_medium_A.bin +0 -0
  267. package/town-frontend/dist/assets/models/furniture/cactus_medium_A.gltf +136 -0
  268. package/town-frontend/dist/assets/models/furniture/cactus_medium_B.bin +0 -0
  269. package/town-frontend/dist/assets/models/furniture/cactus_medium_B.gltf +136 -0
  270. package/town-frontend/dist/assets/models/furniture/cactus_small_A.bin +0 -0
  271. package/town-frontend/dist/assets/models/furniture/cactus_small_A.gltf +136 -0
  272. package/town-frontend/dist/assets/models/furniture/cactus_small_B.bin +0 -0
  273. package/town-frontend/dist/assets/models/furniture/cactus_small_B.gltf +136 -0
  274. package/town-frontend/dist/assets/models/furniture/chair_A.bin +0 -0
  275. package/town-frontend/dist/assets/models/furniture/chair_A.gltf +136 -0
  276. package/town-frontend/dist/assets/models/furniture/chair_A_wood.bin +0 -0
  277. package/town-frontend/dist/assets/models/furniture/chair_A_wood.gltf +136 -0
  278. package/town-frontend/dist/assets/models/furniture/chair_B.bin +0 -0
  279. package/town-frontend/dist/assets/models/furniture/chair_B.gltf +136 -0
  280. package/town-frontend/dist/assets/models/furniture/chair_B_wood.bin +0 -0
  281. package/town-frontend/dist/assets/models/furniture/chair_B_wood.gltf +136 -0
  282. package/town-frontend/dist/assets/models/furniture/chair_C.bin +0 -0
  283. package/town-frontend/dist/assets/models/furniture/chair_C.gltf +136 -0
  284. package/town-frontend/dist/assets/models/furniture/chair_stool.bin +0 -0
  285. package/town-frontend/dist/assets/models/furniture/chair_stool.gltf +136 -0
  286. package/town-frontend/dist/assets/models/furniture/chair_stool_wood.bin +0 -0
  287. package/town-frontend/dist/assets/models/furniture/chair_stool_wood.gltf +136 -0
  288. package/town-frontend/dist/assets/models/furniture/couch.bin +0 -0
  289. package/town-frontend/dist/assets/models/furniture/couch.gltf +136 -0
  290. package/town-frontend/dist/assets/models/furniture/couch_pillows.bin +0 -0
  291. package/town-frontend/dist/assets/models/furniture/couch_pillows.gltf +136 -0
  292. package/town-frontend/dist/assets/models/furniture/furniturebits_texture.png +0 -0
  293. package/town-frontend/dist/assets/models/furniture/lamp_standing.bin +0 -0
  294. package/town-frontend/dist/assets/models/furniture/lamp_standing.gltf +136 -0
  295. package/town-frontend/dist/assets/models/furniture/lamp_table.bin +0 -0
  296. package/town-frontend/dist/assets/models/furniture/lamp_table.gltf +136 -0
  297. package/town-frontend/dist/assets/models/furniture/pictureframe_large_A.bin +0 -0
  298. package/town-frontend/dist/assets/models/furniture/pictureframe_large_A.gltf +136 -0
  299. package/town-frontend/dist/assets/models/furniture/pictureframe_large_B.bin +0 -0
  300. package/town-frontend/dist/assets/models/furniture/pictureframe_large_B.gltf +136 -0
  301. package/town-frontend/dist/assets/models/furniture/pictureframe_medium.bin +0 -0
  302. package/town-frontend/dist/assets/models/furniture/pictureframe_medium.gltf +136 -0
  303. package/town-frontend/dist/assets/models/furniture/pictureframe_small_A.bin +0 -0
  304. package/town-frontend/dist/assets/models/furniture/pictureframe_small_A.gltf +136 -0
  305. package/town-frontend/dist/assets/models/furniture/pictureframe_small_B.bin +0 -0
  306. package/town-frontend/dist/assets/models/furniture/pictureframe_small_B.gltf +136 -0
  307. package/town-frontend/dist/assets/models/furniture/pictureframe_small_C.bin +0 -0
  308. package/town-frontend/dist/assets/models/furniture/pictureframe_small_C.gltf +136 -0
  309. package/town-frontend/dist/assets/models/furniture/pictureframe_standing_A.bin +0 -0
  310. package/town-frontend/dist/assets/models/furniture/pictureframe_standing_A.gltf +136 -0
  311. package/town-frontend/dist/assets/models/furniture/pictureframe_standing_B.bin +0 -0
  312. package/town-frontend/dist/assets/models/furniture/pictureframe_standing_B.gltf +136 -0
  313. package/town-frontend/dist/assets/models/furniture/pillow_A.bin +0 -0
  314. package/town-frontend/dist/assets/models/furniture/pillow_A.gltf +136 -0
  315. package/town-frontend/dist/assets/models/furniture/pillow_B.bin +0 -0
  316. package/town-frontend/dist/assets/models/furniture/pillow_B.gltf +136 -0
  317. package/town-frontend/dist/assets/models/furniture/rug_oval_A.bin +0 -0
  318. package/town-frontend/dist/assets/models/furniture/rug_oval_A.gltf +136 -0
  319. package/town-frontend/dist/assets/models/furniture/rug_oval_B.bin +0 -0
  320. package/town-frontend/dist/assets/models/furniture/rug_oval_B.gltf +136 -0
  321. package/town-frontend/dist/assets/models/furniture/rug_rectangle_A.bin +0 -0
  322. package/town-frontend/dist/assets/models/furniture/rug_rectangle_A.gltf +136 -0
  323. package/town-frontend/dist/assets/models/furniture/rug_rectangle_B.bin +0 -0
  324. package/town-frontend/dist/assets/models/furniture/rug_rectangle_B.gltf +136 -0
  325. package/town-frontend/dist/assets/models/furniture/rug_rectangle_stripes_A.bin +0 -0
  326. package/town-frontend/dist/assets/models/furniture/rug_rectangle_stripes_A.gltf +136 -0
  327. package/town-frontend/dist/assets/models/furniture/rug_rectangle_stripes_B.bin +0 -0
  328. package/town-frontend/dist/assets/models/furniture/rug_rectangle_stripes_B.gltf +136 -0
  329. package/town-frontend/dist/assets/models/furniture/shelf_A_big.bin +0 -0
  330. package/town-frontend/dist/assets/models/furniture/shelf_A_big.gltf +136 -0
  331. package/town-frontend/dist/assets/models/furniture/shelf_A_small.bin +0 -0
  332. package/town-frontend/dist/assets/models/furniture/shelf_A_small.gltf +136 -0
  333. package/town-frontend/dist/assets/models/furniture/shelf_B_large.bin +0 -0
  334. package/town-frontend/dist/assets/models/furniture/shelf_B_large.gltf +136 -0
  335. package/town-frontend/dist/assets/models/furniture/shelf_B_large_decorated.bin +0 -0
  336. package/town-frontend/dist/assets/models/furniture/shelf_B_large_decorated.gltf +136 -0
  337. package/town-frontend/dist/assets/models/furniture/shelf_B_small.bin +0 -0
  338. package/town-frontend/dist/assets/models/furniture/shelf_B_small.gltf +136 -0
  339. package/town-frontend/dist/assets/models/furniture/shelf_B_small_decorated.bin +0 -0
  340. package/town-frontend/dist/assets/models/furniture/shelf_B_small_decorated.gltf +136 -0
  341. package/town-frontend/dist/assets/models/furniture/table_low.bin +0 -0
  342. package/town-frontend/dist/assets/models/furniture/table_low.gltf +136 -0
  343. package/town-frontend/dist/assets/models/furniture/table_medium.bin +0 -0
  344. package/town-frontend/dist/assets/models/furniture/table_medium.gltf +136 -0
  345. package/town-frontend/dist/assets/models/furniture/table_medium_long.bin +0 -0
  346. package/town-frontend/dist/assets/models/furniture/table_medium_long.gltf +136 -0
  347. package/town-frontend/dist/assets/models/furniture/table_small.bin +0 -0
  348. package/town-frontend/dist/assets/models/furniture/table_small.gltf +136 -0
  349. package/town-frontend/dist/assets/models/props/bench.bin +0 -0
  350. package/town-frontend/dist/assets/models/props/bench.gltf +136 -0
  351. package/town-frontend/dist/assets/models/props/bush.bin +0 -0
  352. package/town-frontend/dist/assets/models/props/bush.gltf +136 -0
  353. package/town-frontend/dist/assets/models/props/capybara.glb +0 -0
  354. package/town-frontend/dist/assets/models/props/car_hatchback.bin +0 -0
  355. package/town-frontend/dist/assets/models/props/car_hatchback.gltf +442 -0
  356. package/town-frontend/dist/assets/models/props/car_sedan.bin +0 -0
  357. package/town-frontend/dist/assets/models/props/car_sedan.gltf +442 -0
  358. package/town-frontend/dist/assets/models/props/car_taxi.bin +0 -0
  359. package/town-frontend/dist/assets/models/props/car_taxi.gltf +442 -0
  360. package/town-frontend/dist/assets/models/props/citybits_texture.png +0 -0
  361. package/town-frontend/dist/assets/models/props/dumpster.bin +0 -0
  362. package/town-frontend/dist/assets/models/props/dumpster.gltf +136 -0
  363. package/town-frontend/dist/assets/models/props/firehydrant.bin +0 -0
  364. package/town-frontend/dist/assets/models/props/firehydrant.gltf +136 -0
  365. package/town-frontend/dist/assets/models/props/streetlight.bin +0 -0
  366. package/town-frontend/dist/assets/models/props/streetlight.gltf +136 -0
  367. package/town-frontend/dist/assets/models/props/trafficlight_A.bin +0 -0
  368. package/town-frontend/dist/assets/models/props/trafficlight_A.gltf +136 -0
  369. package/town-frontend/dist/assets/models/props/trash_A.bin +0 -0
  370. package/town-frontend/dist/assets/models/props/trash_A.gltf +136 -0
  371. package/town-frontend/dist/assets/models/props/watertower.bin +0 -0
  372. package/town-frontend/dist/assets/models/props/watertower.gltf +136 -0
  373. package/town-frontend/dist/assets/models/stage-deco/Flowers_1_D.glb +0 -0
  374. package/town-frontend/dist/assets/models/stage-deco/Flowers_2_B.glb +0 -0
  375. package/town-frontend/dist/assets/models/stage-deco/Grass_A_1.glb +0 -0
  376. package/town-frontend/dist/assets/models/stage-deco/Park_GrassHill_A.glb +0 -0
  377. package/town-frontend/dist/assets/models/stage-deco/Pebles_1_A_2.glb +0 -0
  378. package/town-frontend/dist/assets/music/bgm_day.mp3 +0 -0
  379. package/town-frontend/dist/assets/music/bgm_dusk.mp3 +0 -0
  380. package/town-frontend/dist/assets/music/bgm_night.mp3 +0 -0
  381. package/town-frontend/dist/assets/music/bgm_work.mp3 +0 -0
  382. package/town-frontend/dist/assets/office-whiteboard-idle-CyEwBrq_.webp +0 -0
  383. package/town-frontend/dist/assets/preview-B6hYEQij.js +2 -0
  384. package/town-frontend/dist/assets/town-BKesnERP.js +8888 -0
  385. package/town-frontend/dist/assets/town-BnswKsjF.css +1 -0
  386. package/town-frontend/dist/citizen-editor.html +166 -0
  387. package/town-frontend/dist/editor.html +227 -0
  388. package/town-frontend/dist/index.html +22 -0
  389. package/town-frontend/dist/preview.html +56 -0
  390. package/town-frontend/dist/town.html +165 -0
  391. package/town-frontend/dist/viewer.html +91 -0
  392. package/town-souls/CHEN.md +130 -0
  393. package/town-souls/CHENGZI.md +92 -0
  394. package/town-souls/CITIZEN_tpl.md +16 -0
  395. package/town-souls/DIANDIAN.md +92 -0
  396. package/town-souls/HAITANG.md +94 -0
  397. package/town-souls/QIQI.md +119 -0
  398. package/town-souls/SOUL.md +141 -0
  399. package/town-souls/SOUL_tpl.md +135 -0
  400. package/town-souls/XIAOLIE.md +107 -0
  401. package/town-souls/YAN.md +107 -0
  402. package/town-workspace/IDENTITY.md +5 -0
  403. package/town-workspace/SOUL.md +141 -0
  404. package/town-workspace/project-workflow.md +81 -0
  405. package/town-workspace/town-defaults.json +92 -0
  406. package/town-workspace/town-guide.md +45 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,36 @@
1
+ # Changelog
2
+
3
+ ## 2026.4.12
4
+
5
+ ### New Features
6
+ - **QClaw compatibility**: Auto-detects state directory (`~/.qclaw/` or `~/.openclaw/`), works seamlessly on both OpenClaw CLI and QClaw desktop
7
+ - **Bilingual UI**: Full Chinese and English interface with auto-detection and manual language switch via Settings panel
8
+ - **Topic discussions**: Start multi-citizen group discussions with structured turn-taking and AI-moderated dialogue
9
+ - **Dynamic model display**: Shows actual model name from runtime config instead of hardcoded value
10
+
11
+ ### Bug Fixes
12
+ - **Agent routing**: Messages now correctly route to `town-steward` via explicit SessionKey format, regardless of `agents.list` order
13
+ - **Session history**: Fixed variable shadowing that silently broke chat history loading
14
+ - **Hardcoded paths**: All `~/.openclaw/` references replaced with centralized `stateDir()` resolution
15
+ - **Archived sessions**: Fixed path construction in `listArchivedSessions` that referenced a function instead of a string
16
+
17
+ ### Documentation
18
+ - Updated README (EN + CN) with QClaw install guide, compatibility table, and new features
19
+ - Updated ROADMAP with QClaw compatibility milestones
20
+ - Added GitHub issue/PR templates
21
+
22
+ ## 2026.4.6 — Initial Release
23
+
24
+ First public release of Agentshire.
25
+
26
+ - 3D low-poly town with day/night cycle, 12 weather types, procedural ambient sound, and 4-track dynamic BGM
27
+ - Agent = NPC mapping with cinematic workflow (summon → assign → code → celebrate → return)
28
+ - Dual-mode UI: 3D Town + IM Chat with agent list and multimodal support
29
+ - Citizen Workshop: create characters with 3D models, AI-generated soul files, and animation mapping
30
+ - Town Editor: visual drag-and-drop map editing with grouping, alignment, undo, and preview
31
+ - Soul system: Markdown personality files with multi-level search and fuzzy matching
32
+ - NPC daily behavior (algorithm-driven + optional Soul Mode with AI brain)
33
+ - Zero-LLM casual encounters with 400+ preset dialogue lines
34
+ - Banwei Buster mini-game
35
+ - Zero configuration: auto-creates steward agent and routing on first startup
36
+ - 11 AI tools for town control and multi-agent project orchestration
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Agentshire Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,437 @@
1
+ # Agentshire
2
+
3
+ English | [中文](README.zh-CN.md)
4
+
5
+ > **Agentshire — Let your OpenClaw/QClaw agents live in a game town you built yourself, not a ChatBox.**
6
+
7
+ Agentshire is an OpenClaw/QClaw plugin that turns AI agents into living NPCs inside a 3D town you can watch, chat with, and shape yourself. It combines a living simulation layer with UGC tools: weather, day/night cycles, social NPCs, a map editor, and a character workshop.
8
+
9
+ **Works with both OpenClaw CLI and [QClaw](https://qclaw.cn) desktop app.**
10
+
11
+ **[Vision](VISION.md)** | **[Roadmap](ROADMAP.md)**
12
+
13
+ > **Compatibility**
14
+ >
15
+ > | Platform | Version | Status |
16
+ > |---|---|---|
17
+ > | **OpenClaw CLI** | 2026.3.13 | ✅ Recommended |
18
+ > | **QClaw Desktop** | 0.2.x | ✅ Supported |
19
+ > | OpenClaw CLI | 2026.3.7 – 3.12 | ⚠️ May work |
20
+ > | OpenClaw CLI | 2026.4.x+ | ❌ Not yet — channel init regression |
21
+ >
22
+ > See [Troubleshooting](#troubleshooting) for version-specific issues.
23
+
24
+ ---
25
+
26
+ ## See It in Action
27
+
28
+ > **📺 [Watch the full demo on YouTube](https://www.youtube.com/watch?v=R6YXvkkwo9I)**
29
+
30
+ **A town, not a dashboard.**
31
+
32
+ https://github.com/user-attachments/assets/c888d2ef-dcba-4caa-b0af-9b5f3e3b1365
33
+
34
+ **Build your characters — pick a model, give them a soul, watch them come alive.**
35
+
36
+ https://github.com/user-attachments/assets/b9697432-b3ba-4e23-85fe-4c0b5c35a1b9
37
+
38
+ **Build your town — drag, drop, preview.**
39
+
40
+ https://github.com/user-attachments/assets/3328aa6c-3432-4f71-abfd-91aea4db15df
41
+
42
+ **Every citizen has a mind of their own.**
43
+
44
+ https://github.com/user-attachments/assets/720a63fc-863c-483c-bfdf-5e07e82c6f0e
45
+
46
+ **Give them a mission. Watch them rally.**
47
+
48
+ https://github.com/user-attachments/assets/1983f60b-aaf6-4adc-b46c-5612e4ba4c83
49
+
50
+ **Work too long? Banwei Boss appears. Pop it.**
51
+
52
+ https://github.com/user-attachments/assets/9be946e0-9ecf-42de-b793-a5d7ebe55612
53
+
54
+ **Mission complete. Fireworks. Playable game delivered.**
55
+
56
+ https://github.com/user-attachments/assets/fa6563ae-e78b-49b1-ae7b-8a8a96738341
57
+
58
+ ---
59
+
60
+ ## Features
61
+
62
+ ### Dual-Mode Interface
63
+
64
+ - **Town Mode** — Low-poly 3D town where you watch NPCs live, work, collaborate, and celebrate in real time
65
+ - **Chat Mode** — IM-style chat interface with an agent list (steward + citizens, online status), message history, multimodal support (text/image), and commands (`/new` `/help` `/stop`)
66
+ - **Top Navigation** — One-click switch between Town and Chat, with a quick menu (Citizen Workshop / Town Editor / Skill Store / Settings)
67
+ - **Bilingual UI** — Full Chinese and English interface, auto-detected or manually switchable
68
+
69
+ ### Core
70
+
71
+ - **Agent = NPC** — Every sub-agent automatically becomes a 3D citizen with a name, appearance, and personality
72
+ - **Cinematic Workflow** — Summon → Rally → Assign → Enter Office → Code → Celebrate → Return to Town, fully choreographed with animations
73
+ - **Real-Time Dialog Bubbles** — AI responses appear above NPC heads with a typewriter effect, streaming updates, and pagination
74
+ - **Multi-Agent Collaboration** — The steward automatically decomposes tasks into parallel steps with file boundary validation
75
+ - **Zero Configuration** — Install the plugin, start the Gateway, and the town runs automatically
76
+
77
+ ### Town Life
78
+
79
+ - **Day/Night Cycle** — 24-hour clock (6 periods), real-time lighting changes, automatic street/window lights
80
+ - **12 Weather Types** — Clear / cloudy / fog / drizzle / rain / storm / snow / blizzard / sandstorm / aurora… daily random theme with smooth transitions
81
+ - **Procedural Ambient Sound** — Rain, wind, birdsong, crickets, traffic, thunder — all synthesized in real time via Web Audio API, zero audio files
82
+ - **4-Track BGM** — Day / dusk / night / work tracks, auto-switching by weather, time period, and scene with 3.5s crossfade
83
+ - **NPC Daily Behavior (Dual Mode)** — Algorithm-driven by default: state machine + 5 behavior templates + 400+ preset dialog lines, zero LLM cost. Enable Soul Mode to switch to AI-driven: AgentBrain 3-tier decisions (L1 daily plan / L2 tactical / L3 dialogue) + deep multi-turn LLM conversations + relationship graph + daily narrative summaries
84
+ - **Citizen Chat** — Click any citizen NPC to start a conversation, routed to that citizen's independent Agent session
85
+ - **Topic Discussion** — Start a group discussion with multiple citizens on a topic, with structured turn-taking and AI-moderated dialogue
86
+ - **Banwei Buster Mini-Game** — NPCs generate "banwei orbs" while working; click to pop them! Includes combo system, boss battles, and NPC stress mechanics
87
+
88
+ ### UGC Tools
89
+
90
+ - **Citizen Workshop** — Create and configure citizen characters: select/upload 3D models, edit soul personality (AI generation supported), configure animation mapping (8 slots), publish as independent Agents
91
+ - **Town Editor** — Visual drag-and-drop map editing: place buildings/roads/props/lights, with grouping, alignment, undo, and JSON export (runtime integration in progress)
92
+ - **Editor Preview** — One-click game-level preview window (WASD controls + full day/night + weather + vehicle animations + audio)
93
+ - **Soul System** — Each NPC has a Markdown personality file defining character traits, speaking style, expertise, and work approach
94
+
95
+ ### Interaction & Visuals
96
+
97
+ - **Interactive 3D** — Click NPCs to view status cards (avatar / persona / work logs / thinking stream / TODO), drag to pan, scroll to zoom
98
+ - **3 Scene Types** — Town (daily life) / Office (work) / Showroom (in development), with fade transitions and NPC migration
99
+ - **Rich VFX** — Summon shockwave, completion fireworks, error lightning, persona-transform magic circle, thinking halo, search radar, confetti…
100
+ - **10-Workstation Office** — Each workstation has its own monitor (real-time code animation), full NPC enter/work/leave choreography
101
+ - **Deliverable Preview** — After project completion, deliverable cards pop up with image lightbox, video, audio preview and download; games/websites launch directly in iframe
102
+ - **AI Tool Control** — Agents can control the town via tools (broadcast messages, spawn NPCs, trigger effects, set time/weather)
103
+ - **Reconnection** — WebSocket auto-reconnect with exponential backoff and work state recovery
104
+
105
+ ---
106
+
107
+ ## Requirements
108
+
109
+ - [OpenClaw](https://github.com/openclaw/openclaw) **2026.3.13** (recommended)
110
+ - Node.js >= 18
111
+
112
+ ---
113
+
114
+ ## Quick Install
115
+
116
+ ```bash
117
+ openclaw plugins install agentshire
118
+ ```
119
+
120
+ That's it. Restart the Gateway and the town opens automatically.
121
+
122
+ ### Alternative: Link Install (for development)
123
+
124
+ ```bash
125
+ git clone https://github.com/Agentshire/Agentshire.git
126
+ cd Agentshire && npm install
127
+ openclaw plugins install --link .
128
+ ```
129
+
130
+ > The frontend comes **pre-built** (`town-frontend/dist/`). No build step needed. Developers can rebuild with `npm run build:town`.
131
+
132
+ ### What the plugin auto-configures on first start
133
+
134
+ 1. Creates the steward workspace (`workspace-town-steward/` in your state directory)
135
+ 2. Registers the `town-steward` Agent in `openclaw.json`
136
+ 3. Adds a routing rule to direct town channel messages to the steward
137
+ 4. Sets `subagents.runTimeoutSeconds: 600` — 10-minute timeout to prevent premature subagent termination
138
+
139
+ > The state directory is auto-detected: `~/.openclaw/` for OpenClaw CLI, `~/.qclaw/` for QClaw.
140
+
141
+ > **Important**: Do **not** add a `tools` section to `openclaw.json`. The plugin registers its own tools via `api.registerTool()`. A manual `tools.allow` list will override plugin-registered tools, making them invisible to the agent.
142
+
143
+ ### Update
144
+
145
+ ```bash
146
+ openclaw plugins install agentshire
147
+ ```
148
+
149
+ Or for link installs: `cd Agentshire && git pull && npm install`.
150
+
151
+ Then restart the Gateway (or restart QClaw).
152
+
153
+ ---
154
+
155
+ ## Usage
156
+
157
+ 1. Complete the [Quick Install](#quick-install) steps
158
+ 2. Start (or restart) the OpenClaw Gateway:
159
+ ```bash
160
+ openclaw gateway
161
+ ```
162
+ 3. The town opens automatically in your browser
163
+ 4. Chat in the browser — all Agent activity is automatically mapped to the town
164
+
165
+ > **Tip**: If the browser didn't open automatically, visit:
166
+ > `http://localhost:55210?ws=ws://localhost:55211`
167
+
168
+
169
+ ### Citizen Workshop
170
+
171
+ Visit `http://localhost:55210/citizen-editor.html` to create and configure your NPC team.
172
+
173
+
174
+ ### Town Editor
175
+
176
+ Visit `http://localhost:55210/editor.html` to open the visual map editor.
177
+
178
+
179
+ ### Configuration (Optional)
180
+
181
+ Customize ports and behavior in your `openclaw.json` (`~/.openclaw/openclaw.json` for OpenClaw CLI, `~/.qclaw/openclaw.json` for QClaw):
182
+
183
+ ```json
184
+ {
185
+ "plugins": {
186
+ "entries": {
187
+ "agentshire": {
188
+ "enabled": true,
189
+ "config": {
190
+ "wsPort": 55211,
191
+ "townPort": 55210,
192
+ "autoLaunch": true
193
+ }
194
+ }
195
+ }
196
+ }
197
+ }
198
+ ```
199
+
200
+ | Option | Default | Description |
201
+ |--------|---------|-------------|
202
+ | `wsPort` | 55211 | WebSocket port (real-time plugin ↔ frontend communication) |
203
+ | `townPort` | 55210 | HTTP port (frontend static files + editor API) |
204
+ | `autoLaunch` | true | Auto-open town in browser on startup |
205
+
206
+ ### AI Tools
207
+
208
+ | Tool | Description |
209
+ |------|-------------|
210
+ | `town_announce` | Broadcast a message in the town |
211
+ | `town_spawn_npc` | Spawn a new NPC |
212
+ | `town_effect` | Trigger visual effects (celebration / fireworks / glow, etc.) |
213
+ | `town_set_time` | Control the game clock |
214
+ | `town_set_weather` | Control weather (12 types available) |
215
+ | `town_status` | View current town status |
216
+ | `register_project` | Register a simple project (single-agent or steward-only) |
217
+ | `create_project` | Create a project directory for multi-agent work |
218
+ | `create_task` | Create a task directory for single-agent delegation |
219
+ | `create_plan` | Create a collaboration plan (parallel steps, requires `create_project` or `create_task` first) |
220
+ | `next_step` | Query plan progress and get next step instructions |
221
+ | `mission_complete` | Unified completion handler — auto-routes to celebration or partial delivery based on remaining work |
222
+
223
+ ---
224
+
225
+ ## Soul System
226
+
227
+ Every NPC has an independent **soul file** (Markdown) that defines personality, speaking style, expertise, and work approach.
228
+
229
+ Format: a Markdown file starting with `# Character Name`, optionally containing metadata (model ID, gender, role), core persona, detailed personality settings, and dialog examples. The content is injected as the Agent's system prompt.
230
+
231
+ **Search priority** (later overrides earlier):
232
+
233
+ 1. `plugin-builtin/town-souls/` — Preset souls (8 citizens + steward)
234
+ 2. `cwd/town-souls/` — Project-level souls
235
+ 3. `{stateDir}/town-souls/` — User custom souls (`~/.openclaw/` or `~/.qclaw/`)
236
+ 4. `town-data/souls/` — Souls published from Citizen Workshop
237
+
238
+ You can:
239
+ - **AI-generate** soul files in the Citizen Workshop
240
+ - Modify built-in soul files to adjust personalities
241
+ - Place custom souls in your state directory's `town-souls/` folder to override presets
242
+ - Create entirely new soul files for new characters
243
+
244
+ ---
245
+
246
+ ## Architecture
247
+
248
+ ```
249
+ ┌──────────────────────────────────────────────────────────┐
250
+ │ OpenClaw Runtime │
251
+ │ │
252
+ │ Gateway ─── Agent Sessions ─── Hook System ─── LLM │
253
+ └──────┬────────────────────────────┬──────────────────────┘
254
+ │ dispatch │ hook callback
255
+ ▼ ▼
256
+ ┌──────────────────────────────────────────────────────────┐
257
+ │ Plugin Layer (Node.js) src/plugin/ │
258
+ │ │
259
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
260
+ │ │ channel │ │ hook- │ │ws-server │ │ tools │ │
261
+ │ │ dispatch │ │translator│ │ WS:55211 │ │ 11 tools │ │
262
+ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
263
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
264
+ │ │ plan- │ │ editor- │ │ citizen- │ │llm-proxy │ │
265
+ │ │ manager │ │ serve │ │ router │ │ 2 concur │ │
266
+ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
267
+ └──────┬───────────────┬───────────────────────────────────┘
268
+ │ WS :55211 │ HTTP :55210
269
+ │ AgentEvent │ Editor API
270
+ ▼ ▼
271
+ ┌──────────────────────────────────────────────────────────┐
272
+ │ Bridge Layer (Browser) src/bridge/ │
273
+ │ │
274
+ │ ┌────────────────────────────────────────────────────┐ │
275
+ │ │ DirectorBridge — Phase State Machine │ │
276
+ │ │ idle→summoning→assigning→office→working→publish→ret│ │
277
+ │ └────────────────────────────────────────────────────┘ │
278
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
279
+ │ │ Event- │ │ Route- │ │ Citizen- │ │implicit- │ │
280
+ │ │Transltor │ │ Manager │ │ Manager │ │ chat │ │
281
+ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
282
+ └──────┬────────────────────────────────────────────┬──────┘
283
+ │ GameEvent (65) GameAction │
284
+ ▼ (14) ▲
285
+ ┌──────────────────────────────────────────────────────────┐
286
+ │ Frontend Layer (Three.js) town-frontend/src/ │
287
+ │ │
288
+ │ ┌────────────────────────────────────────────────────┐ │
289
+ │ │ MainScene ── EventDispatcher ── update() loop │ │
290
+ │ └────────────────────────────────────────────────────┘ │
291
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
292
+ │ │workflow/ │ │ npc/ │ │ ui/ │ │ audio/ │ │
293
+ │ │Choreogr │ │ NPC 7-SM │ │ChatBubbl │ │ BGM+Amb │ │
294
+ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
295
+ │ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
296
+ │ │ scene/ │ │ editor/ │ │ engine/ │ │ data/ │ │
297
+ │ │Town/Offc │ │Workshop │ │ Render │ │ Protocol │ │
298
+ │ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
299
+ └──────────────────────────────────────────────────────────┘
300
+ ```
301
+
302
+ > Developer architecture guide: [AGENTS.md](AGENTS.md)
303
+
304
+ ---
305
+
306
+ ## Development
307
+
308
+ ```bash
309
+ # After cloning
310
+ cd agentshire
311
+
312
+ # Build the town frontend
313
+ cd town-frontend && npm install && npm run build
314
+
315
+ # Dev mode (hot reload)
316
+ cd town-frontend && npm run dev
317
+
318
+ # Run tests
319
+ npm test # Plugin + bridge layer
320
+ cd town-frontend && npx vitest run # Frontend
321
+ ```
322
+
323
+ The frontend has 4 entry pages:
324
+
325
+ | Page | URL | Description |
326
+ |------|-----|-------------|
327
+ | Town | `index.html` | 3D town + chat |
328
+ | Town Editor | `editor.html` | Visual map editing |
329
+ | Citizen Workshop | `citizen-editor.html` | Character creation and configuration |
330
+ | Editor Preview | `preview.html` | Game-level preview window |
331
+
332
+ > Developer architecture guide: [AGENTS.md](AGENTS.md)
333
+
334
+ ---
335
+
336
+ ## Asset Pack (Optional)
337
+
338
+ Basic features **require no extra downloads** — built-in models (KayKit + Kenney) for the town, office, and NPCs are included in the repository.
339
+
340
+ For advanced features, download the optional asset pack:
341
+
342
+ - **Citizen Workshop Library Characters** (308 character models with multiple variants and colors)
343
+ - **Editor Cartoon City Assets** (hundreds of building, vehicle, road, and park models)
344
+
345
+ ### Download
346
+
347
+ 1. Download `agentshire-assets.7z` from [GitHub Releases (v0.1.0)](https://github.com/Agentshire/Agentshire/releases/tag/v0.1.0) (~164MB, expands to ~4.4GB)
348
+ 2. Extract to the plugin root:
349
+ ```bash
350
+ cd /path/to/agentshire
351
+ 7z x agentshire-assets.7z
352
+ ```
353
+ 3. Verify the directory structure:
354
+
355
+ ```
356
+ agentshire/
357
+ ├── assets/
358
+ │ ├── Characters_1/ ← Library character models + shared animations
359
+ │ └── Map_1/ ← Cartoon City editor assets
360
+ ├── src/
361
+ ├── town-frontend/
362
+ └── ...
363
+ ```
364
+
365
+ Without the asset pack: the game runs normally, editor has basic assets, and the Citizen Workshop shows only built-in and custom models.
366
+
367
+ > Asset sources and licenses: [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)
368
+
369
+ ---
370
+
371
+ ## Troubleshooting
372
+
373
+ ### Plugin tools not recognized by the agent
374
+
375
+ **Symptom**: Steward agent cannot find `create_project`, `create_plan`, or other plugin tools.
376
+
377
+ **Cause**: On OpenClaw 2026.3.13, Rollup code-splitting can create separate module instances, causing `api.registerTool()` registrations to be invisible to the agent runtime. Additionally, a manual `tools` section in `openclaw.json` overrides plugin-registered tools.
378
+
379
+ **Fix**:
380
+ 1. Remove the entire `tools` section from your `openclaw.json` if present
381
+ 2. Restart the Gateway
382
+
383
+ ### QClaw: Plugin still runs old code after restart
384
+
385
+ **Cause**: Closing the QClaw window does not stop the background `openclaw-gateway` process.
386
+
387
+ **Fix**: Kill the gateway process before restarting QClaw: `ps aux | grep openclaw-gateway | grep -v grep | awk '{print $2}' | xargs kill`
388
+
389
+ ### Channel does not start on OpenClaw 2026.4.x
390
+
391
+ **Symptom**: Plugin loads successfully but no WebSocket connection is established; the town page shows "connecting…" indefinitely.
392
+
393
+ **Cause**: OpenClaw 2026.4.x introduced a regression in external plugin channel initialization. The `defineChannelPluginEntry` lifecycle is not correctly invoked.
394
+
395
+ **Fix**: Downgrade to OpenClaw 2026.3.13. This is a known upstream issue.
396
+
397
+ ### Citizen Workshop "AI Generate" returns error 500
398
+
399
+ **Symptom**: Clicking "AI 生成" in the Citizen Workshop fails.
400
+
401
+ **Cause**: The soul generation endpoint requires a working LLM provider configured in `openclaw.json`. If no provider is configured or the API key is invalid, the request fails.
402
+
403
+ **Fix**: Ensure you have a valid `models` section in `~/.openclaw/openclaw.json`. Refer to [OpenClaw documentation](https://github.com/openclaw/openclaw) for LLM provider configuration.
404
+
405
+ ---
406
+
407
+ ## Why "Agentshire"?
408
+
409
+ The name comes from the Shire in *The Lord of the Rings* — not the epic battles, but the quiet, gentle, unhurried life that makes the Shire feel like home. That's the kind of world we want to build for AI agents.
410
+
411
+ Many AI products imagine a cyberpunk, high-pressure, hyper-accelerated future. Agents live in dashboards, logs, and APIs — but never in a place that feels like somewhere they actually *live*.
412
+
413
+ We imagine a different future. A quieter one. A gentler interface. A place where intelligent agents aren't just invoked, driven, and consumed — but can truly settle down.
414
+
415
+ **If AI agents are going to be part of our lives, they deserve a place that feels like home.**
416
+
417
+ ---
418
+
419
+ ## Vision & Roadmap
420
+
421
+ > Teams don't live in dashboards. Teams live in a town.
422
+ > When islands connect, towns grow into a world.
423
+
424
+ | Phase | Direction | Status |
425
+ |-------|-----------|--------|
426
+ | **A Town** | 3D visualization, workflow orchestration, soul system, citizen workshop, dual-mode UI | ✅ Implemented |
427
+ | **A Stable Town** | QClaw + OpenClaw compatibility, bilingual i18n, topic discussions, npm publish | 🔥 Current Focus |
428
+ | **A Living Town** | Editor ↔ runtime integration, life simulation (clothing/food/shelter/travel/play), growth systems, mobile | 📋 Next |
429
+ | **A World** | Town federation protocol, cross-town NPC visits, skill exchange, world events | 🌍 Long-term |
430
+
431
+ See **[VISION.md](VISION.md)** and **[ROADMAP.md](ROADMAP.md)** for details.
432
+
433
+ ---
434
+
435
+ ## License
436
+
437
+ MIT