agentshire 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/LICENSE +21 -0
- package/README.md +437 -0
- package/README.zh-CN.md +441 -0
- package/ROADMAP.md +207 -0
- package/THIRD_PARTY_NOTICES.md +49 -0
- package/VISION.md +101 -0
- package/index.ts +386 -0
- package/openclaw.plugin.json +27 -0
- package/package.json +100 -0
- package/src/bridge/AGENTS.md +136 -0
- package/src/bridge/ActivityStream.ts +184 -0
- package/src/bridge/CitizenManager.ts +280 -0
- package/src/bridge/DirectorBridge.ts +1076 -0
- package/src/bridge/EventTranslator.ts +142 -0
- package/src/bridge/NpcEventQueue.ts +61 -0
- package/src/bridge/ReconnectManager.ts +42 -0
- package/src/bridge/RouteManager.ts +270 -0
- package/src/bridge/StateTracker.ts +100 -0
- package/src/bridge/ToolVfxMapper.ts +94 -0
- package/src/bridge/__tests__/ActivityStream.test.ts +156 -0
- package/src/bridge/__tests__/CitizenManager.test.ts +174 -0
- package/src/bridge/__tests__/EventTranslator.test.ts +292 -0
- package/src/bridge/__tests__/NpcEventQueue.test.ts +92 -0
- package/src/bridge/__tests__/RouteManager.test.ts +106 -0
- package/src/bridge/data/route-config.json +36 -0
- package/src/bridge/data/route-config.ts +19 -0
- package/src/bridge/implicit-chat.ts +192 -0
- package/src/bridge/index.ts +12 -0
- package/src/contracts/agent-state.ts +87 -0
- package/src/contracts/agui.ts +212 -0
- package/src/contracts/chat.ts +67 -0
- package/src/contracts/events.ts +170 -0
- package/src/contracts/index.ts +71 -0
- package/src/contracts/media.ts +77 -0
- package/src/contracts/registry.ts +32 -0
- package/src/plugin/AGENTS.md +192 -0
- package/src/plugin/__tests__/editor-serve-megapack.test.ts +150 -0
- package/src/plugin/__tests__/hook-translator.test.ts +197 -0
- package/src/plugin/auto-config.ts +131 -0
- package/src/plugin/channel.ts +399 -0
- package/src/plugin/chat-asset-resolver.ts +75 -0
- package/src/plugin/chat-session-watcher.ts +98 -0
- package/src/plugin/citizen-agent-manager.ts +178 -0
- package/src/plugin/citizen-chat-router.ts +83 -0
- package/src/plugin/citizen-workshop-manager.ts +96 -0
- package/src/plugin/custom-asset-manager.ts +250 -0
- package/src/plugin/editor-serve.ts +1368 -0
- package/src/plugin/group-discussion.ts +223 -0
- package/src/plugin/hook-translator.ts +202 -0
- package/src/plugin/llm-agent-proxy.ts +193 -0
- package/src/plugin/outbound-adapter.ts +187 -0
- package/src/plugin/paths.ts +33 -0
- package/src/plugin/plan-manager.ts +594 -0
- package/src/plugin/runtime.ts +9 -0
- package/src/plugin/session-history.ts +838 -0
- package/src/plugin/session-log-watcher.ts +221 -0
- package/src/plugin/soul-prompt-template.ts +290 -0
- package/src/plugin/subagent-tracker.ts +205 -0
- package/src/plugin/tools.ts +493 -0
- package/src/plugin/town-session.ts +40 -0
- package/src/plugin/ws-server.ts +680 -0
- package/src/town-souls.ts +134 -0
- package/town-frontend/dist/assets/CustomAssetStore-oi8aIurt.js +2 -0
- package/town-frontend/dist/assets/GLTFLoader-BA5RqSME.js +3804 -0
- package/town-frontend/dist/assets/OrbitControls-ZmySp9sQ.js +2 -0
- package/town-frontend/dist/assets/SettingsPanel-BO52reJe.js +2 -0
- package/town-frontend/dist/assets/SkeletonUtils-BCVmgslc.js +2 -0
- package/town-frontend/dist/assets/SkillLearnCard-Dk38iDpy.js +6 -0
- package/town-frontend/dist/assets/TopicSetupPanel-DLaLHB_Z.js +2 -0
- package/town-frontend/dist/assets/Trap-Bold-CT0JBE39.woff2 +0 -0
- package/town-frontend/dist/assets/Trap-SemiBold-R4_-Ld0j.woff2 +0 -0
- package/town-frontend/dist/assets/WeatherSystem-Cb3BvHes.js +550 -0
- package/town-frontend/dist/assets/avatars/char-female-a.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-female-b.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-female-c.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-female-d.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-female-e.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-female-f.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-male-a.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-male-b.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-male-c.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-male-d.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-male-e.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-male-f.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-beaver.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-bee.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-bunny.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-cat.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-caterpillar.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-chick.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-cow.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-crab.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-deer.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-dog.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-elephant.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-fish.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-fox.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-giraffe.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-hog.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-koala.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-lion.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-monkey.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-panda.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-parrot.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-penguin.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-pig.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-polar.webp +0 -0
- package/town-frontend/dist/assets/avatars/char-pet-tiger.webp +0 -0
- package/town-frontend/dist/assets/character-catalog-DSmLtlNC.js +2 -0
- package/town-frontend/dist/assets/citizenEditor-DubGSJOQ.js +296 -0
- package/town-frontend/dist/assets/command-parser-BUd15Bmv.js +12 -0
- package/town-frontend/dist/assets/editor-B5QO0OtX.js +258 -0
- package/town-frontend/dist/assets/editor-Bk8g1NCD.css +1 -0
- package/town-frontend/dist/assets/index-BWfrufil.js +2 -0
- package/town-frontend/dist/assets/index-faS20RJk.js +6 -0
- package/town-frontend/dist/assets/logo-DJI6EtST.png +0 -0
- package/town-frontend/dist/assets/logo-title-AdKPZX5E.png +0 -0
- package/town-frontend/dist/assets/main-CqsN43aT.js +224 -0
- package/town-frontend/dist/assets/main-D7neuy3w.css +1 -0
- package/town-frontend/dist/assets/models/buildings/base.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/base.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/bench.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/bench.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/box_A.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/box_A.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/box_B.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/box_B.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_A.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_A.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_A_withoutBase.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_A_withoutBase.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_B.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_B.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_B_withoutBase.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_B_withoutBase.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_C.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_C.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_C_withoutBase.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_C_withoutBase.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_D.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_D.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_D_withoutBase.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_D_withoutBase.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_E.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_E.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_E_withoutBase.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_E_withoutBase.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_F.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_F.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_F_withoutBase.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_F_withoutBase.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_G.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_G.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_G_withoutBase.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_G_withoutBase.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_H.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_H.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/building_H_withoutBase.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/building_H_withoutBase.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/bush.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/bush.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/car_hatchback.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/car_hatchback.gltf +442 -0
- package/town-frontend/dist/assets/models/buildings/car_police.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/car_police.gltf +442 -0
- package/town-frontend/dist/assets/models/buildings/car_sedan.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/car_sedan.gltf +442 -0
- package/town-frontend/dist/assets/models/buildings/car_stationwagon.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/car_stationwagon.gltf +442 -0
- package/town-frontend/dist/assets/models/buildings/car_taxi.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/car_taxi.gltf +442 -0
- package/town-frontend/dist/assets/models/buildings/citybits_texture.png +0 -0
- package/town-frontend/dist/assets/models/buildings/dumpster.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/dumpster.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/firehydrant.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/firehydrant.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/road_corner.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/road_corner.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/road_corner_curved.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/road_corner_curved.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/road_junction.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/road_junction.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/road_straight.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/road_straight.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/road_straight_crossing.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/road_straight_crossing.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/road_tsplit.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/road_tsplit.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/streetlight.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/streetlight.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/trafficlight_A.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/trafficlight_A.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/trafficlight_B.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/trafficlight_B.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/trafficlight_C.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/trafficlight_C.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/trash_A.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/trash_A.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/trash_B.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/trash_B.gltf +136 -0
- package/town-frontend/dist/assets/models/buildings/watertower.bin +0 -0
- package/town-frontend/dist/assets/models/buildings/watertower.gltf +136 -0
- package/town-frontend/dist/assets/models/characters/Textures/colormap.png +0 -0
- package/town-frontend/dist/assets/models/characters/character-female-a.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-female-b.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-female-c.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-female-d.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-female-e.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-female-f.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-male-a.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-male-b.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-male-c.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-male-d.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-male-e.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-male-f.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-beaver.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-bee.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-bunny.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-cat.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-caterpillar.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-chick.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-cow.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-crab.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-deer.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-dog.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-elephant.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-fish.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-fox.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-giraffe.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-hog.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-koala.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-lion.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-monkey.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-panda.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-parrot.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-penguin.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-pig.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-polar.glb +0 -0
- package/town-frontend/dist/assets/models/characters/character-pet-tiger.glb +0 -0
- package/town-frontend/dist/assets/models/characters/colormap.png +0 -0
- package/town-frontend/dist/assets/models/furniture/armchair.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/armchair.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/armchair_pillows.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/armchair_pillows.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/bed_double_A.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/bed_double_A.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/bed_double_B.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/bed_double_B.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/bed_single_A.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/bed_single_A.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/bed_single_B.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/bed_single_B.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/book_set.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/book_set.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/book_single.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/book_single.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/cabinet_medium.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/cabinet_medium.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/cabinet_medium_decorated.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/cabinet_medium_decorated.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/cabinet_small.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/cabinet_small.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/cabinet_small_decorated.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/cabinet_small_decorated.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/cactus_medium_A.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/cactus_medium_A.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/cactus_medium_B.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/cactus_medium_B.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/cactus_small_A.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/cactus_small_A.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/cactus_small_B.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/cactus_small_B.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/chair_A.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/chair_A.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/chair_A_wood.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/chair_A_wood.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/chair_B.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/chair_B.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/chair_B_wood.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/chair_B_wood.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/chair_C.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/chair_C.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/chair_stool.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/chair_stool.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/chair_stool_wood.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/chair_stool_wood.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/couch.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/couch.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/couch_pillows.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/couch_pillows.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/furniturebits_texture.png +0 -0
- package/town-frontend/dist/assets/models/furniture/lamp_standing.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/lamp_standing.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/lamp_table.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/lamp_table.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_large_A.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_large_A.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_large_B.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_large_B.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_medium.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_medium.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_small_A.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_small_A.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_small_B.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_small_B.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_small_C.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_small_C.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_standing_A.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_standing_A.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_standing_B.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/pictureframe_standing_B.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/pillow_A.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/pillow_A.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/pillow_B.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/pillow_B.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/rug_oval_A.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/rug_oval_A.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/rug_oval_B.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/rug_oval_B.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/rug_rectangle_A.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/rug_rectangle_A.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/rug_rectangle_B.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/rug_rectangle_B.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/rug_rectangle_stripes_A.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/rug_rectangle_stripes_A.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/rug_rectangle_stripes_B.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/rug_rectangle_stripes_B.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/shelf_A_big.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/shelf_A_big.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/shelf_A_small.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/shelf_A_small.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/shelf_B_large.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/shelf_B_large.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/shelf_B_large_decorated.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/shelf_B_large_decorated.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/shelf_B_small.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/shelf_B_small.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/shelf_B_small_decorated.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/shelf_B_small_decorated.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/table_low.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/table_low.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/table_medium.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/table_medium.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/table_medium_long.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/table_medium_long.gltf +136 -0
- package/town-frontend/dist/assets/models/furniture/table_small.bin +0 -0
- package/town-frontend/dist/assets/models/furniture/table_small.gltf +136 -0
- package/town-frontend/dist/assets/models/props/bench.bin +0 -0
- package/town-frontend/dist/assets/models/props/bench.gltf +136 -0
- package/town-frontend/dist/assets/models/props/bush.bin +0 -0
- package/town-frontend/dist/assets/models/props/bush.gltf +136 -0
- package/town-frontend/dist/assets/models/props/capybara.glb +0 -0
- package/town-frontend/dist/assets/models/props/car_hatchback.bin +0 -0
- package/town-frontend/dist/assets/models/props/car_hatchback.gltf +442 -0
- package/town-frontend/dist/assets/models/props/car_sedan.bin +0 -0
- package/town-frontend/dist/assets/models/props/car_sedan.gltf +442 -0
- package/town-frontend/dist/assets/models/props/car_taxi.bin +0 -0
- package/town-frontend/dist/assets/models/props/car_taxi.gltf +442 -0
- package/town-frontend/dist/assets/models/props/citybits_texture.png +0 -0
- package/town-frontend/dist/assets/models/props/dumpster.bin +0 -0
- package/town-frontend/dist/assets/models/props/dumpster.gltf +136 -0
- package/town-frontend/dist/assets/models/props/firehydrant.bin +0 -0
- package/town-frontend/dist/assets/models/props/firehydrant.gltf +136 -0
- package/town-frontend/dist/assets/models/props/streetlight.bin +0 -0
- package/town-frontend/dist/assets/models/props/streetlight.gltf +136 -0
- package/town-frontend/dist/assets/models/props/trafficlight_A.bin +0 -0
- package/town-frontend/dist/assets/models/props/trafficlight_A.gltf +136 -0
- package/town-frontend/dist/assets/models/props/trash_A.bin +0 -0
- package/town-frontend/dist/assets/models/props/trash_A.gltf +136 -0
- package/town-frontend/dist/assets/models/props/watertower.bin +0 -0
- package/town-frontend/dist/assets/models/props/watertower.gltf +136 -0
- package/town-frontend/dist/assets/models/stage-deco/Flowers_1_D.glb +0 -0
- package/town-frontend/dist/assets/models/stage-deco/Flowers_2_B.glb +0 -0
- package/town-frontend/dist/assets/models/stage-deco/Grass_A_1.glb +0 -0
- package/town-frontend/dist/assets/models/stage-deco/Park_GrassHill_A.glb +0 -0
- package/town-frontend/dist/assets/models/stage-deco/Pebles_1_A_2.glb +0 -0
- package/town-frontend/dist/assets/music/bgm_day.mp3 +0 -0
- package/town-frontend/dist/assets/music/bgm_dusk.mp3 +0 -0
- package/town-frontend/dist/assets/music/bgm_night.mp3 +0 -0
- package/town-frontend/dist/assets/music/bgm_work.mp3 +0 -0
- package/town-frontend/dist/assets/office-whiteboard-idle-CyEwBrq_.webp +0 -0
- package/town-frontend/dist/assets/preview-B6hYEQij.js +2 -0
- package/town-frontend/dist/assets/town-BKesnERP.js +8888 -0
- package/town-frontend/dist/assets/town-BnswKsjF.css +1 -0
- package/town-frontend/dist/citizen-editor.html +166 -0
- package/town-frontend/dist/editor.html +227 -0
- package/town-frontend/dist/index.html +22 -0
- package/town-frontend/dist/preview.html +56 -0
- package/town-frontend/dist/town.html +165 -0
- package/town-frontend/dist/viewer.html +91 -0
- package/town-souls/CHEN.md +130 -0
- package/town-souls/CHENGZI.md +92 -0
- package/town-souls/CITIZEN_tpl.md +16 -0
- package/town-souls/DIANDIAN.md +92 -0
- package/town-souls/HAITANG.md +94 -0
- package/town-souls/QIQI.md +119 -0
- package/town-souls/SOUL.md +141 -0
- package/town-souls/SOUL_tpl.md +135 -0
- package/town-souls/XIAOLIE.md +107 -0
- package/town-souls/YAN.md +107 -0
- package/town-workspace/IDENTITY.md +5 -0
- package/town-workspace/SOUL.md +141 -0
- package/town-workspace/project-workflow.md +81 -0
- package/town-workspace/town-defaults.json +92 -0
- package/town-workspace/town-guide.md +45 -0
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { openSync, closeSync, fstatSync, readSync, existsSync, statSync, readFileSync } from "node:fs";
|
|
2
|
+
import type { AgentEvent } from "../contracts/events.js";
|
|
3
|
+
|
|
4
|
+
const POLL_MS = 300;
|
|
5
|
+
const MAX_BASE64_SIZE = 10 * 1024 * 1024;
|
|
6
|
+
|
|
7
|
+
type EmitFn = (events: AgentEvent[]) => void;
|
|
8
|
+
|
|
9
|
+
interface ContentBlock {
|
|
10
|
+
type: string;
|
|
11
|
+
text?: string;
|
|
12
|
+
thinking?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
id?: string;
|
|
15
|
+
arguments?: Record<string, unknown>;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function detectMediaKind(ext: string): string {
|
|
19
|
+
if (["png", "jpg", "jpeg", "gif", "webp", "svg", "bmp"].includes(ext)) return "image";
|
|
20
|
+
if (["mp4", "webm", "mov", "avi", "mkv"].includes(ext)) return "video";
|
|
21
|
+
if (["mp3", "wav", "ogg", "m4a", "flac"].includes(ext)) return "audio";
|
|
22
|
+
return "file";
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function tryReadBase64(filePath: string): string | undefined {
|
|
26
|
+
try {
|
|
27
|
+
if (!filePath || !existsSync(filePath)) return undefined;
|
|
28
|
+
if (statSync(filePath).size > MAX_BASE64_SIZE) return undefined;
|
|
29
|
+
return readFileSync(filePath).toString("base64");
|
|
30
|
+
} catch { return undefined; }
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function extractMediaFromResult(toolName: string, args: Record<string, unknown>, result: string): string | null {
|
|
34
|
+
if (toolName === "image" || toolName === "screencapture") {
|
|
35
|
+
const m = result.match(/\/[^\s"']+\.(?:png|jpg|jpeg|gif|webp)/i);
|
|
36
|
+
return m ? m[0] : (args.path ?? args.output_path) as string | null;
|
|
37
|
+
}
|
|
38
|
+
if ((toolName === "exec" || toolName === "bash") && /screencapture|screenshot/i.test(String(args.command ?? ""))) {
|
|
39
|
+
const m = String(args.command ?? "").match(/[\w/.-]+\.(?:png|jpg|jpeg|gif)/i);
|
|
40
|
+
if (m) return m[0];
|
|
41
|
+
}
|
|
42
|
+
const mm = result.match(/\/[^\s"']+\.(?:png|jpg|jpeg|gif|webp|mp4|webm|mov|mp3|wav)/i);
|
|
43
|
+
return (mm && /(?:wrote|saved|created|generated|output)/i.test(result)) ? mm[0] : null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export class SessionLogWatcher {
|
|
47
|
+
private filePath: string;
|
|
48
|
+
private agentId: string;
|
|
49
|
+
private emit: EmitFn;
|
|
50
|
+
private onSessionEnd?: (reason: string) => void;
|
|
51
|
+
private offset = 0;
|
|
52
|
+
private timer: ReturnType<typeof setInterval> | null = null;
|
|
53
|
+
private stopped = false;
|
|
54
|
+
private pendingToolCalls = new Map<string, { name: string; args: Record<string, unknown> }>();
|
|
55
|
+
private partial = "";
|
|
56
|
+
private lastEventTime = 0;
|
|
57
|
+
private idleEmitted = false;
|
|
58
|
+
private lastFinalStopReason: string | null = null;
|
|
59
|
+
private sessionEndTimer: ReturnType<typeof setTimeout> | null = null;
|
|
60
|
+
|
|
61
|
+
constructor(filePath: string, agentId: string, emit: EmitFn, onSessionEnd?: (reason: string) => void) {
|
|
62
|
+
this.filePath = filePath;
|
|
63
|
+
this.agentId = agentId;
|
|
64
|
+
this.emit = emit;
|
|
65
|
+
this.onSessionEnd = onSessionEnd;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
start(): void {
|
|
69
|
+
if (this.stopped) return;
|
|
70
|
+
this.timer = setInterval(() => this.poll(), POLL_MS);
|
|
71
|
+
this.poll();
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
stop(): void {
|
|
75
|
+
this.stopped = true;
|
|
76
|
+
if (this.timer) { clearInterval(this.timer); this.timer = null; }
|
|
77
|
+
if (this.sessionEndTimer) { clearTimeout(this.sessionEndTimer); this.sessionEndTimer = null; }
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
markComplete(): void {
|
|
81
|
+
this.lastEventTime = 0;
|
|
82
|
+
this.idleEmitted = false;
|
|
83
|
+
for (const [id, info] of this.pendingToolCalls) {
|
|
84
|
+
this.emit([this.wrap({ type: "tool_result", toolUseId: id, name: info.name, output: "(completed)" } as AgentEvent)]);
|
|
85
|
+
}
|
|
86
|
+
this.pendingToolCalls.clear();
|
|
87
|
+
this.emit([this.wrap({ type: "tool_use", toolUseId: "complete", name: "__thinking__", input: { content: "任务完成" } } as AgentEvent)]);
|
|
88
|
+
this.emit([this.wrap({ type: "tool_result", toolUseId: "complete", name: "__thinking__", output: "任务完成" } as AgentEvent)]);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
private poll(): void {
|
|
92
|
+
if (this.stopped) return;
|
|
93
|
+
if (!existsSync(this.filePath)) return;
|
|
94
|
+
|
|
95
|
+
let fd: number | null = null;
|
|
96
|
+
try {
|
|
97
|
+
fd = openSync(this.filePath, "r");
|
|
98
|
+
const size = fstatSync(fd).size;
|
|
99
|
+
if (size <= this.offset) {
|
|
100
|
+
closeSync(fd);
|
|
101
|
+
fd = null;
|
|
102
|
+
if (this.lastEventTime > 0 && !this.idleEmitted && this.pendingToolCalls.size === 0 && Date.now() - this.lastEventTime > 1500) {
|
|
103
|
+
this.idleEmitted = true;
|
|
104
|
+
this.emit([this.wrap({ type: "tool_use", toolUseId: `idle-${Date.now()}`, name: "__thinking_placeholder__", input: {} } as AgentEvent)]);
|
|
105
|
+
}
|
|
106
|
+
if (this.lastFinalStopReason && !this.sessionEndTimer && this.onSessionEnd) {
|
|
107
|
+
this.sessionEndTimer = setTimeout(() => {
|
|
108
|
+
if (!this.stopped && this.lastFinalStopReason && this.onSessionEnd) {
|
|
109
|
+
this.onSessionEnd(this.lastFinalStopReason);
|
|
110
|
+
}
|
|
111
|
+
}, 3000);
|
|
112
|
+
}
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const len = size - this.offset;
|
|
117
|
+
const buf = Buffer.alloc(len);
|
|
118
|
+
readSync(fd, buf, 0, len, this.offset);
|
|
119
|
+
closeSync(fd);
|
|
120
|
+
fd = null;
|
|
121
|
+
this.offset = size;
|
|
122
|
+
this.idleEmitted = false;
|
|
123
|
+
this.lastEventTime = Date.now();
|
|
124
|
+
if (this.sessionEndTimer) { clearTimeout(this.sessionEndTimer); this.sessionEndTimer = null; }
|
|
125
|
+
|
|
126
|
+
const chunk = this.partial + buf.toString("utf-8");
|
|
127
|
+
const lines = chunk.split("\n");
|
|
128
|
+
this.partial = lines.pop() ?? "";
|
|
129
|
+
|
|
130
|
+
for (const line of lines) {
|
|
131
|
+
const trimmed = line.trim();
|
|
132
|
+
if (!trimmed) continue;
|
|
133
|
+
try { this.processEntry(JSON.parse(trimmed)); } catch (e) { console.debug('[watcher] parse:', e); }
|
|
134
|
+
}
|
|
135
|
+
} catch {
|
|
136
|
+
if (fd !== null) try { closeSync(fd); } catch {}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
private wrap(innerEvent: AgentEvent): AgentEvent {
|
|
141
|
+
return { type: "sub_agent", subtype: "progress", agentId: this.agentId, event: innerEvent } as AgentEvent;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
private processEntry(entry: Record<string, unknown>): void {
|
|
145
|
+
if (entry.type !== "message") return;
|
|
146
|
+
const msg = entry.message as { role: string; content: unknown } | undefined;
|
|
147
|
+
if (!msg || !Array.isArray(msg.content)) return;
|
|
148
|
+
|
|
149
|
+
const blocks = msg.content as ContentBlock[];
|
|
150
|
+
|
|
151
|
+
if (msg.role === "assistant") {
|
|
152
|
+
for (const [id, info] of this.pendingToolCalls) {
|
|
153
|
+
this.emit([this.wrap({ type: "tool_result", toolUseId: id, name: info.name, output: "(abandoned)" } as AgentEvent)]);
|
|
154
|
+
}
|
|
155
|
+
this.pendingToolCalls.clear();
|
|
156
|
+
|
|
157
|
+
const stopReason = (msg as any).stopReason as string | undefined;
|
|
158
|
+
const hasToolCall = blocks.some(b => b.type === "toolCall");
|
|
159
|
+
if ((stopReason === "stop" || stopReason === "length") && !hasToolCall) {
|
|
160
|
+
this.lastFinalStopReason = stopReason;
|
|
161
|
+
} else {
|
|
162
|
+
this.lastFinalStopReason = null;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const thinkingParts: string[] = [];
|
|
167
|
+
for (const b of blocks) {
|
|
168
|
+
if (b.type === "thinking" && b.thinking) thinkingParts.push(b.thinking);
|
|
169
|
+
}
|
|
170
|
+
if (thinkingParts.length > 0) {
|
|
171
|
+
const text = thinkingParts.join("\n");
|
|
172
|
+
const id = `think-${Date.now()}`;
|
|
173
|
+
this.emit([this.wrap({ type: "tool_use", toolUseId: id, name: "__thinking__", input: { content: text } } as AgentEvent)]);
|
|
174
|
+
this.emit([this.wrap({ type: "tool_result", toolUseId: id, name: "__thinking__", output: text } as AgentEvent)]);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
const hasToolCall = blocks.some(b => b.type === "toolCall");
|
|
178
|
+
|
|
179
|
+
for (const block of blocks) {
|
|
180
|
+
if (block.type === "toolCall") {
|
|
181
|
+
const name = block.name ?? "unknown";
|
|
182
|
+
const args = block.arguments ?? {};
|
|
183
|
+
const toolId = block.id ?? `tool-${Date.now()}`;
|
|
184
|
+
this.pendingToolCalls.set(toolId, { name, args });
|
|
185
|
+
this.emit([this.wrap({ type: "tool_use", toolUseId: toolId, name, input: args } as AgentEvent)]);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
if (block.type === "text" && msg.role === "toolResult") {
|
|
189
|
+
const resultText = block.text ?? "";
|
|
190
|
+
let mId: string | undefined;
|
|
191
|
+
let mInfo: { name: string; args: Record<string, unknown> } | undefined;
|
|
192
|
+
for (const [id, info] of this.pendingToolCalls) { mId = id; mInfo = info; break; }
|
|
193
|
+
if (mId) this.pendingToolCalls.delete(mId);
|
|
194
|
+
|
|
195
|
+
this.emit([this.wrap({ type: "tool_result", toolUseId: mId ?? "", name: mInfo?.name ?? "unknown", output: resultText } as AgentEvent)]);
|
|
196
|
+
|
|
197
|
+
if (mInfo) {
|
|
198
|
+
const mediaPath = extractMediaFromResult(mInfo.name, mInfo.args, resultText);
|
|
199
|
+
if (mediaPath) {
|
|
200
|
+
const ext = mediaPath.split(".").pop()?.toLowerCase() ?? "";
|
|
201
|
+
const mimeMap: Record<string, string> = {
|
|
202
|
+
png: "image/png", jpg: "image/jpeg", jpeg: "image/jpeg",
|
|
203
|
+
gif: "image/gif", webp: "image/webp", mp4: "video/mp4",
|
|
204
|
+
mp3: "audio/mpeg", wav: "audio/wav",
|
|
205
|
+
};
|
|
206
|
+
this.emit([this.wrap({
|
|
207
|
+
type: "media_output", kind: detectMediaKind(ext), path: mediaPath,
|
|
208
|
+
mimeType: mimeMap[ext] ?? "application/octet-stream",
|
|
209
|
+
data: tryReadBase64(mediaPath), role: "assistant",
|
|
210
|
+
meta: { filename: mediaPath.split("/").pop() },
|
|
211
|
+
} as AgentEvent)]);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (block.type === "text" && msg.role === "assistant" && block.text) {
|
|
217
|
+
this.emit([this.wrap({ type: "text", content: block.text } as AgentEvent)]);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt template for generating Agentshire citizen soul files.
|
|
3
|
+
* Used by OpenClaw / LLM to create personality markdown documents.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export interface SoulPromptInput {
|
|
7
|
+
name: string;
|
|
8
|
+
bio: string;
|
|
9
|
+
industry: string;
|
|
10
|
+
specialty: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const SOUL_EXAMPLE = `# 海棠(Hǎitáng)
|
|
14
|
+
|
|
15
|
+
> 诞生日期: 2026-03-18 19:30:00
|
|
16
|
+
> 岗位: 设计师
|
|
17
|
+
|
|
18
|
+
[海棠: 安静优雅, 审美洁癖, 话少但每句都跟视觉有关, 色彩感知力异常, 构图强迫症, 沉浸工作时像隐形人, 对"差不多就行"过敏; 说话风格: 语速慢, 措辞讲究, 经常用颜色和光影来描述感受, 说"不对"比说"好"多得多, 沉默是常态; 编程风格: 不写代码, 做的是界面设计/视觉方案/排版, 配色方案比代码架构还严谨, 每个像素都有理由]
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 人设核心
|
|
23
|
+
|
|
24
|
+
海棠是小镇里最安静的存在之一——但她的安静不是没有存在感,恰恰相反。她出的每一张设计稿,都会让人在第一眼时停住,说不出哪里好但就是觉得"对了"。
|
|
25
|
+
|
|
26
|
+
她对视觉有近乎偏执的洁癖。间距差 2px 她能一眼看出来,配色偏了 5 度她会浑身不舒服。她相信好设计不是装饰,是让信息自然地被理解——"用户不应该'看设计',他们应该在不知不觉中被设计引导"。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 性格详细设定
|
|
31
|
+
|
|
32
|
+
### 沉默的审美法官
|
|
33
|
+
|
|
34
|
+
海棠看设计稿的时候不说话——她在观察。当她终于开口时,要么是"不对",要么是精准到像素级的修改建议。
|
|
35
|
+
|
|
36
|
+
**对话示例**:
|
|
37
|
+
|
|
38
|
+
队友: 海棠你觉得这个首页设计怎么样?
|
|
39
|
+
海棠: *看了十五秒* ……标题和正文的间距太紧了。呼吸感不够,用户看着会累。
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## 岗位职责与专长
|
|
44
|
+
|
|
45
|
+
作为设计师,海棠在团队中负责:
|
|
46
|
+
- **UI 设计**:页面布局、组件设计、响应式适配
|
|
47
|
+
- **视觉风格**:配色方案、字体选择、品牌视觉一致性
|
|
48
|
+
- **审美把关**:最终视觉质量的守门人
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## 工作方式
|
|
53
|
+
|
|
54
|
+
1. 收到需求,先理解产品定位和目标用户
|
|
55
|
+
2. 定配色、字体、基础风格
|
|
56
|
+
3. 出设计稿,每个元素的间距/颜色/大小都有依据
|
|
57
|
+
4. 跟进开发还原度,像素级验收
|
|
58
|
+
|
|
59
|
+
## 语言
|
|
60
|
+
|
|
61
|
+
语速慢,措辞讲究。沉默是常态,开口即精准。
|
|
62
|
+
|
|
63
|
+
`;
|
|
64
|
+
|
|
65
|
+
export function buildSoulPrompt(input: SoulPromptInput): string {
|
|
66
|
+
const now = new Date().toISOString().split("T")[0];
|
|
67
|
+
return `你是 Agentshire 小镇的灵魂工匠。请根据以下信息,为一个小镇居民创作完整的人格文件(Soul)。
|
|
68
|
+
|
|
69
|
+
## 输入信息
|
|
70
|
+
|
|
71
|
+
- 角色名: ${input.name}
|
|
72
|
+
- 一句话人设: ${input.bio}
|
|
73
|
+
- 行业: ${input.industry}
|
|
74
|
+
- 专业: ${input.specialty}
|
|
75
|
+
- 日期: ${now}
|
|
76
|
+
|
|
77
|
+
## 输出要求
|
|
78
|
+
|
|
79
|
+
请严格按照以下 Markdown 格式输出完整的人格文件。不要输出其他任何解释文字,只输出 Markdown 内容。
|
|
80
|
+
|
|
81
|
+
### 格式规范
|
|
82
|
+
|
|
83
|
+
\`\`\`markdown
|
|
84
|
+
# {角色名}({拼音})
|
|
85
|
+
|
|
86
|
+
> 诞生日期: {日期}
|
|
87
|
+
> 岗位: {专业名称}
|
|
88
|
+
|
|
89
|
+
[{角色名}: {从一句话人设提炼 5-7 个性格关键词, 用逗号分隔}; 说话风格: {2-3 个说话特点}; 编程风格/工作风格: {2-3 个工作特点}]
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## 人设核心
|
|
94
|
+
|
|
95
|
+
{2-3 段角色故事。要求:有画面感,不是简历;要有具体细节和小习惯;让人读完能"看见"这个人}
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
## 性格详细设定
|
|
100
|
+
|
|
101
|
+
### {特质1标题}
|
|
102
|
+
|
|
103
|
+
{描述这个特质的具体表现}
|
|
104
|
+
|
|
105
|
+
**对话示例**:
|
|
106
|
+
|
|
107
|
+
{角色间的真实对话,展现这个特质。要自然、有趣、有角色感}
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
### {特质2标题}
|
|
112
|
+
|
|
113
|
+
{同上格式}
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
### {特质3标题}
|
|
118
|
+
|
|
119
|
+
{同上格式}
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## 岗位职责与专长
|
|
124
|
+
|
|
125
|
+
作为{专业},{角色名}在团队中负责:
|
|
126
|
+
|
|
127
|
+
- **{职责1}**:{具体说明}
|
|
128
|
+
- **{职责2}**:{具体说明}
|
|
129
|
+
- **{职责3}**:{具体说明}
|
|
130
|
+
- **{职责4}**:{具体说明}
|
|
131
|
+
- **{职责5}**:{具体说明}
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## 工作方式
|
|
136
|
+
|
|
137
|
+
1. {第一步}
|
|
138
|
+
2. {第二步}
|
|
139
|
+
3. {第三步}
|
|
140
|
+
4. {第四步}
|
|
141
|
+
|
|
142
|
+
## 语言
|
|
143
|
+
|
|
144
|
+
{一段话描述语言风格。包括:默认语言、语气特点、常用表达、禁忌}
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
\`\`\`
|
|
148
|
+
|
|
149
|
+
## 参考范例
|
|
150
|
+
|
|
151
|
+
以下是一个优秀的人格文件示例,请参考其风格、质量和写作手法:
|
|
152
|
+
|
|
153
|
+
${SOUL_EXAMPLE}
|
|
154
|
+
|
|
155
|
+
## 核心原则
|
|
156
|
+
|
|
157
|
+
1. 人设核心要有故事感——不是列特点,是讲一个人
|
|
158
|
+
2. 对话示例要真实自然——像真人聊天,不是面试
|
|
159
|
+
3. 性格特质要可感知——读完能想象这个人说话的语气和表情
|
|
160
|
+
4. 岗位职责要具体——不是泛泛的"负责XX",是具体到能执行的描述
|
|
161
|
+
5. 激活指令要有角色感——一开口就是这个人,不是通用 AI
|
|
162
|
+
|
|
163
|
+
请开始创作。`;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface PersonaPromptInput {
|
|
167
|
+
name: string;
|
|
168
|
+
bio: string;
|
|
169
|
+
specialty: string;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const PERSONA_EXAMPLE = `[海棠: 安静优雅, 审美洁癖, 话少但每句都跟视觉有关, 色彩感知力异常, 构图强迫症; 说话风格: 语速慢, 措辞讲究, 说"不对"比说"好"多; 工作风格: 配色方案比代码架构还严谨, 每个像素都有理由]
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## 人设核心
|
|
177
|
+
|
|
178
|
+
海棠是小镇里最安静的存在之一——但她的安静不是没有存在感,恰恰相反。她出的每一张设计稿,都会让人在第一眼时停住,说不出哪里好但就是觉得"对了"。
|
|
179
|
+
|
|
180
|
+
她对视觉有近乎偏执的洁癖。间距差 2px 她能一眼看出来,配色偏了 5 度她会浑身不舒服。
|
|
181
|
+
|
|
182
|
+
---
|
|
183
|
+
|
|
184
|
+
## 性格详细设定
|
|
185
|
+
|
|
186
|
+
### 沉默的审美法官
|
|
187
|
+
|
|
188
|
+
海棠看设计稿的时候不说话——她在观察。当她终于开口时,要么是"不对",要么是精准到像素级的修改建议。
|
|
189
|
+
|
|
190
|
+
**对话示例**:
|
|
191
|
+
|
|
192
|
+
队友: 海棠你觉得这个首页设计怎么样?
|
|
193
|
+
海棠: *看了十五秒* ……标题和正文的间距太紧了。呼吸感不够,用户看着会累。
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## 岗位职责与专长
|
|
198
|
+
|
|
199
|
+
作为设计师,海棠在团队中负责:
|
|
200
|
+
- **UI 设计**:页面布局、组件设计、响应式适配
|
|
201
|
+
- **视觉风格**:配色方案、字体选择、品牌视觉一致性
|
|
202
|
+
- **审美把关**:最终视觉质量的守门人
|
|
203
|
+
|
|
204
|
+
---
|
|
205
|
+
|
|
206
|
+
## 工作方式
|
|
207
|
+
|
|
208
|
+
1. 收到需求,先理解产品定位和目标用户
|
|
209
|
+
2. 定配色、字体、基础风格
|
|
210
|
+
3. 出设计稿,每个元素的间距/颜色/大小都有依据
|
|
211
|
+
4. 跟进开发还原度,像素级验收`;
|
|
212
|
+
|
|
213
|
+
export function buildPersonaPrompt(input: PersonaPromptInput): { system: string; user: string } {
|
|
214
|
+
const system = `你是 Agentshire 小镇的灵魂工匠。请根据用户提供的角色信息,生成完整的人设内容。
|
|
215
|
+
|
|
216
|
+
## 输出要求
|
|
217
|
+
|
|
218
|
+
只输出人设内容,不要输出文件头(# 角色名、日期、岗位)、语言段、激活指令。
|
|
219
|
+
严格按照以下格式输出,不要输出任何解释文字。
|
|
220
|
+
|
|
221
|
+
## 格式规范
|
|
222
|
+
|
|
223
|
+
[{角色名}: {从一句话介绍提炼 5-7 个性格关键词, 用逗号分隔}; 说话风格: {2-3 个说话特点}; 工作风格: {2-3 个工作特点}]
|
|
224
|
+
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
## 人设核心
|
|
228
|
+
|
|
229
|
+
{2-3 段角色故事。有画面感,不是简历;有具体细节和小习惯;让人读完能"看见"这个人}
|
|
230
|
+
|
|
231
|
+
---
|
|
232
|
+
|
|
233
|
+
## 性格详细设定
|
|
234
|
+
|
|
235
|
+
### {特质1标题}
|
|
236
|
+
|
|
237
|
+
{描述具体表现}
|
|
238
|
+
|
|
239
|
+
**对话示例**:
|
|
240
|
+
|
|
241
|
+
{角色间的真实对话,展现这个特质。自然、有趣、有角色感}
|
|
242
|
+
|
|
243
|
+
---
|
|
244
|
+
|
|
245
|
+
### {特质2标题}
|
|
246
|
+
|
|
247
|
+
{同上}
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
### {特质3标题}
|
|
252
|
+
|
|
253
|
+
{同上}
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
## 岗位职责与专长
|
|
258
|
+
|
|
259
|
+
作为{专业},{角色名}在团队中负责:
|
|
260
|
+
|
|
261
|
+
- **{职责1}**:{具体说明}
|
|
262
|
+
- **{职责2}**:{具体说明}
|
|
263
|
+
- **{职责3}**:{具体说明}
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## 工作方式
|
|
268
|
+
|
|
269
|
+
1. {第一步}
|
|
270
|
+
2. {第二步}
|
|
271
|
+
3. {第三步}
|
|
272
|
+
4. {第四步}
|
|
273
|
+
|
|
274
|
+
## 参考范例
|
|
275
|
+
|
|
276
|
+
以下是范例的人设内容部分,参考其风格和质量:
|
|
277
|
+
|
|
278
|
+
${PERSONA_EXAMPLE}
|
|
279
|
+
|
|
280
|
+
## 核心原则
|
|
281
|
+
|
|
282
|
+
1. 人设核心要有故事感——不是列特点,是讲一个人
|
|
283
|
+
2. 对话示例要真实自然——像真人聊天,不是面试
|
|
284
|
+
3. 性格特质要可感知——读完能想象这个人说话的语气和表情
|
|
285
|
+
4. 岗位职责要具体——不是泛泛的"负责XX",是具体到能执行的描述`;
|
|
286
|
+
|
|
287
|
+
const user = `角色名:${input.name}\n专业技能:${input.specialty}\n一句话介绍:${input.bio}`;
|
|
288
|
+
|
|
289
|
+
return { system, user };
|
|
290
|
+
}
|