castle-web-cli 0.4.229 → 0.4.230

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 (232) hide show
  1. package/dist/agent-prompts.d.ts +2 -0
  2. package/dist/agent-prompts.js +16 -8
  3. package/dist/agent.d.ts +2 -0
  4. package/dist/agent.js +21 -21
  5. package/dist/api.d.ts +28 -2
  6. package/dist/api.js +74 -16
  7. package/dist/castle-host/host.d.ts +91 -0
  8. package/dist/castle-host/host.js +779 -3
  9. package/dist/castleJson.d.ts +44 -0
  10. package/dist/castleJson.js +131 -0
  11. package/dist/check.js +27 -1
  12. package/dist/contentPack.d.ts +49 -0
  13. package/dist/contentPack.js +273 -0
  14. package/dist/devExperiments.d.ts +21 -0
  15. package/dist/devExperiments.js +139 -0
  16. package/dist/devHub.d.ts +55 -0
  17. package/dist/devHub.js +187 -0
  18. package/dist/devSessionChild.js +3 -1
  19. package/dist/devSessionServer.d.ts +14 -1
  20. package/dist/devSessionServer.js +229 -44
  21. package/dist/experimentAssignment.d.ts +15 -0
  22. package/dist/experimentAssignment.js +41 -0
  23. package/dist/importCheckHook.d.ts +40 -0
  24. package/dist/importCheckHook.js +171 -0
  25. package/dist/importRegression.d.ts +15 -0
  26. package/dist/importRegression.js +100 -0
  27. package/dist/importTrust.d.ts +2 -0
  28. package/dist/importTrust.js +27 -0
  29. package/dist/importUpdateHook.d.ts +18 -0
  30. package/dist/importUpdateHook.js +31 -8
  31. package/dist/importUpdateHookRunner.js +19 -7
  32. package/dist/imports.d.ts +16 -0
  33. package/dist/imports.js +141 -31
  34. package/dist/index.js +3 -1
  35. package/dist/init.d.ts +3 -0
  36. package/dist/init.js +125 -8
  37. package/dist/install.js +4 -1
  38. package/dist/localPaths.js +4 -0
  39. package/dist/login.js +2 -2
  40. package/dist/platformDoc.js +3 -8
  41. package/dist/playPagePolicy.js +3 -1
  42. package/dist/remix.js +5 -0
  43. package/dist/routerTaskReport.d.ts +28 -0
  44. package/dist/routerTaskReport.js +56 -0
  45. package/dist/save-deck.d.ts +18 -0
  46. package/dist/save-deck.js +142 -6
  47. package/dist/serve.d.ts +8 -0
  48. package/dist/serve.js +94 -13
  49. package/dist/serverBundle.d.ts +1 -1
  50. package/dist/serverBundle.js +5 -1
  51. package/dist/webSourceSync.d.ts +2 -0
  52. package/dist/webSourceSync.js +2 -0
  53. package/kits/base/CLAUDE.md +2 -3
  54. package/kits/base/castle.json +1 -1
  55. package/kits/base/sdk/README.md +258 -52
  56. package/kits/base/sdk/agent.js +4 -4
  57. package/kits/base/sdk/avatar.d.ts +12 -0
  58. package/kits/base/sdk/avatar.js +23 -0
  59. package/kits/base/sdk/castle.d.ts +5 -0
  60. package/kits/base/sdk/castle.js +3 -0
  61. package/kits/base/sdk/commands.d.ts +208 -0
  62. package/kits/base/sdk/commands.js +16 -0
  63. package/kits/base/sdk/context.d.ts +6 -0
  64. package/kits/base/sdk/experiments.d.ts +15 -0
  65. package/kits/base/sdk/experiments.js +83 -0
  66. package/kits/base/sdk/hub.d.ts +85 -0
  67. package/kits/base/sdk/hub.js +107 -0
  68. package/kits/base/sdk/multiplayer.d.ts +45 -1
  69. package/kits/base/sdk/multiplayer.js +106 -4
  70. package/kits/base/sdk/server/hub.d.ts +169 -0
  71. package/kits/base/sdk/server/hub.js +125 -0
  72. package/kits/base/sdk/server/platformHandle.d.ts +42 -1
  73. package/kits/base/sdk/server/storage.d.ts +55 -2
  74. package/kits/base/sdk/server/wrapper.d.ts +32 -2
  75. package/kits/base/sdk/server/wrapper.js +90 -11
  76. package/kits/base/sdk/transport.d.ts +2 -1
  77. package/kits/base/sdk/transport.js +13 -1
  78. package/kits/hub-game/.prettierrc +5 -0
  79. package/kits/hub-game/CLAUDE.md +146 -0
  80. package/kits/hub-game/blueprints/avatar-0.scene +28 -0
  81. package/kits/hub-game/blueprints/avatar-1.scene +28 -0
  82. package/kits/hub-game/blueprints/avatar-2.scene +28 -0
  83. package/kits/hub-game/blueprints/avatar-3.scene +28 -0
  84. package/kits/hub-game/blueprints/bean/avatar-0.scene +28 -0
  85. package/kits/hub-game/blueprints/bean/avatar-1.scene +28 -0
  86. package/kits/hub-game/blueprints/bean/avatar-2.scene +28 -0
  87. package/kits/hub-game/blueprints/bean/avatar-3.scene +28 -0
  88. package/kits/hub-game/blueprints/blocky/avatar-0.scene +28 -0
  89. package/kits/hub-game/blueprints/blocky/avatar-1.scene +28 -0
  90. package/kits/hub-game/blueprints/blocky/avatar-2.scene +28 -0
  91. package/kits/hub-game/blueprints/blocky/avatar-3.scene +28 -0
  92. package/kits/hub-game/blueprints/pixel/avatar-0.scene +28 -0
  93. package/kits/hub-game/blueprints/pixel/avatar-1.scene +28 -0
  94. package/kits/hub-game/blueprints/pixel/avatar-2.scene +28 -0
  95. package/kits/hub-game/blueprints/pixel/avatar-3.scene +28 -0
  96. package/kits/hub-game/castle.json +96 -0
  97. package/kits/hub-game/code/client/attention.js +133 -0
  98. package/kits/hub-game/code/client/avatar.js +288 -0
  99. package/kits/hub-game/code/client/cabinets.js +90 -0
  100. package/kits/hub-game/code/client/chat.js +135 -0
  101. package/kits/hub-game/code/client/chrome.js +1001 -0
  102. package/kits/hub-game/code/client/doorFrame.js +15 -0
  103. package/kits/hub-game/code/client/firstJoin.js +14 -0
  104. package/kits/hub-game/code/client/grab.js +241 -0
  105. package/kits/hub-game/code/client/hookLayer.js +230 -0
  106. package/kits/hub-game/code/client/idle.js +326 -0
  107. package/kits/hub-game/code/client/keys.js +48 -0
  108. package/kits/hub-game/code/client/pack.js +232 -0
  109. package/kits/hub-game/code/client/packFormat.js +397 -0
  110. package/kits/hub-game/code/client/say.js +127 -0
  111. package/kits/hub-game/code/client/sha256.js +80 -0
  112. package/kits/hub-game/code/client/sound.js +147 -0
  113. package/kits/hub-game/code/client/state.js +131 -0
  114. package/kits/hub-game/code/client/talk.js +259 -0
  115. package/kits/hub-game/code/client/together.js +365 -0
  116. package/kits/hub-game/code/client/wear.js +149 -0
  117. package/kits/hub-game/code/server/actors.js +627 -0
  118. package/kits/hub-game/code/server/blocks.js +103 -0
  119. package/kits/hub-game/code/server/cabinets.js +309 -0
  120. package/kits/hub-game/code/server/game.js +137 -0
  121. package/kits/hub-game/code/server/grab.js +247 -0
  122. package/kits/hub-game/code/server/history.js +96 -0
  123. package/kits/hub-game/code/server/hub.js +1904 -0
  124. package/kits/hub-game/code/server/idle.js +412 -0
  125. package/kits/hub-game/code/server/index.js +64 -0
  126. package/kits/hub-game/code/server/labels.js +59 -0
  127. package/kits/hub-game/code/server/manifest.js +527 -0
  128. package/kits/hub-game/code/server/npcs.js +745 -0
  129. package/kits/hub-game/code/server/party.js +381 -0
  130. package/kits/hub-game/code/server/place.js +43 -0
  131. package/kits/hub-game/code/server/say.js +83 -0
  132. package/kits/hub-game/code/server/wear.js +142 -0
  133. package/kits/hub-game/code/systems/hub.js +2230 -0
  134. package/kits/hub-game/docs/content-pack.md +151 -0
  135. package/kits/hub-game/docs/contract.md +1139 -0
  136. package/kits/hub-game/docs/style.md +137 -0
  137. package/kits/hub-game/drawings/blocky/castle-eye.sprite +58 -0
  138. package/kits/hub-game/drawings/blocky/dash.sprite +59 -0
  139. package/kits/hub-game/drawings/blocky/pom.sprite +59 -0
  140. package/kits/hub-game/drawings/blocky/tabby.sprite +59 -0
  141. package/kits/hub-game/drawings/pixel/castle-arm.sprite +13 -0
  142. package/kits/hub-game/drawings/pixel/castle-body.sprite +23 -0
  143. package/kits/hub-game/drawings/pixel/castle-leg.sprite +12 -0
  144. package/kits/hub-game/drawings/pixel/kai-arm.sprite +14 -0
  145. package/kits/hub-game/drawings/pixel/kai-head.sprite +24 -0
  146. package/kits/hub-game/drawings/pixel/kai-leg.sprite +15 -0
  147. package/kits/hub-game/drawings/pixel/kai-torso.sprite +18 -0
  148. package/kits/hub-game/drawings/pixel/mimi-arm.sprite +13 -0
  149. package/kits/hub-game/drawings/pixel/mimi-head.sprite +23 -0
  150. package/kits/hub-game/drawings/pixel/mimi-leg.sprite +15 -0
  151. package/kits/hub-game/drawings/pixel/mimi-torso.sprite +18 -0
  152. package/kits/hub-game/drawings/pixel/nox-arm.sprite +13 -0
  153. package/kits/hub-game/drawings/pixel/nox-head.sprite +21 -0
  154. package/kits/hub-game/drawings/pixel/nox-leg.sprite +14 -0
  155. package/kits/hub-game/drawings/pixel/nox-torso.sprite +18 -0
  156. package/kits/hub-game/eslint.config.js +20 -0
  157. package/kits/hub-game/fonts.generated.js +9 -0
  158. package/kits/hub-game/index.html +22 -0
  159. package/kits/hub-game/main.jsx +6 -0
  160. package/kits/hub-game/models/avatar-0.pxmodel +21 -0
  161. package/kits/hub-game/models/avatar-1.pxmodel +24 -0
  162. package/kits/hub-game/models/avatar-2.pxmodel +27 -0
  163. package/kits/hub-game/models/avatar-3.pxmodel +22 -0
  164. package/kits/hub-game/models/bean/avatar-0.pxmodel +19 -0
  165. package/kits/hub-game/models/bean/avatar-1.pxmodel +24 -0
  166. package/kits/hub-game/models/bean/avatar-2.pxmodel +22 -0
  167. package/kits/hub-game/models/bean/avatar-3.pxmodel +24 -0
  168. package/kits/hub-game/models/blocky/avatar-0.pxmodel +21 -0
  169. package/kits/hub-game/models/blocky/avatar-1.pxmodel +30 -0
  170. package/kits/hub-game/models/blocky/avatar-2.pxmodel +28 -0
  171. package/kits/hub-game/models/blocky/avatar-3.pxmodel +27 -0
  172. package/kits/hub-game/models/pixel/avatar-0.pxmodel +24 -0
  173. package/kits/hub-game/models/pixel/avatar-1.pxmodel +16 -0
  174. package/kits/hub-game/models/pixel/avatar-2.pxmodel +19 -0
  175. package/kits/hub-game/models/pixel/avatar-3.pxmodel +23 -0
  176. package/kits/hub-game/package-lock.json +365 -0
  177. package/kits/hub-game/package.json +32 -0
  178. package/kits/hub-game/scenes/main.scene +318 -0
  179. package/kits/hub-game/scripts/check.mjs +339 -0
  180. package/kits/hub-game/scripts/fixtures/sdk-stub.mjs +3 -0
  181. package/kits/hub-game/scripts/gen-avatars-bean.mjs +748 -0
  182. package/kits/hub-game/scripts/gen-avatars-blocky.mjs +607 -0
  183. package/kits/hub-game/scripts/gen-avatars-pixel.mjs +771 -0
  184. package/kits/hub-game/scripts/gen-avatars.mjs +621 -0
  185. package/kits/hub-game/scripts/pack.mjs +192 -0
  186. package/kits/hub-game/scripts/test-actors.mjs +666 -0
  187. package/kits/hub-game/scripts/test-attention.mjs +103 -0
  188. package/kits/hub-game/scripts/test-avatar.mjs +472 -0
  189. package/kits/hub-game/scripts/test-ban-join.mjs +194 -0
  190. package/kits/hub-game/scripts/test-blocks.mjs +351 -0
  191. package/kits/hub-game/scripts/test-chat.mjs +98 -0
  192. package/kits/hub-game/scripts/test-classic.mjs +590 -0
  193. package/kits/hub-game/scripts/test-door-jump.mjs +131 -0
  194. package/kits/hub-game/scripts/test-door.mjs +56 -0
  195. package/kits/hub-game/scripts/test-grab.mjs +331 -0
  196. package/kits/hub-game/scripts/test-hub-ops.mjs +835 -0
  197. package/kits/hub-game/scripts/test-hub-trip.mjs +1310 -0
  198. package/kits/hub-game/scripts/test-idle.mjs +518 -0
  199. package/kits/hub-game/scripts/test-interest.mjs +413 -0
  200. package/kits/hub-game/scripts/test-keys.mjs +50 -0
  201. package/kits/hub-game/scripts/test-manifest.mjs +224 -0
  202. package/kits/hub-game/scripts/test-no-forms.mjs +16 -0
  203. package/kits/hub-game/scripts/test-npcs.mjs +714 -0
  204. package/kits/hub-game/scripts/test-pack.mjs +424 -0
  205. package/kits/hub-game/scripts/test-party.mjs +286 -0
  206. package/kits/hub-game/scripts/test-say.mjs +149 -0
  207. package/kits/hub-game/scripts/test-together.mjs +183 -0
  208. package/kits/hub-game/theme.style +3 -0
  209. package/kits/multiplayer-3d/castle.json +5 -5
  210. package/kits/multiplayer-3d/code/client/avatars.js +101 -1
  211. package/kits/multiplayer-3d/code/server/players.js +4 -1
  212. package/kits/multiplayer-3d/code/server/sceneBodies.js +27 -6
  213. package/kits/multiplayer-3d/code/server/world.js +20 -7
  214. package/kits/multiplayer-3d/code/systems/multiplayer.js +222 -11
  215. package/kits/physics-2d/castle.json +2 -2
  216. package/kits/physics-2d/engine/art.js +13 -0
  217. package/kits/physics-2d/engine/assets.js +4 -2
  218. package/kits/physics-2d/engine/scene.js +25 -5
  219. package/kits/physics-3d/CLAUDE.md +6 -1
  220. package/kits/physics-3d/castle.json +3 -3
  221. package/kits/physics-3d/engine3d/Scene3DPlayer.jsx +32 -4
  222. package/kits/physics-3d/engine3d/artobjects.js +2 -2
  223. package/kits/physics-3d/engine3d/materials.js +29 -1
  224. package/kits/physics-3d/engine3d/world3d.js +65 -1
  225. package/kits/physics-3d/systems/physics3d.js +5 -2
  226. package/kits/real-time/castle.json +2 -2
  227. package/kits/real-time/code/client/connection.js +77 -7
  228. package/kits/real-time/code/client/gameHooks.js +63 -3
  229. package/kits/real-time/code/client/messages.js +7 -0
  230. package/kits/real-time/code/server/gameHooks.js +24 -0
  231. package/kits/real-time/code/server/session.js +390 -22
  232. package/package.json +2 -2
