@helix3/helix-cli 0.1.4-helix3.24

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 (102) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +64 -0
  3. package/dist/ability.d.ts +73 -0
  4. package/dist/ability.js +120 -0
  5. package/dist/ability.js.map +1 -0
  6. package/dist/api.d.ts +24 -0
  7. package/dist/api.js +83 -0
  8. package/dist/api.js.map +1 -0
  9. package/dist/browserLogin.d.ts +22 -0
  10. package/dist/browserLogin.js +148 -0
  11. package/dist/browserLogin.js.map +1 -0
  12. package/dist/bundle.d.ts +15 -0
  13. package/dist/bundle.js +98 -0
  14. package/dist/bundle.js.map +1 -0
  15. package/dist/character/canonicalSkeleton.d.ts +3 -0
  16. package/dist/character/canonicalSkeleton.js +23 -0
  17. package/dist/character/canonicalSkeleton.js.map +1 -0
  18. package/dist/character/canonicalSkeletonData.d.ts +6 -0
  19. package/dist/character/canonicalSkeletonData.js +92 -0
  20. package/dist/character/canonicalSkeletonData.js.map +1 -0
  21. package/dist/character/esm.d.ts +1 -0
  22. package/dist/character/esm.js +6 -0
  23. package/dist/character/esm.js.map +1 -0
  24. package/dist/character/importCharacter.d.ts +88 -0
  25. package/dist/character/importCharacter.js +293 -0
  26. package/dist/character/importCharacter.js.map +1 -0
  27. package/dist/character/mat4.d.ts +29 -0
  28. package/dist/character/mat4.js +103 -0
  29. package/dist/character/mat4.js.map +1 -0
  30. package/dist/character/meshyToHelixMap.d.ts +2 -0
  31. package/dist/character/meshyToHelixMap.js +40 -0
  32. package/dist/character/meshyToHelixMap.js.map +1 -0
  33. package/dist/character/quat.d.ts +15 -0
  34. package/dist/character/quat.js +137 -0
  35. package/dist/character/quat.js.map +1 -0
  36. package/dist/character/stages/bakeTexture.d.ts +20 -0
  37. package/dist/character/stages/bakeTexture.js +396 -0
  38. package/dist/character/stages/bakeTexture.js.map +1 -0
  39. package/dist/character/stages/conform.d.ts +56 -0
  40. package/dist/character/stages/conform.js +292 -0
  41. package/dist/character/stages/conform.js.map +1 -0
  42. package/dist/character/stages/ktx2.d.ts +22 -0
  43. package/dist/character/stages/ktx2.js +97 -0
  44. package/dist/character/stages/ktx2.js.map +1 -0
  45. package/dist/character/stages/mergeLods.d.ts +15 -0
  46. package/dist/character/stages/mergeLods.js +42 -0
  47. package/dist/character/stages/mergeLods.js.map +1 -0
  48. package/dist/character/stages/report.d.ts +2 -0
  49. package/dist/character/stages/report.js +19 -0
  50. package/dist/character/stages/report.js.map +1 -0
  51. package/dist/character/stages/resizeTextures.d.ts +11 -0
  52. package/dist/character/stages/resizeTextures.js +62 -0
  53. package/dist/character/stages/resizeTextures.js.map +1 -0
  54. package/dist/character/stages/retarget.d.ts +49 -0
  55. package/dist/character/stages/retarget.js +105 -0
  56. package/dist/character/stages/retarget.js.map +1 -0
  57. package/dist/character/stages/retargetClip.d.ts +27 -0
  58. package/dist/character/stages/retargetClip.js +237 -0
  59. package/dist/character/stages/retargetClip.js.map +1 -0
  60. package/dist/character/stages/simplifyMesh.d.ts +15 -0
  61. package/dist/character/stages/simplifyMesh.js +37 -0
  62. package/dist/character/stages/simplifyMesh.js.map +1 -0
  63. package/dist/character/stages/splitFacePrimitive.d.ts +30 -0
  64. package/dist/character/stages/splitFacePrimitive.js +115 -0
  65. package/dist/character/stages/splitFacePrimitive.js.map +1 -0
  66. package/dist/character/stages/weldedSimplify.d.ts +32 -0
  67. package/dist/character/stages/weldedSimplify.js +202 -0
  68. package/dist/character/stages/weldedSimplify.js.map +1 -0
  69. package/dist/character/testutil/syntheticRig.d.ts +9 -0
  70. package/dist/character/testutil/syntheticRig.js +84 -0
  71. package/dist/character/testutil/syntheticRig.js.map +1 -0
  72. package/dist/config.d.ts +25 -0
  73. package/dist/config.js +103 -0
  74. package/dist/config.js.map +1 -0
  75. package/dist/index.d.ts +2 -0
  76. package/dist/index.js +378 -0
  77. package/dist/index.js.map +1 -0
  78. package/dist/init.d.ts +1 -0
  79. package/dist/init.js +87 -0
  80. package/dist/init.js.map +1 -0
  81. package/dist/initAbility.d.ts +1 -0
  82. package/dist/initAbility.js +71 -0
  83. package/dist/initAbility.js.map +1 -0
  84. package/dist/install.d.ts +51 -0
  85. package/dist/install.js +201 -0
  86. package/dist/install.js.map +1 -0
  87. package/dist/lib.d.ts +88 -0
  88. package/dist/lib.js +347 -0
  89. package/dist/lib.js.map +1 -0
  90. package/dist/package.d.ts +11 -0
  91. package/dist/package.js +136 -0
  92. package/dist/package.js.map +1 -0
  93. package/dist/prompt.d.ts +2 -0
  94. package/dist/prompt.js +55 -0
  95. package/dist/prompt.js.map +1 -0
  96. package/dist/resolve.d.ts +57 -0
  97. package/dist/resolve.js +103 -0
  98. package/dist/resolve.js.map +1 -0
  99. package/dist/tsconfig.build.tsbuildinfo +1 -0
  100. package/package.json +58 -0
  101. package/vendor/ability-manifest.mjs +558 -0
  102. package/vendor/installed-index.mjs +71 -0
