@whitesands/agent-player 1.2.0 → 1.3.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 +10 -0
- package/README.md +23 -0
- package/dist/index.cjs +749 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +312 -4
- package/dist/index.d.ts +312 -4
- package/dist/index.js +747 -8
- package/dist/index.js.map +1 -1
- package/dist/protocol.cjs +1 -1
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.d.cts +27 -3
- package/dist/protocol.d.ts +27 -3
- package/dist/protocol.js +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/testing.cjs +1 -1
- package/dist/testing.cjs.map +1 -1
- package/dist/testing.d.cts +2 -2
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +1 -1
- package/dist/testing.js.map +1 -1
- package/dist/{types-DXqkV7YA.d.ts → types-BcH7_ozx.d.ts} +37 -2
- package/dist/{types-Zi-2YmF2.d.cts → types-gmAkYoQr.d.cts} +37 -2
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
- `start()` takes `memory`, `maxActions`, `subgoals` and `ownInstructions`.
|
|
6
|
+
- With `memory: true` the platform keeps the character's memory and relationships. `handle.observe(text, about)` adds an event without a turn, `handle.relationships()` reads how it feels about people, and `memory` and `relationship` events are emitted.
|
|
7
|
+
- `TurnResult.steps` lists every action when a turn played more than one.
|
|
8
|
+
- `World`: describe places, things and characters once; it builds each character's view and standard actions, carries speech, and decides when a character gets a turn. Port of `WSI.World` from the Luau SDK.
|
|
9
|
+
- `examples/town`: Sandy Shores as a browser game on `World`.
|
|
10
|
+
- A refused `start_session` now rejects `start()` with the platform's reason instead of timing out.
|
|
11
|
+
- A reconnect that fails part-way can no longer end the process with an unhandled "Timed out waiting for session resume".
|
|
12
|
+
|
|
3
13
|
## 1.2.0
|
|
4
14
|
|
|
5
15
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -341,3 +341,26 @@ PLATFORM_KEY=pk_... npm run forest -- --remote
|
|
|
341
341
|
```
|
|
342
342
|
|
|
343
343
|
Releases are recorded in [CHANGELOG.md](CHANGELOG.md).
|
|
344
|
+
|
|
345
|
+
## World
|
|
346
|
+
|
|
347
|
+
`World` builds a living world on top of the agent player, so a game does not write a view or actions per character. The game provides the engine: places, things with activities, and a body per character (`getPosition`, `moveTo`, `stop`, `say`). `World` serves each character's tools over MCP (`say`, `go_to`, `approach`, `use`, `give`, `emote`, `idle`), carries speech between characters and players, and decides when a character needs a turn. Who each character is comes from its role and story on the platform.
|
|
348
|
+
|
|
349
|
+
```ts
|
|
350
|
+
import { AgentServer, World } from "@whitesands/agent-player";
|
|
351
|
+
|
|
352
|
+
const world = new World(new AgentServer(), { name: "Sandy Shores", about: "A small beach town." });
|
|
353
|
+
world.addPlace("cafe", { description: "Mia's cafe", position: { x: 60, y: 0 } });
|
|
354
|
+
world.addThing("espresso_machine", {
|
|
355
|
+
place: "cafe",
|
|
356
|
+
position: { x: 64, y: -4 },
|
|
357
|
+
activities: { make_coffee: { description: "Make a coffee", seconds: 6, gives: "coffee" } },
|
|
358
|
+
});
|
|
359
|
+
await world.addCharacter({ id: miaCharacterId, name: "Mia", body: miaBody, home: "cafe" });
|
|
360
|
+
world.addPerson({ name: "Alex", getPosition: () => alexPosition });
|
|
361
|
+
world.on((event) => { /* speech, relationship, status, give, thinking, turn */ });
|
|
362
|
+
world.start();
|
|
363
|
+
world.say("Alex", "Hi Mia!");
|
|
364
|
+
```
|
|
365
|
+
|
|
366
|
+
`examples/town` is a complete browser game built this way: `npm run build && WSI_PLATFORM_KEY=pk_... npm run town`, then open `http://localhost:8080`.
|