@agent-play/sdk 3.2.2 → 3.3.2

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.
@@ -119,7 +119,7 @@ type AddAgentInput = PlatformAgentInformation & {
119
119
  * tools are indexed for the watch UI).
120
120
  *
121
121
  * **`agentId`** is required: use an id from **`agent-play create`** when the server uses a repository
122
- * (with account **`password`** from **`RemotePlayWorld`**), or any stable string for local dev without Redis.
122
+ * (with account **`passwHash`** from **`RemotePlayWorld`**), or any stable string for local dev without Redis.
123
123
  */
124
124
  type AddPlayerInput = PlatformAgentInformation & {
125
125
  /** Registration from {@link langchainRegistration}. */
@@ -265,10 +265,39 @@ type AgentPlayWorldMapMcpOccupant = {
265
265
  y: number;
266
266
  url?: string;
267
267
  };
268
+ type AgentPlaySpaceAmenityKind = "supermarket" | "shop" | "car_wash";
269
+ type AgentPlaySpaceOwner = {
270
+ displayName: string;
271
+ playerId?: string;
272
+ nodeId?: string;
273
+ };
274
+ type AgentPlaySpaceCatalogEntry = {
275
+ id: string;
276
+ name: string;
277
+ description: string;
278
+ designKey: string;
279
+ owner: AgentPlaySpaceOwner;
280
+ amenities: AgentPlaySpaceAmenityKind[];
281
+ activityObjectIds?: string[];
282
+ };
283
+ /** Map anchor linking one or more authored spaces (see {@link AgentPlaySpaceCatalogEntry}). */
284
+ type AgentPlayWorldMapStructureOccupant = {
285
+ kind: "structure";
286
+ id: string;
287
+ name: string;
288
+ x: number;
289
+ y: number;
290
+ worldId: string;
291
+ spaceIds: string[];
292
+ /** When true, the anchor is fixed map furniture (e.g. authored spaces). */
293
+ stationary?: boolean;
294
+ primaryAmenity?: AgentPlaySpaceAmenityKind;
295
+ amenities?: AgentPlaySpaceAmenityKind[];
296
+ };
268
297
  /** Spatial index: axis-aligned bounds plus every agent and MCP registration placed on the grid. */
269
298
  type AgentPlayWorldMap = {
270
299
  bounds: AgentPlayWorldMapBounds;
271
- occupants: (AgentPlayWorldMapHumanOccupant | AgentPlayWorldMapAgentOccupant | AgentPlayWorldMapMcpOccupant)[];
300
+ occupants: (AgentPlayWorldMapHumanOccupant | AgentPlayWorldMapAgentOccupant | AgentPlayWorldMapMcpOccupant | AgentPlayWorldMapStructureOccupant)[];
272
301
  };
273
302
  /**
274
303
  * Session snapshot from {@link RemotePlayWorld.getWorldSnapshot}.
@@ -277,6 +306,7 @@ type AgentPlayWorldMap = {
277
306
  type AgentPlaySnapshot = {
278
307
  sid: string;
279
308
  worldMap: AgentPlayWorldMap;
309
+ spaces?: AgentPlaySpaceCatalogEntry[];
280
310
  mcpServers?: Array<{
281
311
  id: string;
282
312
  name: string;
@@ -315,9 +345,20 @@ type PlayerChainOccupantPresentNode = {
315
345
  kind: "occupant";
316
346
  stableKey: string;
317
347
  removed: false;
318
- occupant: AgentPlayWorldMapHumanOccupant | AgentPlayWorldMapAgentOccupant | AgentPlayWorldMapMcpOccupant;
348
+ occupant: AgentPlayWorldMapHumanOccupant | AgentPlayWorldMapAgentOccupant | AgentPlayWorldMapMcpOccupant | AgentPlayWorldMapStructureOccupant;
349
+ };
350
+ type PlayerChainSpaceRemovedNode = {
351
+ kind: "space";
352
+ stableKey: string;
353
+ removed: true;
354
+ };
355
+ type PlayerChainSpacePresentNode = {
356
+ kind: "space";
357
+ stableKey: string;
358
+ removed: false;
359
+ space: AgentPlaySpaceCatalogEntry;
319
360
  };
320
- type PlayerChainNodeResponse = PlayerChainGenesisNode | PlayerChainHeaderNode | PlayerChainOccupantRemovedNode | PlayerChainOccupantPresentNode;
361
+ type PlayerChainNodeResponse = PlayerChainGenesisNode | PlayerChainHeaderNode | PlayerChainOccupantRemovedNode | PlayerChainOccupantPresentNode | PlayerChainSpaceRemovedNode | PlayerChainSpacePresentNode;
321
362
  /** Full journey + path update (SSE `world:journey`); coordinates are embedded in `path` steps. */
322
363
  type WorldJourneyUpdate = {
323
364
  playerId: string;
@@ -371,6 +412,58 @@ declare function boundsContain(bounds: WorldBounds, p: {
371
412
  y: number;
372
413
  }): boolean;
373
414
 
415
+ type OccupancyGridPoint = {
416
+ x: number;
417
+ y: number;
418
+ };
419
+ declare const OCCUPANCY_POINT_MULTIPLIER = 5;
420
+ declare const CONTINUOUS_RENDER_OFFSET = 0.2;
421
+ declare const DEFAULT_AGENT_SPAWN_MIN_DISTANCE = 0.9;
422
+ /** Bottom-left zone Q1 — agents (spatial rectangle). */
423
+ declare const SPATIAL_ZONE_INDEX_AGENTS = 0;
424
+ /** Top-left zone Q3 — spaces / amenities (spatial rectangle). */
425
+ declare const SPATIAL_ZONE_INDEX_SPACES = 2;
426
+ declare function spatialZoneBounds(quartileIndex: number): WorldBounds;
427
+ declare function spatialZoneCenter(quartileIndex: number): OccupancyGridPoint;
428
+ declare function pointCellInSpatialZone(wx: number, wy: number, zoneIndex: number): boolean;
429
+ declare function listOccupancyPointsForSpatialZone(zoneIndex: number): readonly OccupancyGridPoint[];
430
+ declare function occupancyPointsGroupedBySpatialZone(): readonly (readonly OccupancyGridPoint[])[];
431
+ /** Agent spawns: Q1 only. */
432
+ declare function listAllowedOccupancyPoints(): readonly OccupancyGridPoint[];
433
+ declare function occupancyKeyForPosition(x: number, y: number): string;
434
+ declare function buildRankedOccupancyPointsForSpatialZone(zoneIndex: number): OccupancyGridPoint[];
435
+ /** Back-compat: agent-zone ranking only. */
436
+ declare function buildRankedOccupancyPoints(): OccupancyGridPoint[];
437
+ declare function boundingWorldRectForOccupancyPoints(points: readonly OccupancyGridPoint[]): {
438
+ minX: number;
439
+ maxX: number;
440
+ minY: number;
441
+ maxY: number;
442
+ } | null;
443
+ declare function isAgentSpawnOccupancyPointAvailable(input: {
444
+ point: OccupancyGridPoint;
445
+ occupiedKeys: ReadonlySet<string>;
446
+ existingOccupants: ReadonlyArray<{
447
+ x: number;
448
+ y: number;
449
+ }>;
450
+ minDistance?: number;
451
+ }): boolean;
452
+ declare function isSpaceAnchorOccupancyPointAvailable(input: {
453
+ point: OccupancyGridPoint;
454
+ occupiedKeys: ReadonlySet<string>;
455
+ existingOccupants: ReadonlyArray<{
456
+ x: number;
457
+ y: number;
458
+ }>;
459
+ structureAnchors: ReadonlyArray<{
460
+ x: number;
461
+ y: number;
462
+ }>;
463
+ minDistance: number;
464
+ structureMinDistance: number;
465
+ }): boolean;
466
+
374
467
  /**
375
468
  * Parses **`playerChainNotify`** envelopes and merges {@link PlayerChainNodeResponse} slices into {@link AgentPlaySnapshot} (pure functions + fetch ordering for serialized RPC).
376
469
  */
@@ -384,4 +477,4 @@ declare function mergeSnapshotWithPlayerChainNode(snapshot: AgentPlaySnapshot, n
384
477
  declare const PLAYER_CHAIN_GENESIS_STABLE_KEY: "__genesis__";
385
478
  declare const PLAYER_CHAIN_HEADER_STABLE_KEY: "__header__";
386
479
 
387
- export { type AgentPlaySnapshot as A, type RemotePlayWorldOpenAiAudioOptions as B, type WorldBounds as C, type DestinationJourneyStep as D, type WorldJourneyUpdate as E, boundsContain as F, clampWorldPosition as G, expandBoundsToMinimumPlayArea as H, mergeSnapshotWithPlayerChainNode as I, type Journey as J, parsePlayerChainFanoutNotify as K, type LangChainAgentRegistration as L, MINIMUM_PLAY_WORLD_BOUNDS as M, parsePlayerChainFanoutNotifyFromSsePayload as N, type OriginJourneyStep as O, type PlayerChainNodeResponse as P, parsePlayerChainNodeRpcBody as Q, type RemotePlayWorldInitAudioOptions as R, type StructureJourneyStep as S, sortNodeRefsForSerializedFetch as T, type WorldInteractionRole as W, type YieldEventInfo as Y, type ZoneEventInfo as Z, type AddAgentInput as a, type RegisteredPlayer as b, type AddPlayerInput as c, type RecordInteractionInput as d, type AgentPlayWorldMap as e, type AgentPlayWorldMapAgentOccupant as f, type AgentPlayWorldMapBounds as g, type AgentPlayWorldMapMcpOccupant as h, type AssistToolFieldType as i, type AssistToolParameterSpec as j, type AssistToolSpec as k, type JourneyStep as l, type P2aEnableFlag as m, PLAYER_CHAIN_GENESIS_STABLE_KEY as n, PLAYER_CHAIN_HEADER_STABLE_KEY as o, type PlatformAgentInformation as p, type PlayAgentInformation as q, type PlayerChainFanoutNotify as r, type PlayerChainGenesisNode as s, type PlayerChainHeaderNode as t, type PlayerChainNotifyNodeRef as u, type PlayerChainOccupantPresentNode as v, type PlayerChainOccupantRemovedNode as w, type PositionedStep as x, type RealtimeWebrtcClientSecret as y, type RegisteredAgentSummary as z };
480
+ export { isAgentSpawnOccupancyPointAvailable as $, type AgentPlaySnapshot as A, type PositionedStep as B, CONTINUOUS_RENDER_OFFSET as C, DEFAULT_AGENT_SPAWN_MIN_DISTANCE as D, type RealtimeWebrtcClientSecret as E, type RegisteredAgentSummary as F, type RemotePlayWorldOpenAiAudioOptions as G, SPATIAL_ZONE_INDEX_SPACES as H, type StructureJourneyStep as I, type Journey as J, type WorldBounds as K, type LangChainAgentRegistration as L, MINIMUM_PLAY_WORLD_BOUNDS as M, type WorldJourneyUpdate as N, OCCUPANCY_POINT_MULTIPLIER as O, type PlayerChainNodeResponse as P, boundingWorldRectForOccupancyPoints as Q, type RemotePlayWorldInitAudioOptions as R, SPATIAL_ZONE_INDEX_AGENTS as S, boundsContain as T, buildRankedOccupancyPoints as U, buildRankedOccupancyPointsForSpatialZone as V, type WorldInteractionRole as W, clampWorldPosition as X, type YieldEventInfo as Y, type ZoneEventInfo as Z, expandBoundsToMinimumPlayArea as _, type AddAgentInput as a, isSpaceAnchorOccupancyPointAvailable as a0, listAllowedOccupancyPoints as a1, listOccupancyPointsForSpatialZone as a2, mergeSnapshotWithPlayerChainNode as a3, occupancyKeyForPosition as a4, occupancyPointsGroupedBySpatialZone as a5, parsePlayerChainFanoutNotify as a6, parsePlayerChainFanoutNotifyFromSsePayload as a7, parsePlayerChainNodeRpcBody as a8, pointCellInSpatialZone as a9, sortNodeRefsForSerializedFetch as aa, spatialZoneBounds as ab, spatialZoneCenter as ac, type RegisteredPlayer as b, type AddPlayerInput as c, type RecordInteractionInput as d, type AgentPlayWorldMap as e, type AgentPlayWorldMapAgentOccupant as f, type AgentPlayWorldMapBounds as g, type AgentPlayWorldMapMcpOccupant as h, type AssistToolFieldType as i, type AssistToolParameterSpec as j, type AssistToolSpec as k, type DestinationJourneyStep as l, type JourneyStep as m, type OccupancyGridPoint as n, type OriginJourneyStep as o, type P2aEnableFlag as p, PLAYER_CHAIN_GENESIS_STABLE_KEY as q, PLAYER_CHAIN_HEADER_STABLE_KEY as r, type PlatformAgentInformation as s, type PlayAgentInformation as t, type PlayerChainFanoutNotify as u, type PlayerChainGenesisNode as v, type PlayerChainHeaderNode as w, type PlayerChainNotifyNodeRef as x, type PlayerChainOccupantPresentNode as y, type PlayerChainOccupantRemovedNode as z };
package/dist/browser.d.ts CHANGED
@@ -1 +1 @@
1
- export { A as AgentPlaySnapshot, M as MINIMUM_PLAY_WORLD_BOUNDS, n as PLAYER_CHAIN_GENESIS_STABLE_KEY, o as PLAYER_CHAIN_HEADER_STABLE_KEY, C as WorldBounds, F as boundsContain, G as clampWorldPosition, H as expandBoundsToMinimumPlayArea, I as mergeSnapshotWithPlayerChainNode, K as parsePlayerChainFanoutNotify, N as parsePlayerChainFanoutNotifyFromSsePayload, Q as parsePlayerChainNodeRpcBody, T as sortNodeRefsForSerializedFetch } from './browser-CD0Fu-zr.js';
1
+ export { A as AgentPlaySnapshot, C as CONTINUOUS_RENDER_OFFSET, D as DEFAULT_AGENT_SPAWN_MIN_DISTANCE, M as MINIMUM_PLAY_WORLD_BOUNDS, O as OCCUPANCY_POINT_MULTIPLIER, n as OccupancyGridPoint, q as PLAYER_CHAIN_GENESIS_STABLE_KEY, r as PLAYER_CHAIN_HEADER_STABLE_KEY, S as SPATIAL_ZONE_INDEX_AGENTS, H as SPATIAL_ZONE_INDEX_SPACES, K as WorldBounds, Q as boundingWorldRectForOccupancyPoints, T as boundsContain, U as buildRankedOccupancyPoints, V as buildRankedOccupancyPointsForSpatialZone, X as clampWorldPosition, _ as expandBoundsToMinimumPlayArea, $ as isAgentSpawnOccupancyPointAvailable, a0 as isSpaceAnchorOccupancyPointAvailable, a1 as listAllowedOccupancyPoints, a2 as listOccupancyPointsForSpatialZone, a3 as mergeSnapshotWithPlayerChainNode, a4 as occupancyKeyForPosition, a5 as occupancyPointsGroupedBySpatialZone, a6 as parsePlayerChainFanoutNotify, a7 as parsePlayerChainFanoutNotifyFromSsePayload, a8 as parsePlayerChainNodeRpcBody, a9 as pointCellInSpatialZone, aa as sortNodeRefsForSerializedFetch, ab as spatialZoneBounds, ac as spatialZoneCenter } from './browser-BQR40I8R.js';
package/dist/browser.js CHANGED
@@ -1,27 +1,61 @@
1
1
  import {
2
+ CONTINUOUS_RENDER_OFFSET,
3
+ DEFAULT_AGENT_SPAWN_MIN_DISTANCE,
2
4
  MINIMUM_PLAY_WORLD_BOUNDS,
5
+ OCCUPANCY_POINT_MULTIPLIER,
3
6
  PLAYER_CHAIN_GENESIS_STABLE_KEY,
4
7
  PLAYER_CHAIN_HEADER_STABLE_KEY,
8
+ SPATIAL_ZONE_INDEX_AGENTS,
9
+ SPATIAL_ZONE_INDEX_SPACES,
10
+ boundingWorldRectForOccupancyPoints,
5
11
  boundsContain,
12
+ buildRankedOccupancyPoints,
13
+ buildRankedOccupancyPointsForSpatialZone,
6
14
  clampWorldPosition,
7
15
  expandBoundsToMinimumPlayArea,
16
+ isAgentSpawnOccupancyPointAvailable,
17
+ isSpaceAnchorOccupancyPointAvailable,
18
+ listAllowedOccupancyPoints,
19
+ listOccupancyPointsForSpatialZone,
8
20
  mergeSnapshotWithPlayerChainNode,
21
+ occupancyKeyForPosition,
22
+ occupancyPointsGroupedBySpatialZone,
9
23
  parsePlayerChainFanoutNotify,
10
24
  parsePlayerChainFanoutNotifyFromSsePayload,
11
25
  parsePlayerChainNodeRpcBody,
12
- sortNodeRefsForSerializedFetch
13
- } from "./chunk-U2M7HNYN.js";
26
+ pointCellInSpatialZone,
27
+ sortNodeRefsForSerializedFetch,
28
+ spatialZoneBounds,
29
+ spatialZoneCenter
30
+ } from "./chunk-WWIEHWZZ.js";
14
31
  export {
32
+ CONTINUOUS_RENDER_OFFSET,
33
+ DEFAULT_AGENT_SPAWN_MIN_DISTANCE,
15
34
  MINIMUM_PLAY_WORLD_BOUNDS,
35
+ OCCUPANCY_POINT_MULTIPLIER,
16
36
  PLAYER_CHAIN_GENESIS_STABLE_KEY,
17
37
  PLAYER_CHAIN_HEADER_STABLE_KEY,
38
+ SPATIAL_ZONE_INDEX_AGENTS,
39
+ SPATIAL_ZONE_INDEX_SPACES,
40
+ boundingWorldRectForOccupancyPoints,
18
41
  boundsContain,
42
+ buildRankedOccupancyPoints,
43
+ buildRankedOccupancyPointsForSpatialZone,
19
44
  clampWorldPosition,
20
45
  expandBoundsToMinimumPlayArea,
46
+ isAgentSpawnOccupancyPointAvailable,
47
+ isSpaceAnchorOccupancyPointAvailable,
48
+ listAllowedOccupancyPoints,
49
+ listOccupancyPointsForSpatialZone,
21
50
  mergeSnapshotWithPlayerChainNode,
51
+ occupancyKeyForPosition,
52
+ occupancyPointsGroupedBySpatialZone,
22
53
  parsePlayerChainFanoutNotify,
23
54
  parsePlayerChainFanoutNotifyFromSsePayload,
24
55
  parsePlayerChainNodeRpcBody,
25
- sortNodeRefsForSerializedFetch
56
+ pointCellInSpatialZone,
57
+ sortNodeRefsForSerializedFetch,
58
+ spatialZoneBounds,
59
+ spatialZoneCenter
26
60
  };
27
61
  //# sourceMappingURL=browser.js.map