@forgeax/engine-devkit 0.1.7 → 0.1.20

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 (40) hide show
  1. package/README.md +21 -2
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/__tests__/native-preview-dispatch.test.d.ts +2 -0
  4. package/dist/__tests__/native-preview-dispatch.test.d.ts.map +1 -0
  5. package/dist/__tests__/native-preview-subject-draw.unit.test.d.ts +2 -0
  6. package/dist/__tests__/native-preview-subject-draw.unit.test.d.ts.map +1 -0
  7. package/dist/__tests__/single-html-runtime.e2e.test.d.ts +2 -0
  8. package/dist/__tests__/single-html-runtime.e2e.test.d.ts.map +1 -0
  9. package/dist/__tests__/single-html.test.d.ts +2 -0
  10. package/dist/__tests__/single-html.test.d.ts.map +1 -0
  11. package/dist/bootstrap-commands.d.ts.map +1 -1
  12. package/dist/cli-output.d.ts.map +1 -1
  13. package/dist/cli.mjs +1777 -133
  14. package/dist/cli.mjs.map +1 -1
  15. package/dist/commands.d.ts.map +1 -1
  16. package/dist/dist.d.ts +2 -2
  17. package/dist/dist.d.ts.map +1 -1
  18. package/dist/host.d.ts +6 -1
  19. package/dist/host.d.ts.map +1 -1
  20. package/dist/index.d.ts +5 -3
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.mjs +2317 -1125
  23. package/dist/index.mjs.map +1 -1
  24. package/dist/sdk-bootstrap.d.ts +6 -1
  25. package/dist/sdk-bootstrap.d.ts.map +1 -1
  26. package/dist/sdk-cli.mjs +33 -15
  27. package/dist/sdk-cli.mjs.map +1 -1
  28. package/dist/sdk.d.ts +1 -3
  29. package/dist/sdk.d.ts.map +1 -1
  30. package/dist/single-html.d.ts +43 -0
  31. package/dist/single-html.d.ts.map +1 -0
  32. package/dist/software-capture.d.ts +38 -0
  33. package/dist/software-capture.d.ts.map +1 -1
  34. package/dist/tools/client.d.ts.map +1 -1
  35. package/dist/tools/native-preview.d.ts.map +1 -1
  36. package/dist/tools/preview-contributions.d.ts +0 -5
  37. package/dist/tools/preview-contributions.d.ts.map +1 -1
  38. package/dist/types.d.ts +2 -0
  39. package/dist/types.d.ts.map +1 -1
  40. package/package.json +33 -31
@@ -17,7 +17,12 @@ export interface SdkInitReport extends SdkInitState {
17
17
  }
