@dcl/sdk-commands 7.29.1-35861881691.commit-e4e55e9 → 7.29.1-35862852104.commit-1f44e80

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.
Files changed (67) hide show
  1. package/dist/commands/sdk-server-logs/index.d.ts +24 -0
  2. package/dist/commands/sdk-server-logs/index.js +313 -0
  3. package/dist/commands/sdk-server-logs/index.js.map +1 -0
  4. package/dist/commands/start/dcl-env.d.ts +16 -0
  5. package/dist/commands/start/dcl-env.js +51 -0
  6. package/dist/commands/start/dcl-env.js.map +1 -0
  7. package/dist/commands/start/index.d.ts +1 -0
  8. package/dist/commands/start/index.js +24 -6
  9. package/dist/commands/start/index.js.map +1 -1
  10. package/dist/commands/start/multiplayer-server.d.ts +35 -0
  11. package/dist/commands/start/multiplayer-server.js +244 -0
  12. package/dist/commands/start/multiplayer-server.js.map +1 -0
  13. package/dist/commands/start/server/routes.d.ts +1 -1
  14. package/dist/commands/start/server/routes.js +6 -2
  15. package/dist/commands/start/server/routes.js.map +1 -1
  16. package/dist/commands/start/server/runtime-env.d.ts +71 -0
  17. package/dist/commands/start/server/runtime-env.js +253 -0
  18. package/dist/commands/start/server/runtime-env.js.map +1 -0
  19. package/dist/commands/start/server/storage-service.d.ts +8 -0
  20. package/dist/commands/start/server/storage-service.js +156 -0
  21. package/dist/commands/start/server/storage-service.js.map +1 -0
  22. package/dist/commands/start/utils.d.ts +32 -0
  23. package/dist/commands/start/utils.js +72 -0
  24. package/dist/commands/start/utils.js.map +1 -1
  25. package/dist/commands/storage/env.d.ts +5 -0
  26. package/dist/commands/storage/env.js +86 -0
  27. package/dist/commands/storage/env.js.map +1 -0
  28. package/dist/commands/storage/index.d.ts +26 -0
  29. package/dist/commands/storage/index.js +142 -0
  30. package/dist/commands/storage/index.js.map +1 -0
  31. package/dist/commands/storage/player.d.ts +5 -0
  32. package/dist/commands/storage/player.js +143 -0
  33. package/dist/commands/storage/player.js.map +1 -0
  34. package/dist/commands/storage/scene.d.ts +5 -0
  35. package/dist/commands/storage/scene.js +105 -0
  36. package/dist/commands/storage/scene.js.map +1 -0
  37. package/dist/commands/storage/shared.d.ts +62 -0
  38. package/dist/commands/storage/shared.js +260 -0
  39. package/dist/commands/storage/shared.js.map +1 -0
  40. package/dist/commands/storage/types.d.ts +56 -0
  41. package/dist/commands/storage/types.js +23 -0
  42. package/dist/commands/storage/types.js.map +1 -0
  43. package/dist/components/analytics.d.ts +75 -1
  44. package/dist/components/analytics.js +3 -2
  45. package/dist/components/analytics.js.map +1 -1
  46. package/dist/logic/auth-chain-headers.d.ts +11 -0
  47. package/dist/logic/auth-chain-headers.js +25 -0
  48. package/dist/logic/auth-chain-headers.js.map +1 -0
  49. package/dist/logic/bundle.js +31 -0
  50. package/dist/logic/bundle.js.map +1 -1
  51. package/dist/logic/config.d.ts +1 -0
  52. package/dist/logic/config.js +7 -0
  53. package/dist/logic/config.js.map +1 -1
  54. package/dist/logic/error.d.ts +1 -1
  55. package/dist/logic/error.js.map +1 -1
  56. package/dist/logic/exec.d.ts +1 -0
  57. package/dist/logic/exec.js +2 -2
  58. package/dist/logic/exec.js.map +1 -1
  59. package/dist/logic/lang.js +1 -1
  60. package/dist/logic/lsd-realm.d.ts +5 -0
  61. package/dist/logic/lsd-realm.js +28 -0
  62. package/dist/logic/lsd-realm.js.map +1 -0
  63. package/dist/logic/project-files.js +2 -0
  64. package/dist/logic/project-files.js.map +1 -1
  65. package/dist/logic/scene-validations.d.ts +8 -1
  66. package/dist/logic/scene-validations.js.map +1 -1
  67. package/package.json +3 -3