@@ -0,0 +1,192 @@
1
+ // The hub-game content pack exporter (castle.json `onPack`,
2
+ // docs/content-pack.md): the deck's client half as data, for a town's engine
3
+ // to mount behind a door. Run by the CLI after this kit's check passes, in
4
+ // `castle-web check` and `save-deck`; it writes the pack to `outFile` and the
5
+ // CLI hashes, budgets, stores and publishes it without knowing what is in it.
6
+ //
7
+ // What goes in is everything the places draw, followed from each place's
8
+ // scene to a fixed point: any string in a scene, blueprint or model that
9
+ // names a data file or an image the deck has is a reference. Nothing is
10
+ // rewritten, so a pack's paths are the deck's own. Code never goes in, nor
11
+ // the avatar blueprints: the town draws every player as their avatar.
12
+ // Sounds go in `audio`, and only the files a place's `idle.sounds` lists.
13
+
14
+ import crypto from 'node:crypto';
15
+ import fs from 'node:fs';
16
+ import path from 'node:path';
17
+ import { readManifest } from '../code/server/manifest.js';
18
+ import { AUDIO_TYPES, MEDIA_TYPES, PACK_FORMAT, PACK_VERSION, TEXT_EXTS, extOf, isPackPath, validatePack } from '../code/client/packFormat.js';
19
+
20
+ const KIT_ALIAS = 'castle.hub-game';
21
+ const SKIP_DIRS = new Set(['node_modules', '.castle', 'dist', '.git']);
22
+ // The kit's avatars are the engine's, never a game's.
23
+ const AVATAR = /^(imports\/castle\.hub-game\/)?blueprints\/((blocky|bean|pixel)\/)?avatar-\d+\.scene$/;
24
+ // The kits a hub game's content is drawn by; their pins say which engine it
25
+ // was authored against.
26
+ const ENGINE_ALIASES = ['castle.physics-3d', 'castle.physics-2d', 'castle.multiplayer-3d', 'castle.real-time'];
27
+
28
+ export default async function pack({ deckDir, self = false, outFile }) {
29
+ const castleJson = readJson(path.join(deckDir, 'castle.json'));
30
+ const { errors, manifest } = readManifest(castleJson ?? {}, (scene) => fs.existsSync(path.join(deckDir, scene)));
31
+ if (!manifest) {
32
+ return { errors, warnings: [] };
33
+ }
34
+ const available = new Set();
35
+ for (const rel of walk(deckDir)) {
36
+ if (isPackPath(rel) && (TEXT_EXTS.includes(extOf(rel)) || MEDIA_TYPES[extOf(rel)]) && !AVATAR.test(rel)) {
37
+ available.add(rel);
38
+ }
39
+ }
40
+ const roots = [];
41
+ for (const place of Object.values(manifest.places)) {
42
+ roots.push(place.scene);
43
+ if (place.sign?.model) {
44
+ roots.push(place.sign.model);
45
+ }
46
+ }
47
+ const included = closure(deckDir, roots, available);
48
+
49
+ const files = {};
50
+ const media = {};
51
+ for (const rel of [...included].sort()) {
52
+ const bytes = fs.readFileSync(path.join(deckDir, rel));
53
+ const sha256 = crypto.createHash('sha256').update(bytes).digest('hex');
54
+ const type = MEDIA_TYPES[extOf(rel)];
55
+ if (type) {
56
+ media[rel] = { sha256, type, base64: bytes.toString('base64') };
57
+ } else {
58
+ files[rel] = { sha256, text: bytes.toString('utf8') };
59
+ }
60
+ }
61
+ // Exactly the sounds the places list (check.mjs has already found each one).
62
+ const audio = {};
63
+ const sounds = new Set(Object.values(manifest.places).flatMap((place) => place.idle?.sounds ?? []));
64
+ for (const rel of [...sounds].sort()) {
65
+ const ext = Object.keys(AUDIO_TYPES).find((e) => rel.endsWith(e));
66
+ let bytes;
67
+ try {
68
+ bytes = fs.readFileSync(path.join(deckDir, rel));
69
+ } catch {
70
+ return { errors: [`content pack: ${rel} is listed in idle.sounds but this deck does not have it`], warnings: [] };
71
+ }
72
+ audio[rel] = { sha256: crypto.createHash('sha256').update(bytes).digest('hex'), type: AUDIO_TYPES[ext], base64: bytes.toString('base64') };
73
+ }
74
+ const imports = castleJson.imports ?? {};
75
+ const pinOf = (alias) => (typeof imports[alias]?.version === 'string' ? imports[alias].version : null);
76
+ const document = {
77
+ format: PACK_FORMAT,
78
+ version: PACK_VERSION,
79
+ contract: manifest.contract,
80
+ kit: { alias: KIT_ALIAS, version: self ? 'self' : pinOf(KIT_ALIAS) },
81
+ engine: Object.fromEntries(ENGINE_ALIASES.map((alias) => [alias, pinOf(alias)])),
82
+ places: manifest.places,
83
+ files,
84
+ media,
85
+ // Only when there is some: a silent game's pack is byte for byte what it was.
86
+ ...(Object.keys(audio).length ? { audio } : {}),
87
+ };
88
+ const text = JSON.stringify(document);
89
+ const verdict = validatePack(document, { byteLength: Buffer.byteLength(text) });
90
+ if (verdict.errors.length) {
91
+ return { errors: verdict.errors.map((e) => `content pack: ${e}`), warnings: [] };
92
+ }
93
+ if (outFile) {
94
+ fs.writeFileSync(outFile, text);
95
+ }
96
+ const kb = (Buffer.byteLength(text) / 1024).toFixed(1);
97
+ return {
98
+ errors: [],
99
+ warnings: [],
100
+ summary: `${Object.keys(files).length} files, ${Object.keys(media).length} images, ${Object.keys(audio).length} sounds, ${kb} KB`,
101
+ };
102
+ }
103
+
104
+ // Every file the roots reach. A reference is any string that names a file the
105
+ // deck has: as written, without a leading `@` or `./`, or -- inside an
106
+ // import's file -- relative to that import, the way the engine resolves
107
+ // blueprint, model and art refs.
108
+ function closure(deckDir, roots, available) {
109
+ const seen = new Set();
110
+ const queue = roots.filter((r) => available.has(r));
111
+ while (queue.length) {
112
+ const rel = queue.shift();
113
+ if (seen.has(rel)) {
114
+ continue;
115
+ }
116
+ seen.add(rel);
117
+ if (!TEXT_EXTS.includes(extOf(rel))) {
118
+ continue;
119
+ }
120
+ let value;
121
+ try {
122
+ value = JSON.parse(fs.readFileSync(path.join(deckDir, rel), 'utf8'));
123
+ } catch {
124
+ continue;
125
+ }
126
+ const base = /^(imports\/[^/]+\/)/.exec(rel)?.[1] ?? '';
127
+ for (const s of strings(value)) {
128
+ for (const candidate of refCandidates(s, base)) {
129
+ if (available.has(candidate) && !seen.has(candidate)) {
130
+ queue.push(candidate);
131
+ }
132
+ }
133
+ }
134
+ }
135
+ return seen;
136
+ }
137
+
138
+ function refCandidates(s, base) {
139
+ // An art ref may pick a frame: `drawings/door.sprite#1`.
140
+ const file = s.replace(/#\d+$/, '');
141
+ if (file.length > 200 || !/\.[A-Za-z]+$/.test(file)) {
142
+ return [];
143
+ }
144
+ const ref = file.replace(/^\.\//, '').replace(/^@(?=imports\/)/, '');
145
+ const out = [ref];
146
+ if (base && !ref.startsWith('imports/')) {
147
+ out.push(base + ref);
148
+ }
149
+ return out;
150
+ }
151
+
152
+ function* strings(value) {
153
+ if (typeof value === 'string') {
154
+ yield value;
155
+ } else if (Array.isArray(value)) {
156
+ for (const v of value) {
157
+ yield* strings(v);
158
+ }
159
+ } else if (value && typeof value === 'object') {
160
+ for (const v of Object.values(value)) {
161
+ yield* strings(v);
162
+ }
163
+ }
164
+ }
165
+
166
+ function* walk(root, rel = '') {
167
+ let entries = [];
168
+ try {
169
+ entries = fs.readdirSync(path.join(root, rel), { withFileTypes: true });
170
+ } catch {
171
+ return;
172
+ }
173
+ for (const entry of entries) {
174
+ if (!rel && SKIP_DIRS.has(entry.name)) {
175
+ continue;
176
+ }
177
+ const child = rel ? `${rel}/${entry.name}` : entry.name;
178
+ if (entry.isDirectory()) {
179
+ yield* walk(root, child);
180
+ } else if (entry.isFile()) {
181
+ yield child;
182
+ }
183
+ }
184
+ }
185
+
186
+ function readJson(file) {
187
+ try {
188
+ return JSON.parse(fs.readFileSync(file, 'utf8'));
189
+ } catch {
190
+ return null;
191
+ }
192
+ }