18
18
  export interface AgentOnboarding {
19
19
  readonly read: readonly string[];
20
- readonly next: {
20
+ readonly templateSelection?: {
21
+ readonly required: true;
22
+ readonly game3d: 'game-3d';
23
+ readonly otherwise: 'empty';
24
+ };
25
+ readonly next?: {
21
26
  readonly cwd: string;
22
27
  readonly argv: readonly string[];
23
28
  };
@@ -1 +1 @@
1
- {"version":3,"file":"sdk-bootstrap.d.ts","sourceRoot":"","sources":["../src/sdk-bootstrap.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAIhD,QAAA,MAAM,uBAAuB,EAAG,OAAgB,CAAC;AAEjD,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,aAAa,EAAE,OAAO,uBAAuB,CAAC;IACvD,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,UAAU,CAAC;IACvC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;CACtC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,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,OAAO,CAAC;IAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GACtE,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAkDvC"}
package/dist/sdk-cli.mjs CHANGED
@@ -31,7 +31,7 @@ var SDK_DEV_DEPENDENCIES = {
31
31
  "@webgpu/types": "0.1.71",
32
32
  tsx: "4.23.1",
33
33
  typescript: "6.0.3",
34
- vitest: "4.0.18"
34
+ vitest: "4.1.11"
35
35
  };
36
36
  function createInitPlan(facts, sdk) {
37
37
  const manifest = structuredClone(facts.packageJson);
@@ -4923,15 +4923,12 @@ async function findSdkContext() {
4923
4923
  const templates = new Map(
4924
4924
  manifest.templates.map((template2) => [template2.id, resolve(cursor, template2.root)])
4925
4925
  );
4926
- const defaultTemplate = manifest.templates.find((template2) => template2.default);
4927
- if (defaultTemplate === void 0) throw new Error("sdk-default-template-missing");
4928
4926
  const store = resolve(cursor, "store", "pnpm");
4929
4927
  return {
4930
4928
  root: cursor,
4931
4929
  manifest,
4932
4930
  ...await readable(store) ? { store } : {},
4933
- templates,
4934
- defaultTemplate: defaultTemplate.id
4931
+ templates
4935
4932
  };
4936
4933
  }
4937
4934
  const parent = dirname(cursor);
@@ -4950,10 +4947,14 @@ function agentOnboarding(sdk, projectRoot) {
4950
4947
  resolve(root2, "skills", "forgeax-engine-sdk", "SKILL.md"),
4951
4948
  resolve(root2, "skills", "forgeax-engine-sdk", "references", "feature-catalog.md")
4952
4949
  ],
4953
- next: projectRoot === void 0 ? {
4954
- cwd: root2,
4955
- argv: ["node", "./bin/forgeax.mjs", "new", "../my-game"]
4956
- } : { cwd: root2, argv: ["pnpm", "exec", "forgeax", "list", "--json"] }
4950
+ ...projectRoot === void 0 ? {
4951
+ templateSelection: {
4952
+ required: true,
4953
+ game3d: "game-3d",
4954
+ otherwise: "empty"
4955
+ }
4956
+ } : {},
4957
+ ...projectRoot === void 0 ? {} : { next: { cwd: root2, argv: ["pnpm", "exec", "forgeax", "list", "--json"] } }
4957
4958
  };
4958
4959
  }
4959
4960
  function sdkInitPath(sdk) {
@@ -5035,8 +5036,8 @@ async function requireSdkInitialization(sdk) {
5035
5036
  return { ok: true, value: state };
5036
5037
  }
5037
5038
  async function copyBootstrapInputs(sdk, root2) {
5038
- const template2 = sdk.templates.get(sdk.defaultTemplate);
5039
- if (template2 === void 0) throw new Error("sdk-default-template-missing");
5039
+ const template2 = sdk.templates.get("empty");
5040
+ if (template2 === void 0) throw new Error("sdk-bootstrap-template-missing");
5040
5041
  for (const name of ["package.json", "pnpm-lock.yaml", "pnpm-workspace.yaml"]) {
5041
5042
  await cp(resolve(template2, name), resolve(root2, name));
5042
5043
  }
@@ -5620,8 +5621,8 @@ async function initCommand(options = {}) {
5620
5621
  const applied = await applyInitPlan(facts.value, plan.value, options);
5621
5622
  if (!applied.ok || options.dryRun === true) return applied;
5622
5623
  if (sdk !== void 0) {
5623
- const template2 = sdk.templates.get(sdk.defaultTemplate);
5624
- if (template2 === void 0) throw new Error("sdk-default-template-missing");
5624
+ const template2 = sdk.templates.get("empty");
5625
+ if (template2 === void 0) throw new Error("sdk-bootstrap-template-missing");
5625
5626
  await copyFile(
5626
5627
  resolve(template2, "pnpm-lock.yaml"),
5627
5628
  resolve(facts.value.root, "pnpm-lock.yaml")
@@ -5689,7 +5690,18 @@ async function newCommand(options = {}) {
5689
5690
  }
5690
5691
  };
5691
5692
  }
5692
- const templateId = options.template ?? sdk.defaultTemplate;
5693
+ if (options.template === void 0) {
5694
+ return {
5695
+ ok: false,
5696
+ error: {
5697
+ code: "sdk-template-required",
5698
+ expected: "forgeax new to select exactly one template with --template",
5699
+ hint: "Use --template game-3d for a 3D game; otherwise use --template empty.",
5700
+ detail: { templates: [...sdk.templates.keys()].sort() }
5701
+ }
5702
+ };
5703
+ }
5704
+ const templateId = options.template;
5693
5705
  const template2 = sdk.templates.get(templateId);
5694
5706
  if (template2 === void 0) {
5695
5707
  return {
@@ -5810,6 +5822,12 @@ function agentOnboardingLines(value) {
5810
5822
  if (onboarding === null || typeof onboarding !== "object" || Array.isArray(onboarding)) return [];
5811
5823
  const candidate = onboarding;
5812
5824
  const lines = Array.isArray(candidate.read) ? candidate.read.filter((path) => typeof path === "string").map((path) => `[forgeax] read: ${path}`) : [];
5825
+ const selection = candidate.templateSelection;
5826
+ if (selection !== null && typeof selection === "object" && !Array.isArray(selection)) {
5827
+ lines.push("[forgeax] template required: use game-3d for a 3D game; otherwise use empty");
5828
+ lines.push("[forgeax] create 3D: forgeax new <directory> --template game-3d");
5829
+ lines.push("[forgeax] create other: forgeax new <directory> --template empty");
5830
+ }
5813
5831
  if (typeof candidate.next?.cwd === "string" && Array.isArray(candidate.next.argv) && candidate.next.argv.every((part) => typeof part === "string")) {
5814
5832
  lines.push(`[forgeax] next cwd: ${candidate.next.cwd}`);
5815
5833
  lines.push(`[forgeax] next: ${candidate.next.argv.join(" ")}`);
@@ -5830,7 +5848,7 @@ function sdkUpdateLines(value) {
5830
5848
  ];
5831
5849
  }
5832
5850
  function renderForgeaxUsage() {
5833
- return "Usage: forgeax new [directory] [--template empty|game-3d]\n forgeax <init|doctor|test|dev|build|package|serve|preview> [directory]\n forgeax capture [directory] [--backend auto|software|hardware] [--require-ui] [--deterministic] [--headless] [--output PATH]\n forgeax engine <status|doctor|unlink> [--root directory]\n forgeax engine use-local <engine-directory> [--root directory]\n forgeax package [directory] [--output release/game-web.zip]\n forgeax run <rhi.capture|rhi.summary|rhi.inspect> [options]\n forgeax run <operation-id> --input <request.json>\n forgeax exec <program.mjs> [--json]\n forgeax asset <add|verify|inspect|list> [subject]\n forgeax shader check [path]\n forgeax plugin <install|uninstall> <module-or-id> [options]\n forgeax skill <install|verify> [--root directory]\n forgeax sdk install <directory> [--version VERSION]\n";
5851
+ return "Usage: forgeax new [directory] --template empty|game-3d\n forgeax <init|doctor|test|dev|build|package|serve|preview> [directory]\n forgeax capture [directory] [--backend auto|software|hardware] [--require-ui] [--deterministic] [--headless] [--output PATH]\n forgeax engine <status|doctor|unlink> [--root directory]\n forgeax engine use-local <engine-directory> [--root directory]\n forgeax package [directory] [--format web-zip|single-html] [--output PATH]\n forgeax run <rhi.capture|rhi.summary|rhi.inspect> [options]\n forgeax run <operation-id> --input <request.json>\n forgeax exec <program.mjs> [--json]\n forgeax asset <add|verify|inspect|list> [subject]\n forgeax shader check [path]\n forgeax plugin <install|uninstall> <module-or-id> [options]\n forgeax skill <install|verify> [--root directory]\n forgeax sdk install <directory> [--version VERSION]\n";
5834
5852
  }
5835
5853
 
5836
5854
  // src/sdk-cli.ts