@@ -0,0 +1,24 @@
1
+ import { Result } from 'arg';
2
+ import { CliComponents } from '../../components';
3
+ interface Options {
4
+ args: Result<typeof args>;
5
+ components: CliComponents;
6
+ }
7
+ export declare const args: {
8
+ '--help': BooleanConstructor;
9
+ '-h': string;
10
+ '--dir': StringConstructor;
11
+ '--world': StringConstructor;
12
+ '-w': string;
13
+ '--position': StringConstructor;
14
+ '--target': StringConstructor;
15
+ '-t': string;
16
+ '--port': NumberConstructor;
17
+ '-p': string;
18
+ '--https': BooleanConstructor;
19
+ '--no-browser': BooleanConstructor;
20
+ '-b': string;
21
+ };
22
+ export declare function help(options: Options): void;
23
+ export declare function main(options: Options): Promise<void>;
24
+ export {};
@@ -0,0 +1,313 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.args = void 0;
7
+ exports.help = help;
8
+ exports.main = main;
9
+ const path_1 = require("path");
10
+ const fp_future_1 = __importDefault(require("fp-future"));
11
+ const crypto_1 = require("@dcl/crypto");
12
+ const crypto_2 = require("@dcl/crypto/dist/crypto");
13
+ const eth_connect_1 = require("eth-connect");
14
+ const args_1 = require("../../logic/args");
15
+ const error_1 = require("../../logic/error");
16
+ const beautiful_logs_1 = require("../../logic/beautiful-logs");
17
+ const account_1 = require("../../logic/account");
18
+ const auth_chain_headers_1 = require("../../logic/auth-chain-headers");
19
+ const routes_1 = require("../../linker-dapp/routes");
20
+ const run_dapp_1 = require("../../run-dapp");
21
+ const workspace_validations_1 = require("../../logic/workspace-validations");
22
+ const scene_validations_1 = require("../../logic/scene-validations");
23
+ exports.args = (0, args_1.declareArgs)({
24
+ '--help': Boolean,
25
+ '-h': '--help',
26
+ '--dir': String,
27
+ '--world': String,
28
+ '-w': '--world',
29
+ '--position': String,
30
+ '--target': String,
31
+ '-t': '--target',
32
+ '--port': Number,
33
+ '-p': '--port',
34
+ '--https': Boolean,
35
+ '--no-browser': Boolean,
36
+ '-b': '--no-browser'
37
+ });
38
+ const DEFAULT_SERVER = 'https://multiplayer-server.decentraland.org';
39
+ function help(options) {
40
+ options.components.logger.log(`
41
+ Usage: 'sdk-commands sdk-server-logs [options]'
42
+ Streams real-time logs from the multiplayer server.
43
+ Runs from any directory when --world and/or --position are provided.
44
+ Falls back to scene.json (worldConfiguration.name) when neither is passed.
45
+
46
+ Options:
47
+ -h, --help Displays complete help
48
+ -w, --world [name] World name. When omitted, --position targets Genesis City.
49
+ --position [x,y] Parcel coordinates. Optional for worlds (selects a scene
50
+ in a multi-scene world). Required for Genesis City.
51
+ -t, --target [URL] Target multiplayer server URL (default: ${DEFAULT_SERVER})
52
+ --dir [path] Path to the project directory (used with scene.json fallback)
53
+ -p, --port [port] Select a custom port for the linker dApp
54
+ -b, --no-browser Do not open a new browser window
55
+ --https Use HTTPS for the linker dApp
56
+
57
+ Examples:
58
+ - View logs using the world in the current scene.json:
59
+ $ sdk-commands sdk-server-logs
60
+
61
+ - View logs for a world from any directory:
62
+ $ sdk-commands sdk-server-logs --world myworld.dcl.eth
63
+
64
+ - View logs for a specific scene in a multi-scene world:
65
+ $ sdk-commands sdk-server-logs --world myworld.dcl.eth --position 10,10
66
+
67
+ - View logs for a Genesis City scene (use =value form for negative coords):
68
+ $ sdk-commands sdk-server-logs --position=-125,-96
69
+
70
+ - Connect to a custom server:
71
+ $ sdk-commands sdk-server-logs --world myworld --target https://multiplayer-server.decentraland.zone
72
+
73
+ - Use private key for authentication (no browser):
74
+ $ DCL_PRIVATE_KEY=0x... sdk-commands sdk-server-logs --world myworld
75
+ `);
76
+ }
77
+ function setServerLogsRoutes(router, components, awaitResponse, signCallback) {
78
+ const { logger } = components;
79
+ const resolveLinkerPromise = () => setTimeout(() => awaitResponse.resolve(), 100);
80
+ const rejectLinkerPromise = (e) => setTimeout(() => awaitResponse.reject(e), 100);
81
+ router.post('/api/logs', async (ctx) => {
82
+ const value = (await ctx.request.json());
83
+ if (!value.address || !value.authChain) {
84
+ const errorMessage = `Invalid payload: ${Object.keys(value).join(' - ')}`;
85
+ logger.error(errorMessage);
86
+ resolveLinkerPromise();
87
+ return { status: 400, body: { success: false, error: errorMessage } };
88
+ }
89
+ try {
90
+ await signCallback(value);
91
+ resolveLinkerPromise();
92
+ return { body: { success: true } };
93
+ }
94
+ catch (e) {
95
+ rejectLinkerPromise(e);
96
+ return { status: 400, body: { success: false, error: e.message } };
97
+ }
98
+ });
99
+ return router;
100
+ }
101
+ async function getAddressAndSignature(components, awaitResponse, payload, displayLabel, targetUrl, linkOptions, signCallback) {
102
+ // If DCL_PRIVATE_KEY is set, sign directly without the linker dapp
103
+ if (process.env.DCL_PRIVATE_KEY) {
104
+ const wallet = (0, account_1.createWallet)(process.env.DCL_PRIVATE_KEY);
105
+ const authChain = crypto_1.Authenticator.createSimpleAuthChain(payload, wallet.address, (0, crypto_2.ethSign)((0, eth_connect_1.hexToBytes)(wallet.privateKey), payload));
106
+ const linkerResponse = { authChain, address: wallet.address };
107
+ await signCallback(linkerResponse);
108
+ awaitResponse.resolve();
109
+ return {};
110
+ }
111
+ // Use linker dapp for signing - pass the payload as the rootCID
112
+ const { router: commonRouter } = (0, routes_1.setRoutes)(components, {
113
+ rootCID: payload,
114
+ baseParcel: '0,0',
115
+ parcels: ['0,0'],
116
+ skipValidations: true,
117
+ debug: !!process.env.DEBUG,
118
+ isWorld: true,
119
+ world: displayLabel,
120
+ targetUrl,
121
+ action: 'view-logs'
122
+ });
123
+ const router = setServerLogsRoutes(commonRouter, components, awaitResponse, signCallback);
124
+ components.logger.info('You need to sign to access server logs');
125
+ const { program } = await (0, run_dapp_1.runDapp)(components, router, { ...linkOptions, uri: `/` });
126
+ return { program };
127
+ }
128
+ async function streamLogs(components, logsUrl, authHeaders) {
129
+ const { logger, fetch: fetchComponent } = components;
130
+ logger.info('\nConnecting to server logs...');
131
+ try {
132
+ const response = await fetchComponent.fetch(logsUrl, {
133
+ method: 'GET',
134
+ headers: {
135
+ ...authHeaders,
136
+ Accept: 'text/event-stream'
137
+ }
138
+ });
139
+ if (!response.ok) {
140
+ const errorText = await response.text();
141
+ throw new Error(`Server returned ${response.status}: ${errorText}`);
142
+ }
143
+ const contentType = response.headers.get('content-type') || '';
144
+ if (!contentType.includes('text/event-stream') && !contentType.includes('application/stream')) {
145
+ throw new Error('Server does not support SSE streaming');
146
+ }
147
+ logger.info('Streaming logs in real-time (press CTRL+C to stop)');
148
+ if (response.body) {
149
+ const decoder = new TextDecoder();
150
+ let buffer = '';
151
+ for await (const chunk of response.body) {
152
+ buffer += decoder.decode(chunk, { stream: true });
153
+ const lines = buffer.split('\n');
154
+ buffer = lines.pop() || '';
155
+ for (const line of lines) {
156
+ if (line.trim()) {
157
+ formatAndPrintLog(logger, line);
158
+ }
159
+ }
160
+ }
161
+ }
162
+ logger.info('\n======================= End Scene Logs =======================');
163
+ }
164
+ catch (e) {
165
+ (0, beautiful_logs_1.printError)(logger, 'Failed to stream logs:', e);
166
+ process.exit(1);
167
+ }
168
+ }
169
+ function formatAndPrintLog(logger, log) {
170
+ // If log is a string, try to parse as JSON
171
+ let logObj = log;
172
+ if (typeof log === 'string') {
173
+ try {
174
+ logObj = JSON.parse(log);
175
+ }
176
+ catch {
177
+ // If not JSON, just print the string
178
+ logger.log(log);
179
+ return;
180
+ }
181
+ }
182
+ // Extract common log fields
183
+ const timestamp = logObj.timestamp || logObj.time || new Date().toISOString();
184
+ const level = (logObj.level || logObj.severity || 'INFO').toUpperCase();
185
+ const message = logObj.message || logObj.msg || JSON.stringify(logObj);
186
+ // Format timestamp
187
+ const date = new Date(timestamp);
188
+ const formattedTime = date.toISOString().replace('T', ' ').substring(0, 19);
189
+ // Format the log message with timestamp
190
+ const formattedMessage = `[${formattedTime}] [${level}] ${message}`;
191
+ // Map log levels to logger methods
192
+ const normalizedLevel = level.toLowerCase();
193
+ switch (normalizedLevel) {
194
+ case 'error':
195
+ logger.error(formattedMessage);
196
+ break;
197
+ case 'warn':
198
+ case 'warning':
199
+ logger.warn(formattedMessage);
200
+ break;
201
+ case 'debug':
202
+ logger.debug(formattedMessage);
203
+ break;
204
+ case 'info':
205
+ case 'trace':
206
+ default:
207
+ logger.info(formattedMessage);
208
+ break;
209
+ }
210
+ // If there are additional fields, print them
211
+ const additionalFields = Object.keys(logObj).filter((key) => !['timestamp', 'time', 'level', 'severity', 'message', 'msg'].includes(key));
212
+ if (additionalFields.length > 0) {
213
+ const additional = {};
214
+ additionalFields.forEach((key) => {
215
+ additional[key] = logObj[key];
216
+ });
217
+ logger.log(` ${JSON.stringify(additional)}`);
218
+ }
219
+ }
220
+ function normalizePosition(raw) {
221
+ const match = raw.trim().match(/^(-?\d+)\s*,\s*(-?\d+)$/);
222
+ if (!match) {
223
+ throw new error_1.CliError('SERVER_LOGS_INVALID_POSITION', `Invalid --position "${raw}"; expected "x,y" with integer coordinates`);
224
+ }
225
+ return `${parseInt(match[1], 10)},${parseInt(match[2], 10)}`;
226
+ }
227
+ /**
228
+ * Build the HTTP request shape for the multiplayer-server `/logs` endpoint.
229
+ *
230
+ * Every call targets the same `/logs` route; the server picks the scene from
231
+ * the signed metadata:
232
+ * - worlds → `sceneId: "<world>.dcl.eth"` (+ `parcel` for multi-scene worlds)
233
+ * - Genesis → `parcel: "x,y"` only
234
+ *
235
+ * `parcel` and `realmName` are always set. `realmName` defaults to `"main"` for
236
+ * Genesis, matching the convention used by other signed-fetch emitters
237
+ * (hammurabi worker, unity explorer, kernel).
238
+ */
239
+ function buildLogsRequest(baseURL, world, position) {
240
+ const metadata = JSON.stringify({
241
+ parcel: position ?? '0,0',
242
+ realmName: world ? `${world}.dcl.eth` : 'main',
243
+ ...(world && { sceneId: `${world}.dcl.eth` })
244
+ });
245
+ return {
246
+ logsUrl: `${baseURL}/logs`,
247
+ pathname: '/logs',
248
+ metadata
249
+ };
250
+ }
251
+ async function main(options) {
252
+ const { logger } = options.components;
253
+ const projectRoot = (0, path_1.resolve)(process.cwd(), options.args['--dir'] || '.');
254
+ const positionArg = options.args['--position'];
255
+ const worldArg = options.args['--world'];
256
+ const position = positionArg ? normalizePosition(positionArg) : undefined;
257
+ let world;
258
+ if (worldArg) {
259
+ world = worldArg.replace(/\.dcl\.eth$/i, '');
260
+ }
261
+ else if (!position) {
262
+ // no --world nor --position: fall back to scene.json in the current directory
263
+ await (0, workspace_validations_1.getValidWorkspace)(options.components, projectRoot);
264
+ const sceneJson = await (0, scene_validations_1.getValidSceneJson)(options.components, projectRoot);
265
+ const worldName = sceneJson.worldConfiguration?.name;
266
+ if (!worldName) {
267
+ throw new error_1.CliError('SERVER_LOGS_MISSING_WORLD', 'Provide --world (with optional --position) for worlds, or --position alone for Genesis City scenes. ' +
268
+ 'Alternatively, run from a project whose scene.json defines worldConfiguration.name.');
269
+ }
270
+ world = worldName.replace(/\.dcl\.eth$/i, '');
271
+ }
272
+ const displayLabel = world
273
+ ? position
274
+ ? `${world}.dcl.eth ${position}`
275
+ : `${world}.dcl.eth`
276
+ : `Genesis City ${position}`;
277
+ logger.info(`Viewing logs for ${displayLabel}`);
278
+ const baseURL = options.args['--target'] || DEFAULT_SERVER;
279
+ const { logsUrl, pathname, metadata } = buildLogsRequest(baseURL, world, position);
280
+ // Linker dApp options
281
+ const linkerPort = options.args['--port'];
282
+ const openBrowser = !options.args['--no-browser'];
283
+ const isHttps = !!options.args['--https'];
284
+ const linkOptions = { linkerPort, openBrowser, isHttps };
285
+ const awaitResponse = (0, fp_future_1.default)();
286
+ const timestamp = String(Date.now());
287
+ // Build the payload to sign: method:path:timestamp:metadata
288
+ const payload = ['get', pathname, timestamp, metadata].join(':').toLowerCase();
289
+ let authHeaders = {};
290
+ const { program } = await getAddressAndSignature(options.components, awaitResponse, payload, displayLabel, baseURL, linkOptions, async (linkerResponse) => {
291
+ authHeaders = (0, auth_chain_headers_1.createAuthChainHeaders)(linkerResponse.authChain, timestamp, metadata);
292
+ });
293
+ try {
294
+ await awaitResponse;
295
+ logger.info('Authentication successful!');
296
+ // Close the browser window
297
+ if (program) {
298
+ await program.stop();
299
+ }
300
+ // Start streaming logs
301
+ await streamLogs(options.components, logsUrl, authHeaders);
302
+ }
303
+ catch (e) {
304
+ (0, beautiful_logs_1.printError)(logger, 'Failed to authenticate:', e);
305
+ throw e;
306
+ }
307
+ finally {
308
+ if (program) {
309
+ void program.stop();
310
+ }
311
+ }
312
+ }
313
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/sdk-server-logs/index.ts"],"names":[],"mappings":";;;;;;AA2CA,oBAqCC;AA2OD,oBAmFC;AA9YD,+BAA8B;AAE9B,0DAA2C;AAC3C,wCAA2C;AAC3C,oDAAiD;AACjD,6CAAwC;AAIxC,2CAA8C;AAE9C,6CAA4C;AAC5C,+DAAuD;AACvD,iDAAkD;AAClD,uEAAuE;AACvE,qDAAoE;AACpE,6CAAqD;AACrD,6EAAqE;AACrE,qEAAiE;AAOpD,QAAA,IAAI,GAAG,IAAA,kBAAW,EAAC;IAC9B,QAAQ,EAAE,OAAO;IACjB,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,MAAM;IACf,SAAS,EAAE,MAAM;IACjB,IAAI,EAAE,SAAS;IACf,YAAY,EAAE,MAAM;IACpB,UAAU,EAAE,MAAM;IAClB,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,MAAM;IAChB,IAAI,EAAE,QAAQ;IACd,SAAS,EAAE,OAAO;IAClB,cAAc,EAAE,OAAO;IACvB,IAAI,EAAE,cAAc;CACrB,CAAC,CAAA;AAEF,MAAM,cAAc,GAAG,6CAA6C,CAAA;AAEpE,SAAgB,IAAI,CAAC,OAAgB;IACnC,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,CAAC;;;;;;;;;;;0EAW0C,cAAc;;;;;;;;;;;;;;;;;;;;;;;;CAwBvF,CAAC,CAAA;AACF,CAAC;AAED,SAAS,mBAAmB,CAC1B,MAAsB,EACtB,UAAyB,EACzB,aAA4B,EAC5B,YAAyD;IAEzD,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAA;IAE7B,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,OAAO,EAAE,EAAE,GAAG,CAAC,CAAA;IACjF,MAAM,mBAAmB,GAAG,CAAC,CAAQ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E,CAAA;QACtB,CAAC;QAED,uBAAuB;QACvB,MAAM,UAAU,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAA;IAC5D,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAA,2BAAU,EAAC,MAAM,EAAE,yBAAyB,EAAE,CAAU,CAAC,CAAA;QACzD,MAAM,CAAC,CAAA;IACT,CAAC;YAAS,CAAC;QACT,IAAI,OAAO,EAAE,CAAC;YACZ,KAAK,OAAO,CAAC,IAAI,EAAE,CAAA;QACrB,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare function webExplorerBaseUrl(dclenv: string): string;
2
+ /** Extra query params for the web client under a non-default environment. */
3
+ export declare function webExplorerEnvParams(dclenv: string): string;
4
+ /**
5
+ * Environment args for the locally-spawned engine. `--base-domain` re-points every backend
6
+ * host the engine composes, Pulse included; the gatekeeper pin is the temporary exception.
7
+ */
8
+ export declare function engineEnvArgs(dclenv: string): string[];
9
+ /** Pulse endpoint for deep-linked native clients (ENet); undefined = the client's default. */
10
+ export declare function pulseServerNative(dclenv: string): string | undefined;
11
+ /**
12
+ * Pulse params for the mobile preview deep link: the LSD realm key — stated explicitly so a
13
+ * phone-side explorer can join the partition without re-deriving it — plus the environment's
14
+ * Pulse endpoint when it is not the production default.
15
+ */
16
+ export declare function lsdDeepLinkPulseParams(projectRoot: string, dclenv: string): string;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.webExplorerBaseUrl = webExplorerBaseUrl;
4
+ exports.webExplorerEnvParams = webExplorerEnvParams;
5
+ exports.engineEnvArgs = engineEnvArgs;
6
+ exports.pulseServerNative = pulseServerNative;
7
+ exports.lsdDeepLinkPulseParams = lsdDeepLinkPulseParams;
8
+ // Everything `--dclenv` selects for the preview lives here. The default (org) needs no
9
+ // overrides. Zone runs its OWN Pulse server with identical realm names, so a zone preview
10
+ // must land every party on it: the zone-hosted web client and a --base-domain zone engine
11
+ // derive `pulse-server.decentraland.zone` themselves (bevy-explorer#1224); only parties
12
+ // with no zone base domain — native clients launched by deep link — need it stated.
13
+ const lsd_realm_1 = require("../../logic/lsd-realm");
14
+ function webExplorerBaseUrl(dclenv) {
15
+ // bevy-web is deployed on decentraland.org and decentraland.zone only; the zone page
16
+ // resolves its base domain from its own host, which re-points its Pulse fallback too
17
+ return `https://decentraland.${dclenv === 'zone' ? 'zone' : 'org'}/bevy-web/`;
18
+ }
19
+ // TEMPORARY: the preview gatekeeper has no zone deployment yet, so zone launches pin that
20
+ // one service back to org — server and web client alike — or scene-room minting fails.
21
+ // Drop both pins once comms-gatekeeper-local is deployed on zone.
22
+ const ORG_PREVIEW_GATEKEEPER = 'https://comms-gatekeeper-local.decentraland.org';
23
+ /** Extra query params for the web client under a non-default environment. */
24
+ function webExplorerEnvParams(dclenv) {
25
+ if (dclenv !== 'zone')
26
+ return '';
27
+ return `&previewGatekeeper=${encodeURIComponent(ORG_PREVIEW_GATEKEEPER)}`;
28
+ }
29
+ /**
30
+ * Environment args for the locally-spawned engine. `--base-domain` re-points every backend
31
+ * host the engine composes, Pulse included; the gatekeeper pin is the temporary exception.
32
+ */
33
+ function engineEnvArgs(dclenv) {
34
+ if (dclenv !== 'zone')
35
+ return [];
36
+ return ['--base-domain=decentraland.zone', `--preview-gatekeeper=${ORG_PREVIEW_GATEKEEPER}`];
37
+ }
38
+ /** Pulse endpoint for deep-linked native clients (ENet); undefined = the client's default. */
39
+ function pulseServerNative(dclenv) {
40
+ return dclenv === 'zone' ? 'pulse-server.decentraland.zone:7777' : undefined;
41
+ }
42
+ /**
43
+ * Pulse params for the mobile preview deep link: the LSD realm key — stated explicitly so a
44
+ * phone-side explorer can join the partition without re-deriving it — plus the environment's
45
+ * Pulse endpoint when it is not the production default.
46
+ */
47
+ function lsdDeepLinkPulseParams(projectRoot, dclenv) {
48
+ const server = pulseServerNative(dclenv);
49
+ return `&pulse-realm=${encodeURIComponent((0, lsd_realm_1.lsdRealmKey)(projectRoot))}` + (server ? `&pulse-server=${server}` : '');
50
+ }
51
+ //# sourceMappingURL=dcl-env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dcl-env.js","sourceRoot":"","sources":["../../../src/commands/start/dcl-env.ts"],"names":[],"mappings":";;AAOA,gDAIC;AAQD,oDAGC;AAMD,sCAGC;AAGD,8CAEC;AAOD,wDAGC;AA9CD,uFAAuF;AACvF,0FAA0F;AAC1F,0FAA0F;AAC1F,wFAAwF;AACxF,oFAAoF;AACpF,qDAAmD;AAEnD,SAAgB,kBAAkB,CAAC,MAAc;IAC/C,qFAAqF;IACrF,qFAAqF;IACrF,OAAO,wBAAwB,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,YAAY,CAAA;AAC/E,CAAC;AAED,0FAA0F;AAC1F,uFAAuF;AACvF,kEAAkE;AAClE,MAAM,sBAAsB,GAAG,iDAAiD,CAAA;AAEhF,6EAA6E;AAC7E,SAAgB,oBAAoB,CAAC,MAAc;IACjD,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,EAAE,CAAA;IAChC,OAAO,sBAAsB,kBAAkB,CAAC,sBAAsB,CAAC,EAAE,CAAA;AAC3E,CAAC;AAED;;;GAGG;AACH,SAAgB,aAAa,CAAC,MAAc;IAC1C,IAAI,MAAM,KAAK,MAAM;QAAE,OAAO,EAAE,CAAA;IAChC,OAAO,CAAC,iCAAiC,EAAE,wBAAwB,sBAAsB,EAAE,CAAC,CAAA;AAC9F,CAAC;AAED,8FAA8F;AAC9F,SAAgB,iBAAiB,CAAC,MAAc;IAC9C,OAAO,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,qCAAqC,CAAC,CAAC,CAAC,SAAS,CAAA;AAC9E,CAAC;AAED;;;;GAIG;AACH,SAAgB,sBAAsB,CAAC,WAAmB,EAAE,MAAc;IACxE,MAAM,MAAM,GAAG,iBAAiB,CAAC,MAAM,CAAC,CAAA;IACxC,OAAO,gBAAgB,kBAAkB,CAAC,IAAA,uBAAW,EAAC,WAAW,CAAC,CAAC,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;AACnH,CAAC"}
@@ -38,6 +38,7 @@ export declare const args: {
38
38
  '--multi-instance': BooleanConstructor;
39
39
  '--asset-bundles': BooleanConstructor;
40
40
  '--no-client': BooleanConstructor;
41
+ '--no-server': BooleanConstructor;
41
42
  '--mcp': BooleanConstructor;
42
43
  '--mcp-port': NumberConstructor;
43
44
  };
