@playdrop/playdrop-cli 0.7.15 → 0.7.17

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 (70) hide show
  1. package/config/client-meta.json +1 -1
  2. package/node_modules/@playdrop/ai-client/dist/index.js +461 -444
  3. package/node_modules/@playdrop/ai-client/package.json +1 -1
  4. package/node_modules/@playdrop/api-client/dist/client.js +903 -882
  5. package/node_modules/@playdrop/api-client/dist/core/errors.js +69 -45
  6. package/node_modules/@playdrop/api-client/dist/core/request.js +188 -159
  7. package/node_modules/@playdrop/api-client/dist/domains/admin.js +516 -491
  8. package/node_modules/@playdrop/api-client/dist/domains/ai.js +40 -14
  9. package/node_modules/@playdrop/api-client/dist/domains/apps.js +480 -462
  10. package/node_modules/@playdrop/api-client/dist/domains/asset-packs.js +439 -419
  11. package/node_modules/@playdrop/api-client/dist/domains/assets.js +696 -676
  12. package/node_modules/@playdrop/api-client/dist/domains/auth.js +346 -320
  13. package/node_modules/@playdrop/api-client/dist/domains/comments.js +124 -98
  14. package/node_modules/@playdrop/api-client/dist/domains/free-credits.js +91 -65
  15. package/node_modules/@playdrop/api-client/dist/domains/me.js +71 -45
  16. package/node_modules/@playdrop/api-client/dist/domains/payments.js +407 -386
  17. package/node_modules/@playdrop/api-client/dist/domains/player-meta.js +144 -118
  18. package/node_modules/@playdrop/api-client/dist/domains/search.js +117 -104
  19. package/node_modules/@playdrop/api-client/dist/domains/tags.js +188 -162
  20. package/node_modules/@playdrop/api-client/dist/index.js +993 -552
  21. package/node_modules/@playdrop/api-client/package.json +1 -1
  22. package/node_modules/@playdrop/boxel-three/dist/src/animations.js +84 -62
  23. package/node_modules/@playdrop/boxel-three/dist/src/builders.js +341 -308
  24. package/node_modules/@playdrop/boxel-three/dist/src/context.js +55 -29
  25. package/node_modules/@playdrop/boxel-three/dist/src/exporters/glb.js +856 -858
  26. package/node_modules/@playdrop/boxel-three/dist/src/exporters/image.js +267 -261
  27. package/node_modules/@playdrop/boxel-three/dist/src/index.js +64 -15
  28. package/node_modules/@playdrop/boxel-three/dist/src/instantiate.js +89 -63
  29. package/node_modules/@playdrop/boxel-three/dist/src/nodes.js +81 -56
  30. package/node_modules/@playdrop/boxel-three/dist/src/overlays.js +112 -86
  31. package/node_modules/@playdrop/boxel-three/dist/src/primitives.js +45 -17
  32. package/node_modules/@playdrop/boxel-three/dist/src/scene.js +160 -136
  33. package/node_modules/@playdrop/boxel-three/dist/src/skinned-mesh.js +582 -584
  34. package/node_modules/@playdrop/boxel-three/dist/src/texture-atlas.js +123 -97
  35. package/node_modules/@playdrop/boxel-three/dist/src/textures.js +207 -182
  36. package/node_modules/@playdrop/boxel-three/dist/src/types.js +15 -1
  37. package/node_modules/@playdrop/boxel-three/dist/src/voxels/faces.js +451 -425
  38. package/node_modules/@playdrop/boxel-three/dist/src/voxels/mesher.js +109 -84
  39. package/node_modules/@playdrop/boxel-three/dist/test/export-image.playwright.test.js +127 -106
  40. package/node_modules/@playdrop/boxel-three/dist/test/fixtures/render-worker.js +73 -51
  41. package/node_modules/@playdrop/boxel-three/dist/test/glb-skinned.test.js +97 -79
  42. package/node_modules/@playdrop/boxel-three/dist/test/index.test.js +29 -7
  43. package/node_modules/@playdrop/boxel-three/dist/test/instantiate.test.js +80 -60
  44. package/node_modules/@playdrop/boxel-three/dist/test/overlays.test.js +41 -19
  45. package/node_modules/@playdrop/boxel-three/dist/test/scene-filter.test.js +72 -50
  46. package/node_modules/@playdrop/boxel-three/dist/test/scene-smoke.test.js +84 -62
  47. package/node_modules/@playdrop/boxel-three/dist/test/skinned-mesh.test.js +69 -47
  48. package/node_modules/@playdrop/boxel-three/dist/test/textured-overlay.test.js +129 -109
  49. package/node_modules/@playdrop/boxel-three/dist/test/voxels.test.js +40 -18
  50. package/node_modules/@playdrop/boxel-three/package.json +1 -1
  51. package/node_modules/@playdrop/config/client-meta.json +1 -1
  52. package/node_modules/@playdrop/types/dist/api.js +289 -203
  53. package/node_modules/@playdrop/types/dist/app-capability-filters.js +112 -62
  54. package/node_modules/@playdrop/types/dist/app.js +91 -45
  55. package/node_modules/@playdrop/types/dist/asset-pack.js +37 -5
  56. package/node_modules/@playdrop/types/dist/asset-spec.js +170 -90
  57. package/node_modules/@playdrop/types/dist/asset.js +186 -108
  58. package/node_modules/@playdrop/types/dist/content-license.js +49 -15
  59. package/node_modules/@playdrop/types/dist/creator-public-image.js +60 -32
  60. package/node_modules/@playdrop/types/dist/ecs.js +102 -82
  61. package/node_modules/@playdrop/types/dist/engine-builtins.js +603 -573
  62. package/node_modules/@playdrop/types/dist/entity.js +63 -53
  63. package/node_modules/@playdrop/types/dist/graph.js +116 -80
  64. package/node_modules/@playdrop/types/dist/index.js +47 -20
  65. package/node_modules/@playdrop/types/dist/owned-assets.js +55 -33
  66. package/node_modules/@playdrop/types/dist/player-meta.js +151 -100
  67. package/node_modules/@playdrop/types/dist/realtime.js +27 -7
  68. package/node_modules/@playdrop/types/dist/version.js +182 -124
  69. package/node_modules/@playdrop/types/package.json +1 -1
  70. package/package.json +1 -1