package/dist/index.js ADDED
@@ -0,0 +1,378 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ const commander_1 = require("commander");
38
+ const node_path_1 = require("node:path");
39
+ const lib_1 = require("./lib");
40
+ const bundle_1 = require("./bundle");
41
+ const ability_1 = require("./ability");
42
+ const initAbility_1 = require("./initAbility");
43
+ const config_1 = require("./config");
44
+ const init_1 = require("./init");
45
+ const prompt_1 = require("./prompt");
46
+ const browserLogin_1 = require("./browserLogin");
47
+ const program = new commander_1.Command();
48
+ program
49
+ .name('helix')
50
+ .description('HELIX creator CLI — scaffold, validate, and publish Instant Worlds')
51
+ .version((0, lib_1.cliVersion)());
52
+ function fail(message) {
53
+ console.error(message);
54
+ process.exit(1);
55
+ }
56
+ function requireAuth() {
57
+ const creds = (0, config_1.loadCredentials)();
58
+ if (!creds)
59
+ fail('Not logged in (or token expired). Run: helix login');
60
+ return creds;
61
+ }
62
+ // Validate a token against the API, then persist it. Shared by the browser
63
+ // flow and the --token (CI/headless) path.
64
+ async function finishLogin(apiUrl, token) {
65
+ const api = new lib_1.HelixApi(apiUrl, token);
66
+ const user = await (0, lib_1.whoAmI)(api); // validates the token
67
+ const expiresAt = (0, config_1.jwtExpiresAtIso)(token);
68
+ (0, config_1.saveCredentials)({ apiUrl, token, expiresAt, username: user.username });
69
+ const until = expiresAt ? ` (valid until ${expiresAt.slice(0, 10)})` : '';
70
+ console.log(`✔ Logged in as ${user.username}${until}`);
71
+ }
72
+ program
73
+ .command('login')
74
+ .description('Log in to HELIX (opens your browser); use --token for CI/headless')
75
+ .option('--api-url <url>', 'platform API base URL', config_1.DEFAULT_API_URL)
76
+ .option('--web-url <url>', 'HELIX website base URL (default: HELIX_WEB_URL, else the environment default; set for local dev)')
77
+ .option('--token <token>', 'client token — non-interactive login for CI/headless')
78
+ .option('--no-browser', "don't open a browser automatically; print the URL to open manually")
79
+ .action(async (opts) => {
80
+ try {
81
+ // CI / headless: a token provided directly (or piped via prompt) — no browser.
82
+ if (opts.token !== undefined) {
83
+ const token = opts.token || (await (0, prompt_1.askHidden)('Client token: '));
84
+ if (!token)
85
+ fail('✖ No token provided.');
86
+ await finishLogin(opts.apiUrl, token);
87
+ return;
88
+ }
89
+ // Interactive: open the browser, let the website mint + hand back a token.
90
+ // An explicit --api-url derives its own site; otherwise use the env website default.
91
+ const webUrl = opts.webUrl ?? (opts.apiUrl === config_1.DEFAULT_API_URL ? config_1.DEFAULT_WEB_URL : (0, browserLogin_1.deriveWebUrl)(opts.apiUrl));
92
+ console.log(`Opening your browser to sign in (${webUrl}) …`);
93
+ const { token } = await (0, browserLogin_1.browserLogin)({
94
+ webUrl,
95
+ name: (0, browserLogin_1.defaultClientTokenName)(),
96
+ openBrowser: opts.browser !== false,
97
+ onUrl: (url) => console.log(`\nIf your browser didn't open, visit:\n ${url}\n\nWaiting for sign-in…`),
98
+ });
99
+ await finishLogin(opts.apiUrl, token);
100
+ }
101
+ catch (err) {
102
+ fail(err instanceof lib_1.ApiError
103
+ ? `${err.render()}\n (is the token valid and not expired?)`
104
+ : `✖ ${err instanceof Error ? err.message : String(err)}`);
105
+ }
106
+ });
107
+ program
108
+ .command('logout')
109
+ .description('Remove the stored client token')
110
+ .action(() => {
111
+ (0, config_1.clearCredentials)();
112
+ console.log('✔ Logged out.');
113
+ });
114
+ program
115
+ .command('whoami')
116
+ .description('Show the current login status')
117
+ .action(() => {
118
+ const status = (0, lib_1.authStatus)();
119
+ if (!status.loggedIn) {
120
+ console.log('Not logged in. Run: helix login');
121
+ return;
122
+ }
123
+ const until = status.expiresAt ? ` (until ${status.expiresAt.slice(0, 10)})` : '';
124
+ console.log(`${status.username} @ ${status.apiUrl}${until}`);
125
+ });
126
+ program
127
+ .command('init')
128
+ .description('Scaffold a minimal HELIX Instant world (or, with --ability, a humanoid-character ability) in a new directory')
129
+ .argument('<directory>', 'directory to create')
130
+ .option('--ability', 'scaffold an ability bundle for the humanoid-character system instead of a world')
131
+ .action((directory, opts) => {
132
+ try {
133
+ if (opts.ability) {
134
+ const created = (0, initAbility_1.initAbilityTemplate)((0, node_path_1.resolve)(directory));
135
+ console.log(`✔ Created ${created.length} files in ${directory}`);
136
+ console.log(`\nNext steps:\n 1. Edit ${directory}/ability.json — pick your own id\n` +
137
+ ` 2. helix validate-bundle ${directory}\n 3. From your world project: helix install ${directory} --first-party`);
138
+ return;
139
+ }
140
+ const created = (0, init_1.initTemplate)((0, node_path_1.resolve)(directory));
141
+ console.log(`✔ Created ${created.length} files in ${directory}`);
142
+ console.log(`\nNext steps:\n 1. Edit ${directory}/helix.json — pick your own slug\n` +
143
+ ` 2. helix validate ${directory}\n 3. helix publish ${directory}`);
144
+ }
145
+ catch (err) {
146
+ fail(`✖ ${err instanceof Error ? err.message : String(err)}`);
147
+ }
148
+ });
149
+ program
150
+ .command('validate-bundle')
151
+ .description('Validate an ability bundle against the frozen ability-v1 contract (the same module the runtime loader runs)')
152
+ .argument('[directory]', 'bundle directory (the built dist/)', '.')
153
+ .action(async (directory) => {
154
+ const validator = await (0, ability_1.loadVendoredValidator)();
155
+ const result = (0, ability_1.checkAbilityBundle)((0, node_path_1.resolve)(directory), validator);
156
+ if (result.errors.length || result.manifest === null) {
157
+ fail(`✖ ${result.errors.length} problem(s):\n${result.errors
158
+ .map((e) => ` - ${e}`)
159
+ .join('\n')}`);
160
+ }
161
+ const m = result.manifest;
162
+ console.log(`✔ Valid ability bundle: "${m.title}" (${m.id}@${m.version}, activation: ${m.activation.mode}, ${(m.clips ?? []).length} clips)`);
163
+ });
164
+ program
165
+ .command('install')
166
+ .description("Resolve this v0.2 world's system/ability pins, download their code, and write installed.json + helix.lock.json")
167
+ .argument('[path]', 'a local ability bundle to copy in (requires --first-party); omit for the world resolve+install')
168
+ .option('--update', 're-resolve pins against the live catalog and rewrite the lock (else the existing lock is replayed)')
169
+ .option('--first-party', 'FIRST-PARTY only: copy the local <path> bundle (code AND clips) into helix_modules — for engine devs testing co-located assets')
170
+ .option('--local', 'alias of --first-party (deprecated)')
171
+ .option('--api-url <url>', 'platform API base URL', config_1.DEFAULT_API_URL)
172
+ .action(async (path, opts) => {
173
+ const firstParty = Boolean(opts.firstParty || opts.local);
174
+ if (path !== undefined || firstParty) {
175
+ if (!path) {
176
+ fail('✖ --first-party needs a bundle path: helix install <bundle> --first-party');
177
+ }
178
+ if (!firstParty) {
179
+ fail("✖ to copy a local ability bundle use: helix install <bundle> --first-party\n (a bare `helix install` resolves this world's pins)");
180
+ }
181
+ try {
182
+ const [validator, indexValidator] = await Promise.all([
183
+ (0, ability_1.loadVendoredValidator)(),
184
+ (0, ability_1.loadInstalledIndexValidator)(),
185
+ ]);
186
+ const result = (0, ability_1.installLocalAbility)((0, node_path_1.resolve)(path), process.cwd(), validator, indexValidator);
187
+ console.log(`✔ Installed (first-party) ${result.id}@${result.version} -> ${ability_1.MODULES_DIR}/${result.path}/ (${result.installedCount} installed)`);
188
+ }
189
+ catch (err) {
190
+ fail(`✖ ${err instanceof Error ? err.message : String(err)}`);
191
+ }
192
+ return;
193
+ }
194
+ try {
195
+ const result = await (0, lib_1.installWorld)(process.cwd(), {
196
+ apiUrl: opts.apiUrl,
197
+ update: opts.update,
198
+ onProgress: (msg) => console.log(msg),
199
+ });
200
+ const sys = result.systems.map((s) => `${s.slug}@${s.version}`).join(', ') || '(none)';
201
+ const abl = result.abilities.map((a) => `${a.slug}@${a.version}`).join(', ') || '(none)';
202
+ console.log(`✔ ${result.reresolved ? 'Resolved' : 'Replayed lock'} — systems: ${sys}; abilities: ${abl}`);
203
+ console.log(` code -> public/${ability_1.MODULES_DIR}/ · assets stream from the CDN · lock -> ${lib_1.LOCKFILE}`);
204
+ if (result.runtime) {
205
+ console.log(` three ${result.runtime.threeVersion} -> import map + src/helix.runtime.ts wired to the hosted runtime`);
206
+ }
207
+ }
208
+ catch (err) {
209
+ fail(err instanceof lib_1.ApiError
210
+ ? err.render()
211
+ : `✖ ${err instanceof Error ? err.message : String(err)}`);
212
+ }
213
+ });
214
+ program
215
+ .command('validate')
216
+ .description('Validate a world bundle locally (same rules the server enforces)')
217
+ .argument('[directory]', 'bundle directory', '.')
218
+ .action((directory) => {
219
+ const result = (0, bundle_1.checkBundle)((0, node_path_1.resolve)(directory));
220
+ if (result.errors.length) {
221
+ fail(`✖ ${result.errors.length} problem(s):\n${result.errors
222
+ .map((e) => ` - ${e}`)
223
+ .join('\n')}`);
224
+ }
225
+ const total = result.files.reduce((sum, f) => sum + f.size, 0);
226
+ console.log(`✔ Valid bundle: "${result.manifest.title}" (${result.files.length} files, ${(total / 1024).toFixed(1)} KiB)`);
227
+ });
228
+ program
229
+ .command('publish')
230
+ .description('Publish a world to HELIX Instant')
231
+ .argument('[directory]', 'bundle directory', '.')
232
+ .action(async (directory) => {
233
+ const creds = requireAuth();
234
+ try {
235
+ const result = await (0, lib_1.publishWorld)((0, node_path_1.resolve)(directory), creds, (msg) => console.log(msg));
236
+ console.log(`✔ Published "${result.title}" build ${result.buildNumber}`);
237
+ if (result.playUrl)
238
+ console.log(` play: ${result.playUrl}`);
239
+ console.log(` api: ${result.worldUrl}`);
240
+ }
241
+ catch (err) {
242
+ fail(err instanceof lib_1.ApiError
243
+ ? err.render()
244
+ : `✖ ${err instanceof Error ? err.message : String(err)}`);
245
+ }
246
+ });
247
+ program
248
+ .command('publish-package')
249
+ .description('Publish a system / ability / asset-pack bundle (requires an admin account)')
250
+ .argument('[directory]', 'bundle directory (the built dist/)', '.')
251
+ .action(async (directory) => {
252
+ const creds = requireAuth();
253
+ try {
254
+ const result = await (0, lib_1.publishPackage)((0, node_path_1.resolve)(directory), creds, (msg) => console.log(msg));
255
+ console.log(`✔ Published ${result.kind} ${result.slug}@${result.version} (revision ${result.revision})`);
256
+ console.log(` code: ${result.codeBaseUrl}`);
257
+ if (result.assetBaseUrl)
258
+ console.log(` assets: ${result.assetBaseUrl}`);
259
+ }
260
+ catch (err) {
261
+ fail(err instanceof lib_1.ApiError
262
+ ? err.render()
263
+ : `✖ ${err instanceof Error ? err.message : String(err)}`);
264
+ }
265
+ });
266
+ async function printCatalog(kind, system, apiUrlOpt) {
267
+ const apiUrl = apiUrlOpt ?? (0, config_1.loadCredentials)()?.apiUrl ?? config_1.DEFAULT_API_URL;
268
+ try {
269
+ const res = await (0, lib_1.listPackages)(apiUrl, kind, system);
270
+ const plural = kind === 'ability' ? 'abilities' : kind === 'asset-pack' ? 'asset-packs' : `${kind}s`;
271
+ if (res.data.length === 0) {
272
+ console.log(`No ${plural} published yet.`);
273
+ return;
274
+ }
275
+ for (const p of res.data) {
276
+ const sys = p.targetSystem
277
+ ? ` [system: ${p.targetSystem.id}${p.targetSystem.range ? `@${p.targetSystem.range}` : ''}]`
278
+ : '';
279
+ console.log(`- ${p.slug}@${p.latestVersion ?? '?'} — ${p.title}${sys}`);
280
+ }
281
+ }
282
+ catch (err) {
283
+ fail(err instanceof lib_1.ApiError
284
+ ? err.render()
285
+ : `✖ ${err instanceof Error ? err.message : String(err)}`);
286
+ }
287
+ }
288
+ program
289
+ .command('list-systems')
290
+ .description('List the systems published on HELIX Instant')
291
+ .option('--api-url <url>', 'platform API base URL')
292
+ .action((opts) => printCatalog('system', undefined, opts.apiUrl));
293
+ program
294
+ .command('list-abilities')
295
+ .description('List the abilities published on HELIX Instant')
296
+ .option('--system <id>', 'only abilities targeting this system id')
297
+ .option('--api-url <url>', 'platform API base URL')
298
+ .action((opts) => printCatalog('ability', opts.system, opts.apiUrl));
299
+ const character = program
300
+ .command('character')
301
+ .description('Character asset tools — convert external biped GLBs into helix-humanoid characters');
302
+ character
303
+ .command('import')
304
+ .description('Convert a Meshy/Mixamo-style biped GLB into a helix-humanoid@1 character: conform onto the canonical skeleton, generate LODs, encode KTX2')
305
+ .argument('<body>', 'source biped character GLB (skinned body)')
306
+ .option('--map <json>', 'bone map JSON file (default: the bundled Meshy->helix map)')
307
+ .option('--canonical <glb>', "canonical helix body GLB (default: the world's installed humanoid-character pack when present, else the embedded helix-humanoid@1 skeleton)")
308
+ .option('--anim <glb>', 'also retarget this animation GLB (same source rig) -> <out>/anims/<clipName>.glb')
309
+ .option('--clip-name <name>', 'clip name for --anim', 'locomotion.warriorWalk')
310
+ .option('-o, --output <dir>', 'output directory', './character-out')
311
+ .option('--name <base>', 'output basename -> <base>.web.glb (default: derived from the input file name)')
312
+ .option('--lod-tris <a,b,c>', 'triangle target per LOD level, high->low', '10000,5000,1500')
313
+ .option('--tex-size <n>', 'texture longest-edge cap; the rebake route halves it per LOD level', '1024')
314
+ .option('--ktx-mode <m[,m2..]>', 'KTX2 codec per LOD level, etc1s or uastc; shorter lists repeat the last entry (default uastc,etc1s — UASTC up close, ETC1S far)')
315
+ .option('--ktx-quality <n>', 'etc1s qlevel 1..255 / uastc level 0..4')
316
+ .option('--simplify-error <e>', 'meshopt error budget (imports resist collapse; raise if LODs miss target)', '0.02')
317
+ .option('--lock-border', 'preserve UV-seam/material-boundary verts during decimation (OFF by default for imports)')
318
+ .option('--bake', 'force the weld+unwrap+rebake LOD path (default: AUTO on micro-chart atlases)')
319
+ .option('--no-bake', 'disable the weld+unwrap+rebake LOD path')
320
+ .option('--no-weld', 'also disable the (non-bake) seam-weld fallback for floored far LODs')
321
+ .option('--no-split-face', "keep each LOD as one mesh (default: head geometry is sliced into a 'FaceMesh' node so first-person mode can hide it)")
322
+ .action(async (body, opts) => {
323
+ try {
324
+ // Heavy module (gltf-transform + meshoptimizer) — loaded only when the command actually runs.
325
+ const { importCharacter } = await Promise.resolve().then(() => __importStar(require('./character/importCharacter')));
326
+ const ktxModes = opts.ktxMode?.split(',').map((s) => s.trim());
327
+ for (const m of ktxModes ?? [])
328
+ if (m !== 'etc1s' && m !== 'uastc')
329
+ fail(`✖ --ktx-mode entries must be etc1s or uastc, got '${m}'`);
330
+ await importCharacter({
331
+ body: (0, node_path_1.resolve)(body),
332
+ map: opts.map ? (0, node_path_1.resolve)(opts.map) : undefined,
333
+ canonical: opts.canonical ? (0, node_path_1.resolve)(opts.canonical) : undefined,
334
+ anim: opts.anim ? (0, node_path_1.resolve)(opts.anim) : undefined,
335
+ clipName: opts.clipName,
336
+ output: opts.output,
337
+ name: opts.name,
338
+ lodTris: opts.lodTris.split(',').map((s) => Number(s.trim())).filter((n) => Number.isFinite(n) && n > 0),
339
+ texSize: Number(opts.texSize),
340
+ ktxModes: ktxModes,
341
+ ktxQuality: opts.ktxQuality !== undefined ? Number(opts.ktxQuality) : undefined,
342
+ simplifyError: Number(opts.simplifyError),
343
+ lockBorder: opts.lockBorder ?? false,
344
+ bake: opts.bake,
345
+ weld: opts.weld,
346
+ splitFace: opts.splitFace,
347
+ });
348
+ }
349
+ catch (err) {
350
+ fail(`✖ ${err instanceof Error ? err.message : String(err)}`);
351
+ }
352
+ });
353
+ program
354
+ .command('doctor')
355
+ .description('Health check: login state + whether the @helix toolchain (CLI/MCP/SDK/manifest) is up to date')
356
+ .option('--project <dir>', 'a world/ability project dir to also check its pinned @helix deps', '.')
357
+ .action(async (opts) => {
358
+ console.log(`HELIX environment: ${config_1.HELIX_ENV} · API ${config_1.DEFAULT_API_URL} · website ${config_1.DEFAULT_WEB_URL}`);
359
+ const status = (0, lib_1.authStatus)();
360
+ console.log(status.loggedIn
361
+ ? `✔ Logged in as ${status.username} (${status.apiUrl})`
362
+ : '• Not logged in — run: helix login');
363
+ const rows = await (0, lib_1.checkForUpdates)({ projectDir: (0, node_path_1.resolve)(opts.project) });
364
+ console.log('\n@helix toolchain:');
365
+ for (const r of rows) {
366
+ const mark = r.status === 'current' ? '✔' : r.status === 'update-available' ? '⬆' : '•';
367
+ const line = ` ${mark} ${r.name.padEnd(26)} ${(r.installed ?? '—').padEnd(18)} (latest ${r.latest ?? '?'})`;
368
+ console.log(r.status === 'update-available' ? `${line} → ${r.updateHint}` : line);
369
+ }
370
+ const stale = rows.filter((r) => r.status === 'update-available');
371
+ console.log(stale.length
372
+ ? `\n${stale.length} update(s) available.`
373
+ : '\nAll detected packages are current.');
374
+ });
375
+ program
376
+ .parseAsync()
377
+ .catch((err) => fail(`✖ ${err instanceof Error ? err.message : String(err)}`));
378
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAoC;AACpC,yCAAoC;AACpC,+BAYe;AACf,qCAAuC;AACvC,uCAMmB;AACnB,+CAAoD;AACpD,qCAQkB;AAClB,iCAAsC;AACtC,qCAAqC;AACrC,iDAAoF;AAEpF,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAC9B,OAAO;KACJ,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,oEAAoE,CAAC;KACjF,OAAO,CAAC,IAAA,gBAAU,GAAE,CAAC,CAAC;AAEzB,SAAS,IAAI,CAAC,OAAe;IAC3B,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACvB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,WAAW;IAClB,MAAM,KAAK,GAAG,IAAA,wBAAe,GAAE,CAAC;IAChC,IAAI,CAAC,KAAK;QAAE,IAAI,CAAC,oDAAoD,CAAC,CAAC;IACvE,OAAO,KAAK,CAAC;AACf,CAAC;AAED,2EAA2E;AAC3E,2CAA2C;AAC3C,KAAK,UAAU,WAAW,CAAC,MAAc,EAAE,KAAa;IACtD,MAAM,GAAG,GAAG,IAAI,cAAQ,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IACxC,MAAM,IAAI,GAAG,MAAM,IAAA,YAAM,EAAC,GAAG,CAAC,CAAC,CAAC,sBAAsB;IACtD,MAAM,SAAS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AC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,KAAK,kBAAkB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC;QACxF,MAAM,IAAI,GAAG,KAAK,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,IAAI,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,MAAM,IAAI,GAAG,GAAG,CAAC;QAC7G,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,KAAK,kBAAkB,CAAC,CAAC,CAAC,GAAG,IAAI,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IACrF,CAAC;IACD,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,kBAAkB,CAAC,CAAC;IAClE,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM;QACV,CAAC,CAAC,KAAK,KAAK,CAAC,MAAM,uBAAuB;QAC1C,CAAC,CAAC,sCAAsC,CAC3C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,UAAU,EAAE;KACZ,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CACb,IAAI,CAAC,KAAK,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAC9D,CAAC"}
package/dist/init.d.ts ADDED
@@ -0,0 +1 @@
1
+ export declare function initTemplate(targetDir: string): string[];
package/dist/init.js ADDED
@@ -0,0 +1,87 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initTemplate = initTemplate;
4
+ const node_fs_1 = require("node:fs");
5
+ const node_path_1 = require("node:path");
6
+ // Minimal no-build starter: plain Three.js from a CDN import map, no bundler.
7
+ // The SDK-integrated Vite templates (template-spinning-scene, template-hangout)
8
+ // are the real starting points; this exists so `helix init` works standalone.
9
+ const TEMPLATE_FILES = {
10
+ 'helix.json': (slug) => JSON.stringify({
11
+ helixVersion: '0.1',
12
+ title: 'My HELIX World',
13
+ slug,
14
+ entry: 'index.html',
15
+ maxPlayers: 1,
16
+ permissions: [],
17
+ supportsMobile: true,
18
+ contentRating: 'everyone',
19
+ }, null, 2) + '\n',
20
+ 'index.html': () => `<!doctype html>
21
+ <html lang="en">
22
+ <head>
23
+ <meta charset="utf-8" />
24
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
25
+ <title>My HELIX World</title>
26
+ <style>html, body { margin: 0; height: 100%; overflow: hidden; background: #0a0a12; }</style>
27
+ <script type="importmap">
28
+ { "imports": { "three": "https://cdn.jsdelivr.net/npm/three@0.172.0/build/three.module.js" } }
29
+ </script>
30
+ </head>
31
+ <body>
32
+ <script type="module" src="main.js"></script>
33
+ </body>
34
+ </html>
35
+ `,
36
+ 'main.js': () => `import * as THREE from 'three';
37
+
38
+ const scene = new THREE.Scene();
39
+ const camera = new THREE.PerspectiveCamera(70, innerWidth / innerHeight, 0.1, 100);
40
+ camera.position.z = 3;
41
+
42
+ const renderer = new THREE.WebGLRenderer({ antialias: true });
43
+ renderer.setSize(innerWidth, innerHeight);
44
+ document.body.appendChild(renderer.domElement);
45
+
46
+ const cube = new THREE.Mesh(
47
+ new THREE.BoxGeometry(),
48
+ new THREE.MeshStandardMaterial({ color: 0x7c4dff }),
49
+ );
50
+ scene.add(cube);
51
+ scene.add(new THREE.AmbientLight(0xffffff, 0.4));
52
+ const light = new THREE.DirectionalLight(0xffffff, 1.2);
53
+ light.position.set(2, 3, 4);
54
+ scene.add(light);
55
+
56
+ addEventListener('resize', () => {
57
+ camera.aspect = innerWidth / innerHeight;
58
+ camera.updateProjectionMatrix();
59
+ renderer.setSize(innerWidth, innerHeight);
60
+ });
61
+
62
+ renderer.setAnimationLoop(() => {
63
+ cube.rotation.x += 0.01;
64
+ cube.rotation.y += 0.013;
65
+ renderer.render(scene, camera);
66
+ });
67
+ `,
68
+ };
69
+ function initTemplate(targetDir) {
70
+ if ((0, node_fs_1.existsSync)(targetDir))
71
+ throw new Error(`directory already exists: ${targetDir}`);
72
+ const slug = (0, node_path_1.basename)(targetDir)
73
+ .toLowerCase()
74
+ .replace(/[^a-z0-9-]+/g, '-')
75
+ .replace(/^-+|-+$/g, '')
76
+ .slice(0, 50)
77
+ .padEnd(3, '0');
78
+ const created = [];
79
+ for (const [path, render] of Object.entries(TEMPLATE_FILES)) {
80
+ const absolute = (0, node_path_1.join)(targetDir, path);
81
+ (0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(absolute), { recursive: true });
82
+ (0, node_fs_1.writeFileSync)(absolute, render(slug), 'utf8');
83
+ created.push(path);
84
+ }
85
+ return created;
86
+ }
87
+ //# sourceMappingURL=init.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;AAwEA,oCAiBC;AAzFD,qCAA+D;AAC/D,yCAAoD;AAEpD,8EAA8E;AAC9E,gFAAgF;AAChF,8EAA8E;AAC9E,MAAM,cAAc,GAA6C;IAC/D,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CACrB,IAAI,CAAC,SAAS,CACZ;QACE,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,gBAAgB;QACvB,IAAI;QACJ,KAAK,EAAE,YAAY;QACnB,UAAU,EAAE,CAAC;QACb,WAAW,EAAE,EAAE;QACf,cAAc,EAAE,IAAI;QACpB,aAAa,EAAE,UAAU;KAC1B,EACD,IAAI,EACJ,CAAC,CACF,GAAG,IAAI;IACV,YAAY,EAAE,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;CAerB;IACC,SAAS,EAAE,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+BlB;CACA,CAAC;AAEF,SAAgB,YAAY,CAAC,SAAiB;IAC5C,IAAI,IAAA,oBAAU,EAAC,SAAS,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,6BAA6B,SAAS,EAAE,CAAC,CAAC;IACrF,MAAM,IAAI,GAAG,IAAA,oBAAQ,EAAC,SAAS,CAAC;SAC7B,WAAW,EAAE;SACb,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC;SAC5B,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;SACvB,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;SACZ,MAAM,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IAElB,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,cAAc,CAAC,EAAE,CAAC;QAC5D,MAAM,QAAQ,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,IAAI,CAAC,CAAC;QACvC,IAAA,mBAAS,EAAC,IAAA,mBAAO,EAAC,QAAQ,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAClD,IAAA,uBAAa,EAAC,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,CAAC;QAC9C,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACrB,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function initAbilityTemplate(targetDir: string): string[];
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.initAbilityTemplate = initAbilityTemplate;
4
+ const node_fs_1 = require("node:fs");
5
+ const node_path_1 = require("node:path");
6
+ // Minimal no-build ability scaffold for the humanoid-character system: plain-JS entry, directly
7
+ // installable (`helix install <dir> --local`) with no build step. The TS template with vendored
8
+ // system types (helix-instant-templates/humanoid-character-ability) is the real starting point;
9
+ // this exists so `helix init --ability` works standalone — mirroring the world `init` pattern.
10
+ const TEMPLATE_FILES = {
11
+ 'ability.json': (id) => JSON.stringify({
12
+ $schema: 'https://helix.dev/schemas/ability-v1.schema.json',
13
+ schemaVersion: 1,
14
+ id,
15
+ version: '0.1.0',
16
+ title: 'My Ability',
17
+ description: 'Describe what the ability does and any blackboard params the world must publish.',
18
+ system: { id: 'humanoid-character', version: '^0.1.0', skeleton: 'helix-humanoid@1' },
19
+ activation: { mode: 'manual', action: `${id}.toggle`, style: 'toggle' },
20
+ actions: [{ id: `${id}.toggle`, kind: 'button', defaultBinding: { keys: ['KeyG'] } }],
21
+ configSchema: 'schema/config.schema.json',
22
+ entry: 'index.js',
23
+ }, null, 2) + '\n',
24
+ 'schema/config.schema.json': () => JSON.stringify({
25
+ type: 'object',
26
+ properties: {
27
+ power: { type: 'number', default: 1, minimum: 0, maximum: 10, description: 'Example tunable; agents set it live as <abilityId>.power.' },
28
+ },
29
+ }, null, 2) + '\n',
30
+ 'index.js': (id) => `// Ability entry — the default export implements the system Ability interface.
31
+ // No runtime imports: bare specifiers don't resolve when the platform import()s this file;
32
+ // everything the ability touches comes through the AbilityContext (ctx) the system passes in.
33
+ export default class MyAbility {
34
+ manifest = { id: '${id}' };
35
+
36
+ onActivate(ctx) {
37
+ // Activated by the manifest action (KeyG). Channels declared in ability.json are claimed.
38
+ void ctx;
39
+ }
40
+
41
+ onTick(dt, ctx) {
42
+ const power = ctx.config.get('power'); // agents see this as '${id}.power'
43
+ void dt;
44
+ void power;
45
+ }
46
+
47
+ onDeactivate(ctx) {
48
+ void ctx;
49
+ }
50
+ }
51
+ `,
52
+ };
53
+ function initAbilityTemplate(targetDir) {
54
+ if ((0, node_fs_1.existsSync)(targetDir))
55
+ throw new Error(`directory already exists: ${targetDir}`);
56
+ const id = (0, node_path_1.basename)(targetDir)
57
+ .toLowerCase()
58
+ .replace(/[^a-z0-9-]+/g, '-')
59
+ .replace(/^-+|-+$/g, '')
60
+ .slice(0, 50)
61
+ .padEnd(3, '0');
62
+ const created = [];
63
+ for (const [path, render] of Object.entries(TEMPLATE_FILES)) {
64
+ const absolute = (0, node_path_1.join)(targetDir, path);
65
+ (0, node_fs_1.mkdirSync)((0, node_path_1.dirname)(absolute), { recursive: true });
66
+ (0, node_fs_1.writeFileSync)(absolute, render(id), 'utf8');
67
+ created.push(path);
68
+ }
69
+ return created;
70
+ }
71
+ //# sourceMappingURL=initAbility.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"initAbility.js","sourceRoot":"","sources":["../src/initAbility.ts"],"names":[],"mappings":";;AA6DA,kDAiBC;AA9ED,qCAA+D;AAC/D,yCAAoD;AAEpD,gGAAgG;AAChG,gGAAgG;AAChG,gGAAgG;AAChG,+FAA+F;AAC/F,MAAM,cAAc,GAA2C;IAC7D,cAAc,EAAE,CAAC,EAAE,EAAE,EAAE,CACrB,IAAI,CAAC,SAAS,CACZ;QACE,OAAO,EAAE,kDAAkD;QAC3D,aAAa,EAAE,CAAC;QAChB,EAAE;QACF,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,YAAY;QACnB,WAAW,EAAE,kFAAkF;QAC/F,MAAM,EAAE,EAAE,EAAE,EAAE,oBAAoB,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,kBAAkB,EAAE;QACrF,UAAU,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,EAAE,QAAQ,EAAE;QACvE,OAAO,EAAE,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;QACrF,YAAY,EAAE,2BAA2B;QACzC,KAAK,EAAE,UAAU;KAClB,EACD,IAAI,EACJ,CAAC,CACF,GAAG,IAAI;IACV,2BAA2B,EAAE,GAAG,EAAE,CAChC,IAAI,CAA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OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { type ManifestIssue } from './ability';
2
+ import { type ResolvedPackage, type ResolvedPins, type WorldPins } from './resolve';
3
+ export declare const MODULES_DIR = "helix_modules";
4
+ export declare const INSTALLED_INDEX = "installed.json";
5
+ export declare const LOCKFILE = "helix.lock.json";
6
+ export declare const RUNTIME_MODULE = "helix.runtime.ts";
7
+ /** A v2 install-index entry: code from a (here local, root-absolute) base; clips from the CDN. */
8
+ export type InstalledEntry = {
9
+ id: string;
10
+ version: string;
11
+ codeUrl: string;
12
+ assetBaseUrl: string;
13
+ };
14
+ export type WorldLock = {
15
+ lockfileVersion: 1;
16
+ systems: ResolvedPackage[];
17
+ abilities: ResolvedPackage[];
18
+ };
19
+ export type InstallWorldResult = {
20
+ manifestPath: string;
21
+ modulesDir: string;
22
+ systems: Array<{
23
+ slug: string;
24
+ version: string;
25
+ }>;
26
+ abilities: Array<{
27
+ slug: string;
28
+ version: string;
29
+ }>;
30
+ /** true when --update re-resolved the catalog; false when the existing lock was replayed. */
31
+ reresolved: boolean;
32
+ /** The hosted-three URLs install wired into index.html + src/helix.runtime.ts (null if no system pinned). */
33
+ runtime: {
34
+ threeVersion: string;
35
+ threeModuleUrl: string;
36
+ transcoderPath: string;
37
+ } | null;
38
+ };
39
+ export type InstallDeps = {
40
+ resolve(pins: WorldPins): Promise<ResolvedPins>;
41
+ download(codeBaseUrl: string, files: string[], destDir: string): Promise<void>;
42
+ satisfies(version: string, normalizedRange: string): boolean;
43
+ validateIndex(value: unknown): ManifestIssue[];
44
+ };
45
+ export type InstallWorldOptions = {
46
+ apiUrl: string;
47
+ update?: boolean;
48
+ onProgress?: (msg: string) => void;
49
+ deps?: InstallDeps;
50
+ };
51
+ export declare function installWorld(worldDir: string, opts: InstallWorldOptions): Promise<InstallWorldResult>;