@agent-play/sdk 3.3.2 → 3.3.3
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/README.md +11 -0
- package/dist/browser-Dpx-0L8A.d.ts +1078 -0
- package/dist/browser.d.ts +2 -1
- package/dist/browser.js +73 -3
- package/dist/chunk-VWC7EE2F.js +5104 -0
- package/dist/chunk-VWC7EE2F.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +96 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/browser-BQR40I8R.d.ts +0 -480
- package/dist/chunk-WWIEHWZZ.js +0 -649
- package/dist/chunk-WWIEHWZZ.js.map +0 -1
|
@@ -1,480 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Domain types for sessions, journeys, agents, and the shared world map exposed by the SDK and server.
|
|
3
|
-
*/
|
|
4
|
-
/** Role for a single line in the interaction log / chat stream. */
|
|
5
|
-
type WorldInteractionRole = "user" | "assistant" | "tool";
|
|
6
|
-
/**
|
|
7
|
-
* Payload for {@link RemotePlayWorld.recordInteraction}.
|
|
8
|
-
*
|
|
9
|
-
* @property playerId - Player id returned from `addAgent` / `addPlayer`.
|
|
10
|
-
* @property role - Who "spoke" the line.
|
|
11
|
-
* @property text - Plain text; may be truncated for display server-side.
|
|
12
|
-
*/
|
|
13
|
-
type RecordInteractionInput = {
|
|
14
|
-
playerId: string;
|
|
15
|
-
role: WorldInteractionRole;
|
|
16
|
-
text: string;
|
|
17
|
-
};
|
|
18
|
-
/** How the watch UI should render and coerce a single assist tool argument. */
|
|
19
|
-
type AssistToolFieldType = "string" | "number" | "boolean";
|
|
20
|
-
/**
|
|
21
|
-
* Per-parameter metadata for assist tools. Legacy snapshots may omit `fieldType`; the UI treats that as `"string"`.
|
|
22
|
-
*/
|
|
23
|
-
type AssistToolParameterSpec = {
|
|
24
|
-
fieldType: AssistToolFieldType;
|
|
25
|
-
field?: string;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* Metadata for a tool whose name starts with `assist_`, shown as assist actions on the watch UI.
|
|
29
|
-
*
|
|
30
|
-
* @property parameters - Derived from Zod object `schema` when present: each key maps to
|
|
31
|
-
* {@link AssistToolParameterSpec} with `fieldType` from schema introspection. May include `_note` when no schema shape exists.
|
|
32
|
-
*/
|
|
33
|
-
type AssistToolSpec = {
|
|
34
|
-
name: string;
|
|
35
|
-
description: string;
|
|
36
|
-
parameters: Record<string, unknown>;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Serializable shape returned by {@link langchainRegistration} for agent registration.
|
|
40
|
-
*
|
|
41
|
-
* @property type - Always `"langchain"` for this adapter.
|
|
42
|
-
* @property toolNames - All tool names from the agent (must include `chat_tool`).
|
|
43
|
-
* @property assistTools - Subset of tools with `assist_` prefix, for UI buttons.
|
|
44
|
-
*/
|
|
45
|
-
type LangChainAgentRegistration = {
|
|
46
|
-
type: "langchain";
|
|
47
|
-
toolNames: string[];
|
|
48
|
-
assistTools?: AssistToolSpec[];
|
|
49
|
-
};
|
|
50
|
-
/** Minimal player identity in the SDK (without preview URL). */
|
|
51
|
-
type PlayAgentInformation = {
|
|
52
|
-
id: string;
|
|
53
|
-
name: string;
|
|
54
|
-
sid: string;
|
|
55
|
-
createdAt: Date;
|
|
56
|
-
updatedAt: Date;
|
|
57
|
-
};
|
|
58
|
-
/** Input fields for {@link AddAgentInput} / {@link AddPlayerInput} before `agent` is attached. */
|
|
59
|
-
type PlatformAgentInformation = {
|
|
60
|
-
name: string;
|
|
61
|
-
type: string;
|
|
62
|
-
version?: string;
|
|
63
|
-
createdAt?: Date;
|
|
64
|
-
updatedAt?: Date;
|
|
65
|
-
};
|
|
66
|
-
/**
|
|
67
|
-
* Register an automation agent in the world, tied to **agent node identity**.
|
|
68
|
-
*
|
|
69
|
-
* Use **`langchainRegistration(agent)`** for `agent` (requires a **`chat_tool`** tool; `assist_*`
|
|
70
|
-
* tools are indexed for the watch UI).
|
|
71
|
-
*
|
|
72
|
-
* **`nodeId`** is the **agent node id** (from **`agent-play create`** when the server uses a repository).
|
|
73
|
-
* It is sent on the wire as `agentId` for server compatibility; treating it as a node id makes the
|
|
74
|
-
* contract explicit for billing, validation, and event attribution.
|
|
75
|
-
*/
|
|
76
|
-
type P2aEnableFlag = "on" | "off";
|
|
77
|
-
type RealtimeWebrtcClientSecret = {
|
|
78
|
-
clientSecret: string;
|
|
79
|
-
expiresAt?: string;
|
|
80
|
-
model: string;
|
|
81
|
-
voice?: string;
|
|
82
|
-
};
|
|
83
|
-
/** OpenAI Realtime minting options used by {@link RemotePlayWorld.initAudio}. */
|
|
84
|
-
type RemotePlayWorldOpenAiAudioOptions = {
|
|
85
|
-
/** Server-side OpenAI key used to mint ephemeral browser client secrets. */
|
|
86
|
-
apiKey?: string;
|
|
87
|
-
/** Realtime model id, defaults to `gpt-realtime`. */
|
|
88
|
-
model?: string;
|
|
89
|
-
/** Realtime voice id, defaults to `marin`. */
|
|
90
|
-
voice?: string;
|
|
91
|
-
/** Explicit system instructions for the realtime session. */
|
|
92
|
-
instructions?: string;
|
|
93
|
-
/** Template fallback for instructions; `{{agentName}}` placeholder is supported. */
|
|
94
|
-
instructionsTemplate?: string;
|
|
95
|
-
};
|
|
96
|
-
/** Configuration payload for enabling SDK-managed realtime audio initialization. */
|
|
97
|
-
type RemotePlayWorldInitAudioOptions = {
|
|
98
|
-
openai: RemotePlayWorldOpenAiAudioOptions;
|
|
99
|
-
};
|
|
100
|
-
type AddAgentInput = PlatformAgentInformation & {
|
|
101
|
-
/** Registration from {@link langchainRegistration}. */
|
|
102
|
-
agent: LangChainAgentRegistration;
|
|
103
|
-
/** Main node id that owns the agent (required on repository-backed servers). */
|
|
104
|
-
mainNodeId?: string;
|
|
105
|
-
/** Agent node id — same value the server stores as registered `agentId`. */
|
|
106
|
-
nodeId: string;
|
|
107
|
-
/**
|
|
108
|
-
* When **`"on"`**, registration enables OpenAI Realtime provisioning for this agent.
|
|
109
|
-
* Omitted or **`"off"`** disables realtime voice for this registration.
|
|
110
|
-
*/
|
|
111
|
-
enableP2a?: P2aEnableFlag;
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* Register a player (agent) in the world.
|
|
115
|
-
*
|
|
116
|
-
* @deprecated Prefer {@link AddAgentInput} and `RemotePlayWorld.prototype.addAgent` for SDK and automation; use `nodeId` there instead of `agentId`.
|
|
117
|
-
*
|
|
118
|
-
* Use **`langchainRegistration(agent)`** for `agent` (requires a **`chat_tool`** tool; `assist_*`
|
|
119
|
-
* tools are indexed for the watch UI).
|
|
120
|
-
*
|
|
121
|
-
* **`agentId`** is required: use an id from **`agent-play create`** when the server uses a repository
|
|
122
|
-
* (with account **`passwHash`** from **`RemotePlayWorld`**), or any stable string for local dev without Redis.
|
|
123
|
-
*/
|
|
124
|
-
type AddPlayerInput = PlatformAgentInformation & {
|
|
125
|
-
/** Registration from {@link langchainRegistration}. */
|
|
126
|
-
agent: LangChainAgentRegistration;
|
|
127
|
-
/** Main node id that owns the agent (required on repository-backed servers). */
|
|
128
|
-
mainNodeId?: string;
|
|
129
|
-
/** Registered agent id (or session-local id without Redis). */
|
|
130
|
-
agentId: string;
|
|
131
|
-
/**
|
|
132
|
-
* When **`"on"`**, registration enables OpenAI Realtime provisioning for this agent.
|
|
133
|
-
* Omitted or **`"off"`** disables realtime voice for this registration.
|
|
134
|
-
*
|
|
135
|
-
* Same semantics as {@link AddAgentInput} **`enableP2a`**.
|
|
136
|
-
*/
|
|
137
|
-
enableP2a?: P2aEnableFlag;
|
|
138
|
-
};
|
|
139
|
-
/** Zone counter event surfaced on snapshots and signals. */
|
|
140
|
-
type ZoneEventInfo = {
|
|
141
|
-
zoneCount: number;
|
|
142
|
-
flagged?: boolean;
|
|
143
|
-
at: string;
|
|
144
|
-
};
|
|
145
|
-
/** Yield counter event surfaced on snapshots and signals. */
|
|
146
|
-
type YieldEventInfo = {
|
|
147
|
-
yieldCount: number;
|
|
148
|
-
at: string;
|
|
149
|
-
};
|
|
150
|
-
/** Repository-backed summary returned with `addAgent` when the agent is (or maps to) a stored registration. */
|
|
151
|
-
type RegisteredAgentSummary = {
|
|
152
|
-
agentId: string;
|
|
153
|
-
name: string;
|
|
154
|
-
toolNames: string[];
|
|
155
|
-
zoneCount: number;
|
|
156
|
-
yieldCount: number;
|
|
157
|
-
flagged: boolean;
|
|
158
|
-
};
|
|
159
|
-
/** Result of `addAgent` / `addPlayer` including watch URL and registered-agent metadata from the server. */
|
|
160
|
-
type RegisteredPlayer = PlayAgentInformation & {
|
|
161
|
-
previewUrl: string;
|
|
162
|
-
registeredAgent: RegisteredAgentSummary;
|
|
163
|
-
/** Echo of registration-time P2A flag (defaults to **`"off"`**). */
|
|
164
|
-
enableP2a: P2aEnableFlag;
|
|
165
|
-
/** Optional OpenAI Realtime WebRTC client-secret payload for browser-side direct voice. */
|
|
166
|
-
realtimeWebrtc?: RealtimeWebrtcClientSecret;
|
|
167
|
-
connectionId?: string;
|
|
168
|
-
leaseTtlSeconds?: number;
|
|
169
|
-
};
|
|
170
|
-
/** First step of a journey: user message origin. */
|
|
171
|
-
type OriginJourneyStep = {
|
|
172
|
-
type: "origin";
|
|
173
|
-
content: string;
|
|
174
|
-
messageId: string;
|
|
175
|
-
};
|
|
176
|
-
/** Middle step: tool invocation on the map. */
|
|
177
|
-
type StructureJourneyStep = {
|
|
178
|
-
type: "structure";
|
|
179
|
-
toolName: string;
|
|
180
|
-
toolCallId: string;
|
|
181
|
-
args: Record<string, unknown>;
|
|
182
|
-
result?: string;
|
|
183
|
-
};
|
|
184
|
-
/** Final step: assistant reply. */
|
|
185
|
-
type DestinationJourneyStep = {
|
|
186
|
-
type: "destination";
|
|
187
|
-
content: string;
|
|
188
|
-
messageId: string;
|
|
189
|
-
};
|
|
190
|
-
/** Union of journey step shapes. */
|
|
191
|
-
type JourneyStep = OriginJourneyStep | StructureJourneyStep | DestinationJourneyStep;
|
|
192
|
-
/**
|
|
193
|
-
* Ordered journey with timestamps; sent to the server via `recordJourney`.
|
|
194
|
-
*
|
|
195
|
-
* @property steps - Ordered path from origin through tool steps to destination.
|
|
196
|
-
* @property startedAt, completedAt - Wall times for the run (client or server).
|
|
197
|
-
*/
|
|
198
|
-
type Journey = {
|
|
199
|
-
steps: JourneyStep[];
|
|
200
|
-
startedAt: Date;
|
|
201
|
-
completedAt: Date;
|
|
202
|
-
};
|
|
203
|
-
/** Journey step after server assigns coordinates (and optional structure id). */
|
|
204
|
-
type PositionedStep = JourneyStep & {
|
|
205
|
-
x?: number;
|
|
206
|
-
y?: number;
|
|
207
|
-
structureId?: string;
|
|
208
|
-
};
|
|
209
|
-
type AgentPlayWorldMapBounds = {
|
|
210
|
-
minX: number;
|
|
211
|
-
minY: number;
|
|
212
|
-
maxX: number;
|
|
213
|
-
maxY: number;
|
|
214
|
-
};
|
|
215
|
-
/**
|
|
216
|
-
* One agent on the world map. Coordinates are grid positions; the server enforces unique `(x,y)` per occupant.
|
|
217
|
-
*/
|
|
218
|
-
type AgentPlayWorldMapAgentOccupant = {
|
|
219
|
-
kind: "agent";
|
|
220
|
-
nodeId?: string;
|
|
221
|
-
agentId: string;
|
|
222
|
-
name: string;
|
|
223
|
-
x: number;
|
|
224
|
-
y: number;
|
|
225
|
-
/**
|
|
226
|
-
* Integration label from addPlayer `type` (e.g. `langchain`). Populated from the snapshot field `platform`. The legacy wire field `agentType` is deprecated and accepted only for backward compatibility when parsing JSON.
|
|
227
|
-
*/
|
|
228
|
-
platform?: string;
|
|
229
|
-
toolNames?: string[];
|
|
230
|
-
assistToolNames?: string[];
|
|
231
|
-
assistTools?: AssistToolSpec[];
|
|
232
|
-
hasChatTool?: boolean;
|
|
233
|
-
enableP2a?: P2aEnableFlag;
|
|
234
|
-
realtimeInstructions?: string;
|
|
235
|
-
realtimeWebrtc?: RealtimeWebrtcClientSecret;
|
|
236
|
-
stationary?: boolean;
|
|
237
|
-
lastUpdate?: unknown;
|
|
238
|
-
recentInteractions?: Array<{
|
|
239
|
-
role: WorldInteractionRole;
|
|
240
|
-
text: string;
|
|
241
|
-
at: string;
|
|
242
|
-
seq: number;
|
|
243
|
-
}>;
|
|
244
|
-
zoneCount?: number;
|
|
245
|
-
yieldCount?: number;
|
|
246
|
-
flagged?: boolean;
|
|
247
|
-
onZone?: ZoneEventInfo;
|
|
248
|
-
onYield?: YieldEventInfo;
|
|
249
|
-
};
|
|
250
|
-
/** MCP server shown as a separate map occupant (distinct from LangChain agents). */
|
|
251
|
-
type AgentPlayWorldMapHumanOccupant = {
|
|
252
|
-
kind: "human";
|
|
253
|
-
id: string;
|
|
254
|
-
name: string;
|
|
255
|
-
x: number;
|
|
256
|
-
y: number;
|
|
257
|
-
interactive?: boolean;
|
|
258
|
-
};
|
|
259
|
-
/** MCP server shown as a separate map occupant (distinct from LangChain agents). */
|
|
260
|
-
type AgentPlayWorldMapMcpOccupant = {
|
|
261
|
-
kind: "mcp";
|
|
262
|
-
id: string;
|
|
263
|
-
name: string;
|
|
264
|
-
x: number;
|
|
265
|
-
y: number;
|
|
266
|
-
url?: string;
|
|
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
|
-
};
|
|
297
|
-
/** Spatial index: axis-aligned bounds plus every agent and MCP registration placed on the grid. */
|
|
298
|
-
type AgentPlayWorldMap = {
|
|
299
|
-
bounds: AgentPlayWorldMapBounds;
|
|
300
|
-
occupants: (AgentPlayWorldMapHumanOccupant | AgentPlayWorldMapAgentOccupant | AgentPlayWorldMapMcpOccupant | AgentPlayWorldMapStructureOccupant)[];
|
|
301
|
-
};
|
|
302
|
-
/**
|
|
303
|
-
* Session snapshot from {@link RemotePlayWorld.getWorldSnapshot}.
|
|
304
|
-
* Agents and MCP servers appear only under **`worldMap.occupants`** (no separate `players` list).
|
|
305
|
-
*/
|
|
306
|
-
type AgentPlaySnapshot = {
|
|
307
|
-
sid: string;
|
|
308
|
-
worldMap: AgentPlayWorldMap;
|
|
309
|
-
spaces?: AgentPlaySpaceCatalogEntry[];
|
|
310
|
-
mcpServers?: Array<{
|
|
311
|
-
id: string;
|
|
312
|
-
name: string;
|
|
313
|
-
url?: string;
|
|
314
|
-
}>;
|
|
315
|
-
};
|
|
316
|
-
type PlayerChainNotifyNodeRef = {
|
|
317
|
-
stableKey: string;
|
|
318
|
-
leafIndex: number;
|
|
319
|
-
removed?: boolean;
|
|
320
|
-
updatedAt?: string;
|
|
321
|
-
};
|
|
322
|
-
type PlayerChainFanoutNotify = {
|
|
323
|
-
updatedAt: string;
|
|
324
|
-
nodes: PlayerChainNotifyNodeRef[];
|
|
325
|
-
};
|
|
326
|
-
type PlayerChainGenesisStableKey = "__genesis__";
|
|
327
|
-
type PlayerChainHeaderStableKey = "__header__";
|
|
328
|
-
type PlayerChainGenesisNode = {
|
|
329
|
-
kind: "genesis";
|
|
330
|
-
stableKey: PlayerChainGenesisStableKey;
|
|
331
|
-
text: string;
|
|
332
|
-
};
|
|
333
|
-
type PlayerChainHeaderNode = {
|
|
334
|
-
kind: "header";
|
|
335
|
-
stableKey: PlayerChainHeaderStableKey;
|
|
336
|
-
sid: string;
|
|
337
|
-
bounds: AgentPlayWorldMapBounds;
|
|
338
|
-
};
|
|
339
|
-
type PlayerChainOccupantRemovedNode = {
|
|
340
|
-
kind: "occupant";
|
|
341
|
-
stableKey: string;
|
|
342
|
-
removed: true;
|
|
343
|
-
};
|
|
344
|
-
type PlayerChainOccupantPresentNode = {
|
|
345
|
-
kind: "occupant";
|
|
346
|
-
stableKey: string;
|
|
347
|
-
removed: false;
|
|
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;
|
|
360
|
-
};
|
|
361
|
-
type PlayerChainNodeResponse = PlayerChainGenesisNode | PlayerChainHeaderNode | PlayerChainOccupantRemovedNode | PlayerChainOccupantPresentNode | PlayerChainSpaceRemovedNode | PlayerChainSpacePresentNode;
|
|
362
|
-
/** Full journey + path update (SSE `world:journey`); coordinates are embedded in `path` steps. */
|
|
363
|
-
type WorldJourneyUpdate = {
|
|
364
|
-
playerId: string;
|
|
365
|
-
journey: Journey;
|
|
366
|
-
path: PositionedStep[];
|
|
367
|
-
};
|
|
368
|
-
|
|
369
|
-
/**
|
|
370
|
-
* Axis-aligned rectangle in world coordinates (grid units). Used by the server to clamp paths
|
|
371
|
-
* and by the watch UI to clamp joystick-driven movement.
|
|
372
|
-
*
|
|
373
|
-
* @remarks **Consumers:** {@link clampWorldPosition}, {@link boundsContain}; server `PlayWorld` and
|
|
374
|
-
* play-ui canvas both import these helpers from `@agent-play/sdk`.
|
|
375
|
-
*/
|
|
376
|
-
type WorldBounds = {
|
|
377
|
-
/** Inclusive minimum X. */
|
|
378
|
-
minX: number;
|
|
379
|
-
/** Inclusive minimum Y. */
|
|
380
|
-
minY: number;
|
|
381
|
-
/** Inclusive maximum X. */
|
|
382
|
-
maxX: number;
|
|
383
|
-
/** Inclusive maximum Y. */
|
|
384
|
-
maxY: number;
|
|
385
|
-
};
|
|
386
|
-
/** Minimum playable span aligned with the watch canvas scrolling world (~20×20 cells). */
|
|
387
|
-
declare const MINIMUM_PLAY_WORLD_BOUNDS: WorldBounds;
|
|
388
|
-
declare function expandBoundsToMinimumPlayArea(bounds: WorldBounds): WorldBounds;
|
|
389
|
-
/**
|
|
390
|
-
* Clamps a point to lie inside `bounds` along both axes.
|
|
391
|
-
*
|
|
392
|
-
* @param p - Position with `x` and `y` in world units.
|
|
393
|
-
* @param bounds - Valid rectangle (`min` ≤ `max` per axis).
|
|
394
|
-
* @returns Same point if inside, otherwise clamped to the nearest edge.
|
|
395
|
-
*
|
|
396
|
-
* @remarks **Callers:** server `PlayWorld` path enrichment; play-ui joystick and preview. **Callees:** `Math.min/Math.max`.
|
|
397
|
-
*/
|
|
398
|
-
declare function clampWorldPosition(p: {
|
|
399
|
-
x: number;
|
|
400
|
-
y: number;
|
|
401
|
-
}, bounds: WorldBounds): {
|
|
402
|
-
x: number;
|
|
403
|
-
y: number;
|
|
404
|
-
};
|
|
405
|
-
/**
|
|
406
|
-
* @returns Whether `p` lies inside or on the border of `bounds`.
|
|
407
|
-
*
|
|
408
|
-
* @remarks **Callers:** optional UI checks. **Callees:** none.
|
|
409
|
-
*/
|
|
410
|
-
declare function boundsContain(bounds: WorldBounds, p: {
|
|
411
|
-
x: number;
|
|
412
|
-
y: number;
|
|
413
|
-
}): boolean;
|
|
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
|
-
|
|
467
|
-
/**
|
|
468
|
-
* Parses **`playerChainNotify`** envelopes and merges {@link PlayerChainNodeResponse} slices into {@link AgentPlaySnapshot} (pure functions + fetch ordering for serialized RPC).
|
|
469
|
-
*/
|
|
470
|
-
|
|
471
|
-
declare function sortNodeRefsForSerializedFetch(nodes: ReadonlyArray<PlayerChainNotifyNodeRef>): PlayerChainNotifyNodeRef[];
|
|
472
|
-
declare function parsePlayerChainFanoutNotify(raw: unknown): PlayerChainFanoutNotify | undefined;
|
|
473
|
-
declare function parsePlayerChainFanoutNotifyFromSsePayload(sseData: unknown): PlayerChainFanoutNotify | undefined;
|
|
474
|
-
declare function parsePlayerChainNodeRpcBody(json: unknown): PlayerChainNodeResponse;
|
|
475
|
-
declare function mergeSnapshotWithPlayerChainNode(snapshot: AgentPlaySnapshot, node: PlayerChainNodeResponse): AgentPlaySnapshot;
|
|
476
|
-
|
|
477
|
-
declare const PLAYER_CHAIN_GENESIS_STABLE_KEY: "__genesis__";
|
|
478
|
-
declare const PLAYER_CHAIN_HEADER_STABLE_KEY: "__header__";
|
|
479
|
-
|
|
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 };
|