@@ -1,97 +1,117 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+ var ecs_exports = {};
19
+ __export(ecs_exports, {
20
+ validateEcsConfig: () => validateEcsConfig
21
+ });
22
+ module.exports = __toCommonJS(ecs_exports);
1
23
  function isPlainRecord(value) {
2
- return !!value && typeof value === 'object' && !Array.isArray(value);
24
+ return !!value && typeof value === "object" && !Array.isArray(value);
3
25
  }
4
26
  function assert(condition, message) {
5
- if (!condition) {
6
- throw new Error(message);
7
- }
27
+ if (!condition) {
28
+ throw new Error(message);
29
+ }
8
30
  }
9
31
  function validateField(input, idx, componentName) {
10
- assert(isPlainRecord(input), `component "${componentName}" field[${idx}] must be an object`);
11
- const { name, type } = input;
12
- assert(typeof name === 'string' && name.length > 0, `component "${componentName}" field[${idx}] must have a non-empty name`);
13
- assert(typeof type === 'string' &&
14
- ['u8', 'u16', 'u32', 'u64', 'i8', 'i16', 'i32', 'i64', 'f32', 'f64', 'bool', 'vec2', 'vec3', 'bytes'].includes(type), `component "${componentName}" field "${name}" has invalid type "${String(type)}"`);
15
- return { name, type: type };
32
+ assert(isPlainRecord(input), `component "${componentName}" field[${idx}] must be an object`);
33
+ const { name, type } = input;
34
+ assert(typeof name === "string" && name.length > 0, `component "${componentName}" field[${idx}] must have a non-empty name`);
35
+ assert(typeof type === "string" && ["u8", "u16", "u32", "u64", "i8", "i16", "i32", "i64", "f32", "f64", "bool", "vec2", "vec3", "bytes"].includes(type), `component "${componentName}" field "${name}" has invalid type "${String(type)}"`);
36
+ return { name, type };
16
37
  }