@@ -66,6 +66,8 @@ const beautiful_logs_1 = require("../../logic/beautiful-logs");
66
66
  const project_validations_1 = require("../../logic/project-validations");
67
67
  const explorer_alpha_1 = require("./explorer-alpha");
68
68
  const utils_1 = require("./utils");
69
+ const multiplayer_server_1 = require("./multiplayer-server");
70
+ const dcl_env_1 = require("./dcl-env");
69
71
  exports.args = (0, args_1.declareArgs)({
70
72
  '--dir': String,
71
73
  '--help': Boolean,
@@ -101,6 +103,7 @@ exports.args = (0, args_1.declareArgs)({
101
103
  '--multi-instance': Boolean,
102
104
  '--asset-bundles': Boolean,
103
105
  '--no-client': Boolean,
106
+ '--no-server': Boolean,
104
107
  '--mcp': Boolean,
105
108
  '--mcp-port': Number
106
109
  });
@@ -119,7 +122,7 @@ async function help(options) {
119
122
  --web3 (deprecated) No effect. Kept for backwards compatibility
120
123
  --skip-build Skip build and only serve the files in preview mode
121
124
  --debug Enables Debug panel mode inside DCL Explorer (default=true)
122
- --dclenv Decentraland Environment. Which environment to use for the content. This determines the catalyst server used, asset-bundles, etc. Possible values: org, zone, today. (default=org)
125
+ --dclenv Decentraland Environment. Which environment to use for the content. This determines the catalyst server used, asset-bundles, etc., plus the bevy-web domain and the Pulse comms server for the preview. Possible values: org, zone, today. (default=org)
123
126
  --realm Realm used to serve the content. (default=Localhost)
124
127
  --local-scene Enable local scene development.
125
128
  --position Initial Position to start the explorer. (default=position defined at scene.json)
@@ -131,6 +134,7 @@ async function help(options) {
131
134
  --multi-instance Allow running multiple Explorer instances simultaneously.
132
135
  --asset-bundles Preview with optimized asset bundles (forwarded as local-ab=true in the deep link; the Desktop Explorer converts the scene's assets itself).
133
136
  --no-client Suppress every auto-launch (desktop Explorer deeplink, browser open, mobile QR). The file watcher still notifies a desktop Explorer if it connects on its own — useful when an external tool owns the Explorer process.
137
+ --no-server Do not spawn the Multiplayer Server. Use it when another preview of this project already runs one: two servers for the same scene fight over the scene room.
134
138
  --mcp Enable the MCP server in the Explorer (forwarded as a deep link parameter).
135
139
  --mcp-port Port for the MCP server in the Explorer (forwarded as a deep link parameter).
136
140
 
@@ -163,8 +167,10 @@ async function main(options) {
163
167
  const withDataLayer = options.args['--data-layer'];
164
168
  const isHub = !!options.args['--hub'];
165
169
  const skipClient = !!options.args['--no-client'];
170
+ const skipServer = !!options.args['--no-server'];
166
171
  const bevyWeb = !!options.args['--bevy-web'];
167
172
  const isMobile = !!options.args['--mobile'];
173
+ const dclenv = options.args['--dclenv'] || 'org';
168
174
  const explorerAlpha = !bevyWeb;
169
175
  const workspace = await (0, workspace_validations_1.getValidWorkspace)(options.components, workingDirectory);
170
176
  /* istanbul ignore if */
@@ -197,9 +203,12 @@ async function main(options) {
197
203
  const config = (0, env_config_provider_1.createRecordConfigComponent)({
198
204
  HTTP_SERVER_PORT: port.toString(),
199
205
  HTTP_SERVER_HOST: '0.0.0.0',
206
+ // the embedded comms server (RoomsComponent/LinearProtocol) logs every
207
+ // connect/disconnect at DEBUG; LOG_LEVEL=DEBUG in the env re-enables it
208
+ LOG_LEVEL: 'INFO',
200
209
  ...process.env
201
210
  });
202
- const logs = await (0, logger_1.createConsoleLogComponent)({});
211
+ const logs = await (0, logger_1.createConsoleLogComponent)({ config });
203
212
  const ws = await (0, ws_1.createWsComponent)({ logs });
204
213
  const server = await (0, http_server_1.createServerComponent)({ config, ws: ws.ws, logs }, { cors: {} });
205
214
  const rooms = await (0, rooms_1.createRoomsComponent)({
@@ -232,13 +241,15 @@ async function main(options) {
232
241
  components.logger.error(e);
233
242
  }
234
243
  }
235
- await (0, routes_1.wireRouter)(components, workspace, dataLayer);
244
+ await (0, routes_1.wireRouter)(components, workspace, dataLayer, dclenv);
236
245
  if (watch) {
237
246
  for (const project of workspace.projects) {
238
247
  await (0, file_watch_notifier_1.wireFileWatcherToWebSockets)(components, project.workingDirectory, project.kind);
239
248
  }
240
249
  }
241
250
  await startComponents();
251
+ const project = workspace.projects[0];
252
+ const multiplayerServerReady = project && !skipServer ? (0, multiplayer_server_1.spawnAuthServer)(components, project, `http://localhost:${port}`, dclenv) : undefined;
242
253
  const networkInterfaces = os.networkInterfaces();
243
254
  const availableURLs = [];
244
255
  (0, beautiful_logs_1.printProgressInfo)(options.components.logger, 'Preview server is now running!');
@@ -256,23 +267,30 @@ async function main(options) {
256
267
  const sortedURLs = availableURLs.sort((a, _b) => {
257
268
  return a.toLowerCase().includes('localhost') || a.includes('127.0.0.1') || a.includes('0.0.0.0') ? -1 : 1;
258
269
  });
259
- const bevyUrl = `https://decentraland.org/bevy-web/?preview=true&realm=${new URL(sortedURLs[0]).origin}&position=${baseCoords.x},${baseCoords.y}`;
270
+ // no pulse override needed: the zone-hosted page derives its base domain — and with
271
+ // it its pulse-server fallback — from its own host (see dcl-env.ts)
272
+ const bevyUrl = `${(0, dcl_env_1.webExplorerBaseUrl)(dclenv)}?preview=true&realm=${new URL(sortedURLs[0]).origin}` +
273
+ `&position=${baseCoords.x},${baseCoords.y}${(0, dcl_env_1.webExplorerEnvParams)(dclenv)}`;
260
274
  if (bevyWeb) {
261
275
  components.logger.log('Available on:\n');
262
276
  components.logger.log(` ${bevyUrl}`);
263
277
  (0, beautiful_logs_1.printWarning)(components.logger, 'Chromium-based browsers require permission for websites to reach localhost (Local Network Access).\n' +
264
278
  'When the browser asks to access apps on your device, click "Allow".\n' +
265
279
  'If the scene never loads and no prompt appears, enable it manually and reload:\n' +
266
- ' chrome://settings/content/siteDetails?site=https%3A%2F%2Fdecentraland.org\n' +
280
+ ` chrome://settings/content/siteDetails?site=${encodeURIComponent(new URL(bevyUrl).origin)}\n` +
267
281
  ' → "Apps on device" (Chrome 145+) or "Local network access" (Chrome 142-144) → Allow');
268
282
  }
269
283
  components.logger.log('\nPress CTRL+C to exit\n');
284
+ const launchesClient = !skipClient && !isMobile && (explorerAlpha || openBrowser);
285
+ if (multiplayerServerReady && launchesClient) {
286
+ await (0, multiplayer_server_1.waitForServerReady)(components, multiplayerServerReady);
287
+ }
270
288
  if (explorerAlpha && !isMobile && !skipClient) {
271
289
  const realm = new URL(sortedURLs[0]).origin;
272
290
  await (0, explorer_alpha_1.runExplorerAlpha)(components, { cwd: workingDirectory, realm, baseCoords, isHub, args: options.args });
273
291
  }
274
292
  if (isMobile && !skipClient && lanUrl) {
275
- const deepLink = `decentraland://open?preview=${lanUrl}&position=${baseCoords.x},${baseCoords.y}`;
293
+ const deepLink = `decentraland://open?preview=${lanUrl}&position=${baseCoords.x},${baseCoords.y}${(0, dcl_env_1.lsdDeepLinkPulseParams)(workspace.projects[0].workingDirectory, dclenv)}`;
276
294
  qrcode_1.default.toString(deepLink, { type: 'terminal', small: true }, (err, qr) => {
277
295
  if (!err) {
278
296
  components.logger.log(log_1.colors.bold('\nScan to preview on mobile: \n'));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/start/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EA,oBAgDC;AAED,oBAoKC;AAlSD,uCAAwB;AACxB,2CAA4B;AAC5B,4DAAmC;AACnC,oDAA2B;AAG3B,oCAAqC;AACrC,2CAA8C;AAC9C,qEAA6D;AAC7D,6DAAmD;AAEnD,4DAA2E;AAC3E,kEAA6D;AAC7D,oFAAwF;AACxF,+DAAwF;AACxF,oEAA0E;AAC1E,0DAAyE;AACzE,8CAAuD;AACvD,8CAAoE;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
1
+ import { ChildProcess } from 'child_process';
2
+ import { CliComponents } from '../../components';
3
+ import { PreviewComponents } from './types';
4
+ import { ProjectUnion } from '../../logic/project-validations';
5
+ type ServerEngine = 'bevy' | 'hammurabi';
6
+ export type MultiplayerServer = {
7
+ child: ChildProcess;
8
+ /** true once the process survived the startup grace window, false if it errored or exited first. */
9
+ ready: Promise<boolean>;
10
+ };
11
+ /**
12
+ * Starts the Multiplayer Server process using npx to install and run in one step
13
+ */
14
+ export declare function startMultiplayerServer(components: Pick<CliComponents, 'logger' | 'analytics'>, workingDir: string, realm: string, engine?: ServerEngine, engineArgs?: string[], position?: {
15
+ x: number;
16
+ y: number;
17
+ }): MultiplayerServer;
18
+ /** Waits for the server process to come up, fail, or time out. */
19
+ export declare function waitForServerReady(components: Pick<CliComponents, 'logger'>, ready: Promise<boolean>, timeoutMs?: number): Promise<void>;
20
+ /**
21
+ * Spawns the multiplayer server for the project.
22
+ * In the auth-server SDK, all scenes are authoritative multiplayer.
23
+ * Uses npx to handle installation and execution in a single step (works in Electron).
24
+ *
25
+ * Which implementation runs is chosen by DCL_SERVER_ENGINE (bevy | hammurabi), defaulting
26
+ * to bevy. When bevy reports itself unavailable on this machine (exit 78) the preview is
27
+ * aborted with instructions to opt into hammurabi — there is no automatic fallback.
28
+ *
29
+ * @param components - Preview components including logger
30
+ * @param project - The project to start the multiplayer server for
31
+ * @param realm - The realm URL to pass to the server
32
+ * @returns The readiness promise, or undefined when the server could not be spawned
33
+ */
34
+ export declare function spawnAuthServer(components: PreviewComponents, project: ProjectUnion, realm: string, dclenv?: string): Promise<boolean> | undefined;
35
+ export {};