castle-web-cli 0.4.214 → 0.4.216
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/dist/agent-prompts.d.ts +13 -0
- package/dist/agent-prompts.js +82 -25
- package/dist/agent.d.ts +12 -0
- package/dist/agent.js +143 -35
- package/dist/api.d.ts +22 -0
- package/dist/api.js +31 -0
- package/dist/castle-host/host.d.ts +45 -0
- package/dist/castle-host/host.js +108 -0
- package/dist/castleJson.d.ts +12 -0
- package/dist/castleJson.js +58 -0
- package/dist/cloudGit.d.ts +120 -2
- package/dist/cloudGit.js +1461 -74
- package/dist/cloudGitServe.js +7 -4
- package/dist/gitRemote.d.ts +1 -0
- package/dist/gitRemote.js +1 -0
- package/dist/ide.js +2 -2
- package/dist/index.js +25 -4
- package/dist/init.js +1 -1
- package/dist/install.js +27 -22
- package/dist/routerFences.d.ts +6 -0
- package/dist/routerFences.js +70 -3
- package/dist/routerStops.d.ts +22 -0
- package/dist/routerStops.js +29 -0
- package/dist/save-deck.js +1 -0
- package/dist/shell/assets/{index-BcslKMfS.js → index-BZebTIjR.js} +46 -46
- package/dist/shell/index.html +1 -1
- package/kits/base/castle.json +1 -1
- package/kits/base/package-lock.json +1 -1
- package/kits/base/sdk/castle.d.ts +2 -2
- package/kits/base/sdk/commands.d.ts +15 -0
- package/kits/base/sdk/multiplayer.d.ts +106 -2
- package/kits/base/sdk/multiplayer.js +422 -12
- package/kits/base/sdk/multiplayerProtocol.d.ts +54 -2
- package/kits/base/sdk/server/platformHandle.d.ts +54 -0
- package/kits/base/sdk/server/wrapper.d.ts +79 -1
- package/kits/base/sdk/server/wrapper.js +372 -0
- package/kits/base/sdk/transport.js +1 -0
- package/package.json +2 -2
package/dist/shell/index.html
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<link rel="icon" type="image/png" sizes="32x32" href="/__castle/ide/favicon-32x32.png" />
|
|
11
11
|
<link rel="icon" type="image/png" sizes="16x16" href="/__castle/ide/favicon-16x16.png" />
|
|
12
12
|
<link rel="icon" href="/__castle/ide/favicon.ico" sizes="any" />
|
|
13
|
-
<script type="module" crossorigin src="/__castle/ide/assets/index-
|
|
13
|
+
<script type="module" crossorigin src="/__castle/ide/assets/index-BZebTIjR.js"></script>
|
|
14
14
|
<link rel="stylesheet" crossorigin href="/__castle/ide/assets/index-BPhS3Ysy.css">
|
|
15
15
|
</head>
|
|
16
16
|
<body>
|
package/kits/base/castle.json
CHANGED
|
@@ -14,9 +14,9 @@ export type { LeaderboardData, LeaderboardEntry, LeaderboardOptions, Leaderboard
|
|
|
14
14
|
export { Lifecycle } from "./lifecycle";
|
|
15
15
|
export type { CastleLifecycleApi } from "./lifecycle";
|
|
16
16
|
export { Multiplayer } from "./multiplayer";
|
|
17
|
-
export type { CastleMultiplayerApi, MultiplayerConnection, MultiplayerConnectionState, MultiplayerJoinOptions, MultiplayerRoster, MultiplayerStateMetadata, } from "./multiplayer";
|
|
17
|
+
export type { CastleMultiplayerApi, MultiplayerConnection, MultiplayerConnectionState, MultiplayerDestinationJoinResult, MultiplayerDestinationOptions, MultiplayerJoinOptions, MultiplayerRoster, MultiplayerStateMetadata, } from "./multiplayer";
|
|
18
18
|
export type { MultiplayerVoice, VoiceJoinStatus, VoiceListener, VoiceMixEntry, VoiceSpatialOptions, VoiceState, VoiceVector, } from "./multiplayerVoice";
|
|
19
|
-
export type { MultiplayerSoloReason } from "./commands";
|
|
19
|
+
export type { MultiplayerDestinationAudience, MultiplayerSoloReason } from "./commands";
|
|
20
20
|
export { MAX_CLIENT_FRAME_BYTES, MAX_PLAYERS_CAP } from "./multiplayerProtocol";
|
|
21
21
|
export type { ClientByeFrame, ClientHelloFrame, ClientMessageFrame, ClientPingFrame, ClientPongFrame, ClientReplacedFrame, ClientRosterFrame, ClientToPlatformFrame, ClientToPlatformMessageFrame, MultiplayerPlayer, PlayerIdentity, PlatformToClientFrame, SessionPlayer, SessionType, } from "./multiplayerProtocol";
|
|
22
22
|
export { registerParams } from "./paramsRegistry";
|
|
@@ -103,6 +103,19 @@ export interface MultiplayerGetSessionResult {
|
|
|
103
103
|
/** Internal local-serve scope for restoring this Play panel after a reload. */
|
|
104
104
|
devReconnectScope?: string;
|
|
105
105
|
}
|
|
106
|
+
export interface MultiplayerJoinDestinationParams {
|
|
107
|
+
routeId: string;
|
|
108
|
+
slot: string;
|
|
109
|
+
}
|
|
110
|
+
export type MultiplayerDestinationAudience = "player" | "party" | "public";
|
|
111
|
+
export type MultiplayerJoinDestinationStatus = "ok" | "cancelled" | "full" | "unavailable" | "not_found" | "forbidden" | "party_required";
|
|
112
|
+
export interface MultiplayerJoinDestinationResult {
|
|
113
|
+
status: MultiplayerJoinDestinationStatus;
|
|
114
|
+
url: string | null;
|
|
115
|
+
nonce: string | null;
|
|
116
|
+
sessionId: string | null;
|
|
117
|
+
audience: MultiplayerDestinationAudience | null;
|
|
118
|
+
}
|
|
106
119
|
export type VoiceState = "unavailable" | "off" | "joining" | "live";
|
|
107
120
|
export type VoiceJoinStatus = "joined" | "declined" | "unavailable";
|
|
108
121
|
export interface VoiceMixEntry {
|
|
@@ -327,6 +340,7 @@ export interface CommandParams {
|
|
|
327
340
|
style: HapticStyle;
|
|
328
341
|
};
|
|
329
342
|
"multiplayer.getSession": MultiplayerGetSessionParams;
|
|
343
|
+
"multiplayer.joinDestination": MultiplayerJoinDestinationParams;
|
|
330
344
|
"voice.getState": {
|
|
331
345
|
sessionId: string;
|
|
332
346
|
};
|
|
@@ -465,6 +479,7 @@ export interface CommandResult {
|
|
|
465
479
|
"portal.info": PortalInfoResult;
|
|
466
480
|
"haptics.play": HapticsResult;
|
|
467
481
|
"multiplayer.getSession": MultiplayerGetSessionResult;
|
|
482
|
+
"multiplayer.joinDestination": MultiplayerJoinDestinationResult;
|
|
468
483
|
"voice.getState": {
|
|
469
484
|
state: VoiceState;
|
|
470
485
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { MultiplayerSoloReason } from "./commands";
|
|
1
|
+
import type { MultiplayerDestinationAudience, MultiplayerSoloReason } from "./commands";
|
|
2
2
|
import { CastleError } from "./errors";
|
|
3
|
-
import {
|
|
3
|
+
import type { Json } from "./types";
|
|
4
|
+
import { type MultiplayerPlayer, type MultiplayerCharacterDisclosure, type MultiplayerCharacterTurnStatus } from "./multiplayerProtocol";
|
|
4
5
|
import { type MultiplayerVoice } from "./multiplayerVoice";
|
|
5
6
|
export type MultiplayerJoinOptions = {
|
|
6
7
|
mode: "named";
|
|
@@ -10,6 +11,17 @@ export type MultiplayerJoinOptions = {
|
|
|
10
11
|
} | {
|
|
11
12
|
mode: "public";
|
|
12
13
|
};
|
|
14
|
+
export interface MultiplayerDestinationOptions {
|
|
15
|
+
routeId: string;
|
|
16
|
+
slot: string;
|
|
17
|
+
}
|
|
18
|
+
export type MultiplayerDestinationJoinResult = {
|
|
19
|
+
status: "joined";
|
|
20
|
+
connection: MultiplayerConnection;
|
|
21
|
+
audience: MultiplayerDestinationAudience;
|
|
22
|
+
} | {
|
|
23
|
+
status: "cancelled" | "full" | "unavailable" | "not_found" | "forbidden" | "party_required";
|
|
24
|
+
};
|
|
13
25
|
export type MultiplayerConnectionState = "acquiring" | "connecting" | "connected" | "reconnecting" | "closed";
|
|
14
26
|
export type MultiplayerStateMetadata = {
|
|
15
27
|
type: "connectionLost";
|
|
@@ -28,6 +40,78 @@ export interface MultiplayerRoster {
|
|
|
28
40
|
players: MultiplayerPlayer[];
|
|
29
41
|
you: MultiplayerPlayer | null;
|
|
30
42
|
}
|
|
43
|
+
export interface MultiplayerCharacterAudience {
|
|
44
|
+
disclosure?: MultiplayerCharacterDisclosure;
|
|
45
|
+
playerIds?: string[];
|
|
46
|
+
characterIds?: string[];
|
|
47
|
+
}
|
|
48
|
+
export interface MultiplayerCharacterTurnRequest {
|
|
49
|
+
requestId: string;
|
|
50
|
+
operationId: string;
|
|
51
|
+
characterId: string;
|
|
52
|
+
input: string;
|
|
53
|
+
audience?: MultiplayerCharacterAudience;
|
|
54
|
+
}
|
|
55
|
+
export interface MultiplayerCharacterTurnAdmission {
|
|
56
|
+
operationId: string;
|
|
57
|
+
status: "queued" | "completed" | "interrupted";
|
|
58
|
+
replayed: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface MultiplayerCharacterTurnStatusResult {
|
|
61
|
+
operationId: string;
|
|
62
|
+
status: MultiplayerCharacterTurnStatus;
|
|
63
|
+
jobStatus: MultiplayerCharacterTurnStatus;
|
|
64
|
+
turnStatus: "admitted" | "reply_committed" | "completed" | "interrupted";
|
|
65
|
+
response?: string;
|
|
66
|
+
progress?: {
|
|
67
|
+
response: string;
|
|
68
|
+
};
|
|
69
|
+
replayed: boolean;
|
|
70
|
+
}
|
|
71
|
+
export type MultiplayerWorldCharacterCommand = {
|
|
72
|
+
type: "perform_action";
|
|
73
|
+
characterId: string;
|
|
74
|
+
actionId: string;
|
|
75
|
+
parameters?: Json;
|
|
76
|
+
consentQuote?: string;
|
|
77
|
+
} | {
|
|
78
|
+
type: "record_event";
|
|
79
|
+
eventTypeId: string;
|
|
80
|
+
data?: Json;
|
|
81
|
+
};
|
|
82
|
+
export type MultiplayerWorldCharacterQuery = {
|
|
83
|
+
type: "inspect";
|
|
84
|
+
} | {
|
|
85
|
+
type: "status";
|
|
86
|
+
operationId: string;
|
|
87
|
+
} | {
|
|
88
|
+
type: "history";
|
|
89
|
+
characterId?: string;
|
|
90
|
+
limit?: number;
|
|
91
|
+
cursor?: string;
|
|
92
|
+
};
|
|
93
|
+
/** Authenticated, participant-scoped projection of a shared character world. */
|
|
94
|
+
export interface MultiplayerWorldCharacterInspectResult<Gameplay = unknown, SharedState = unknown, PrivateState = unknown, Source = unknown> {
|
|
95
|
+
/** Durable identity used by gameplay holders and promise debtors. */
|
|
96
|
+
participantId: string;
|
|
97
|
+
worldRevision: string;
|
|
98
|
+
gameplay: Gameplay;
|
|
99
|
+
characters: Array<{
|
|
100
|
+
characterId: string;
|
|
101
|
+
npcRevision: string;
|
|
102
|
+
sharedState: SharedState;
|
|
103
|
+
privateState: PrivateState;
|
|
104
|
+
privateRevision: string;
|
|
105
|
+
}>;
|
|
106
|
+
sources: Source[];
|
|
107
|
+
}
|
|
108
|
+
export interface MultiplayerWorldCharacterCommandResult {
|
|
109
|
+
operationId: string;
|
|
110
|
+
status: "applied" | "ineligible";
|
|
111
|
+
replayed: boolean;
|
|
112
|
+
result: unknown;
|
|
113
|
+
worldRevision: string;
|
|
114
|
+
}
|
|
31
115
|
export interface MultiplayerConnection {
|
|
32
116
|
readonly state: MultiplayerConnectionState;
|
|
33
117
|
readonly playerId: string;
|
|
@@ -40,6 +124,25 @@ export interface MultiplayerConnection {
|
|
|
40
124
|
readonly soloReason: MultiplayerSoloReason | null;
|
|
41
125
|
/** Sends byte payloads as binary frames and all other payloads as JSON. */
|
|
42
126
|
send(data: unknown): void;
|
|
127
|
+
/** Requests one billed character turn through this authenticated world socket. */
|
|
128
|
+
requestCharacterTurn(request: MultiplayerCharacterTurnRequest): Promise<MultiplayerCharacterTurnAdmission>;
|
|
129
|
+
/** Recovers the durable status of a prior operation after reconnecting. */
|
|
130
|
+
getCharacterTurnStatus(operationId: string): Promise<MultiplayerCharacterTurnStatusResult>;
|
|
131
|
+
requestCharacterCommand(request: {
|
|
132
|
+
requestId: string;
|
|
133
|
+
operationId: string;
|
|
134
|
+
command: MultiplayerWorldCharacterCommand;
|
|
135
|
+
}): Promise<MultiplayerWorldCharacterCommandResult>;
|
|
136
|
+
readCharacters(request: {
|
|
137
|
+
requestId: string;
|
|
138
|
+
query: {
|
|
139
|
+
type: "inspect";
|
|
140
|
+
};
|
|
141
|
+
}): Promise<MultiplayerWorldCharacterInspectResult>;
|
|
142
|
+
readCharacters<T = unknown>(request: {
|
|
143
|
+
requestId: string;
|
|
144
|
+
query: MultiplayerWorldCharacterQuery;
|
|
145
|
+
}): Promise<T>;
|
|
43
146
|
/** Receives binary payloads as Uint8Array values and JSON payloads otherwise. */
|
|
44
147
|
onMessage(callback: (data: unknown) => void): () => void;
|
|
45
148
|
onRoster(callback: (roster: MultiplayerRoster) => void): () => void;
|
|
@@ -50,5 +153,6 @@ export interface MultiplayerConnection {
|
|
|
50
153
|
}
|
|
51
154
|
export interface CastleMultiplayerApi {
|
|
52
155
|
join(options: MultiplayerJoinOptions): Promise<MultiplayerConnection>;
|
|
156
|
+
joinDestination(options: MultiplayerDestinationOptions): Promise<MultiplayerDestinationJoinResult>;
|
|
53
157
|
}
|
|
54
158
|
export declare const Multiplayer: CastleMultiplayerApi;
|