17
38
  function validateComponent(input, idx) {
18
- assert(isPlainRecord(input), `component[${idx}] must be an object`);
19
- const { id, name, kind, networked, input: isInput, fields } = input;
20
- assert(Number.isInteger(id) && id > 0, `component[${idx}] id must be a positive integer`);
21
- assert(typeof name === 'string' && name.length > 0, `component[${idx}] must have a non-empty name`);
22
- assert(kind === 'static' || kind === 'versioned' || kind === 'tick' || kind === 'signal', `component "${name}" has invalid kind "${String(kind)}" (must be static, versioned, tick, or signal)`);
23
- assert(typeof networked === 'boolean', `component "${name}" networked must be a boolean`);
24
- assert(typeof isInput === 'boolean', `component "${name}" input must be a boolean`);
25
- assert(Array.isArray(fields), `component "${name}" fields must be an array`);
26
- const validatedFields = fields.map((field, fieldIdx) => validateField(field, fieldIdx, name));
27
- return {
28
- id: id,
29
- name,
30
- kind: kind,
31
- networked: networked,
32
- input: isInput,
33
- fields: validatedFields,
34
- };
39
+ assert(isPlainRecord(input), `component[${idx}] must be an object`);
40
+ const { id, name, kind, networked, input: isInput, fields } = input;
41
+ assert(Number.isInteger(id) && id > 0, `component[${idx}] id must be a positive integer`);
42
+ assert(typeof name === "string" && name.length > 0, `component[${idx}] must have a non-empty name`);
43
+ assert(kind === "static" || kind === "versioned" || kind === "tick" || kind === "signal", `component "${name}" has invalid kind "${String(kind)}" (must be static, versioned, tick, or signal)`);
44
+ assert(typeof networked === "boolean", `component "${name}" networked must be a boolean`);
45
+ assert(typeof isInput === "boolean", `component "${name}" input must be a boolean`);
46
+ assert(Array.isArray(fields), `component "${name}" fields must be an array`);
47
+ const validatedFields = fields.map((field, fieldIdx) => validateField(field, fieldIdx, name));
48
+ return {
49
+ id,
50
+ name,
51
+ kind,
52
+ networked,
53
+ input: isInput,
54
+ fields: validatedFields
55
+ };
35
56
  }
36
57
  function validateSystemEntry(entry, listName, idx) {
37
- if (typeof entry === 'string') {
38
- assert(entry.length > 0, `${listName}[${idx}] must not be an empty string`);
39
- return entry;
40
- }
41
- assert(isPlainRecord(entry), `${listName}[${idx}] must be a string or an object`);
42
- const { name, module } = entry;
43
- assert(typeof name === 'string' && name.length > 0, `${listName}[${idx}] object must have a non-empty name`);
44
- assert(typeof module === 'string' && module.length > 0, `${listName}[${idx}] object must have a non-empty module`);
45
- return { name, module };
58
+ if (typeof entry === "string") {
59
+ assert(entry.length > 0, `${listName}[${idx}] must not be an empty string`);
60
+ return entry;
61
+ }
62
+ assert(isPlainRecord(entry), `${listName}[${idx}] must be a string or an object`);
63
+ const { name, module: module2 } = entry;
64
+ assert(typeof name === "string" && name.length > 0, `${listName}[${idx}] object must have a non-empty name`);
65
+ assert(typeof module2 === "string" && module2.length > 0, `${listName}[${idx}] object must have a non-empty module`);
66
+ return { name, module: module2 };
46
67
  }
47
68
  function validateSystems(systems) {
48
- assert(isPlainRecord(systems), 'systems must be an object');
49
- const { serverStartup, serverSimulation, clientStartup, clientSimulation, clientPresentation } = systems;
50
- // serverStartup and clientStartup are optional
51
- if (serverStartup !== undefined) {
52
- assert(Array.isArray(serverStartup), 'systems.serverStartup must be an array');
53
- }
54
- assert(Array.isArray(serverSimulation), 'systems.serverSimulation must be an array');
55
- if (clientStartup !== undefined) {
56
- assert(Array.isArray(clientStartup), 'systems.clientStartup must be an array');
57
- }
58
- assert(Array.isArray(clientSimulation), 'systems.clientSimulation must be an array');
59
- assert(Array.isArray(clientPresentation), 'systems.clientPresentation must be an array');
60
- return {
61
- ...(serverStartup
62
- ? {
63
- serverStartup: serverStartup.map((entry, idx) => validateSystemEntry(entry, 'systems.serverStartup', idx))
64
- }
65
- : {}),
66
- serverSimulation: serverSimulation.map((entry, idx) => validateSystemEntry(entry, 'systems.serverSimulation', idx)),
67
- ...(clientStartup
68
- ? {
69
- clientStartup: clientStartup.map((entry, idx) => validateSystemEntry(entry, 'systems.clientStartup', idx))
70
- }
71
- : {}),
72
- clientSimulation: clientSimulation.map((entry, idx) => validateSystemEntry(entry, 'systems.clientSimulation', idx)),
73
- clientPresentation: clientPresentation.map((entry, idx) => validateSystemEntry(entry, 'systems.clientPresentation', idx)),
74
- };
69
+ assert(isPlainRecord(systems), "systems must be an object");
70
+ const { serverStartup, serverSimulation, clientStartup, clientSimulation, clientPresentation } = systems;
71
+ if (serverStartup !== void 0) {
72
+ assert(Array.isArray(serverStartup), "systems.serverStartup must be an array");
73
+ }
74
+ assert(Array.isArray(serverSimulation), "systems.serverSimulation must be an array");
75
+ if (clientStartup !== void 0) {
76
+ assert(Array.isArray(clientStartup), "systems.clientStartup must be an array");
77
+ }
78
+ assert(Array.isArray(clientSimulation), "systems.clientSimulation must be an array");
79
+ assert(Array.isArray(clientPresentation), "systems.clientPresentation must be an array");
80
+ return {
81
+ ...serverStartup ? {
82
+ serverStartup: serverStartup.map((entry, idx) => validateSystemEntry(entry, "systems.serverStartup", idx))
83
+ } : {},
84
+ serverSimulation: serverSimulation.map((entry, idx) => validateSystemEntry(entry, "systems.serverSimulation", idx)),
85
+ ...clientStartup ? {
86
+ clientStartup: clientStartup.map((entry, idx) => validateSystemEntry(entry, "systems.clientStartup", idx))
87
+ } : {},
88
+ clientSimulation: clientSimulation.map((entry, idx) => validateSystemEntry(entry, "systems.clientSimulation", idx)),
89
+ clientPresentation: clientPresentation.map((entry, idx) => validateSystemEntry(entry, "systems.clientPresentation", idx))
90
+ };
75
91
  }
76
92
  function ensureUniqueComponents(components) {
77
- const ids = new Set();
78
- const names = new Set();
79
- for (const component of components) {
80
- assert(!ids.has(component.id), `duplicate component id ${component.id}`);
81
- ids.add(component.id);
82
- assert(!names.has(component.name), `duplicate component name "${component.name}"`);
83
- names.add(component.name);
84
- }
93
+ const ids = /* @__PURE__ */ new Set();
94
+ const names = /* @__PURE__ */ new Set();
95
+ for (const component of components) {
96
+ assert(!ids.has(component.id), `duplicate component id ${component.id}`);
97
+ ids.add(component.id);
98
+ assert(!names.has(component.name), `duplicate component name "${component.name}"`);
99
+ names.add(component.name);
100
+ }
85
101
  }
86
- export function validateEcsConfig(config) {
87
- assert(isPlainRecord(config), 'config must be an object');
88
- const { components, systems } = config;
89
- assert(Array.isArray(components), 'components must be an array');
90
- const validatedComponents = components.map((component, idx) => validateComponent(component, idx));
91
- ensureUniqueComponents(validatedComponents);
92
- const validatedSystems = validateSystems(systems);
93
- return {
94
- components: validatedComponents,
95
- systems: validatedSystems,
96
- };
102
+ function validateEcsConfig(config) {
103
+ assert(isPlainRecord(config), "config must be an object");
104
+ const { components, systems } = config;
105
+ assert(Array.isArray(components), "components must be an array");
106
+ const validatedComponents = components.map((component, idx) => validateComponent(component, idx));
107
+ ensureUniqueComponents(validatedComponents);
108
+ const validatedSystems = validateSystems(systems);
109
+ return {
110
+ components: validatedComponents,
111
+ systems: validatedSystems
112
+ };
97
113
  }
114
+ // Annotate the CommonJS export names for ESM import in node:
115
+ 0 && (module.exports = {
116
+ validateEcsConfig
117
+ });