@forgeax/engine-devkit 0.1.4 → 0.1.7

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 (68) hide show
  1. package/README.md +162 -5
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/__tests__/cli-output.unit.test.d.ts +2 -0
  4. package/dist/__tests__/cli-output.unit.test.d.ts.map +1 -0
  5. package/dist/__tests__/engine-binding.unit.test.d.ts +2 -0
  6. package/dist/__tests__/engine-binding.unit.test.d.ts.map +1 -0
  7. package/dist/__tests__/gltf-source-key-diagnostics.integration.test.d.ts +2 -0
  8. package/dist/__tests__/gltf-source-key-diagnostics.integration.test.d.ts.map +1 -0
  9. package/dist/__tests__/preview-port.integration.test.d.ts +2 -0
  10. package/dist/__tests__/preview-port.integration.test.d.ts.map +1 -0
  11. package/dist/__tests__/rhi-debug-build-graph.integration.test.d.ts +2 -0
  12. package/dist/__tests__/rhi-debug-build-graph.integration.test.d.ts.map +1 -0
  13. package/dist/__tests__/sdk-update.unit.test.d.ts +2 -0
  14. package/dist/__tests__/sdk-update.unit.test.d.ts.map +1 -0
  15. package/dist/__tests__/software-browser-session.unit.test.d.ts +2 -0
  16. package/dist/__tests__/software-browser-session.unit.test.d.ts.map +1 -0
  17. package/dist/__tests__/software-capture-pixels.unit.test.d.ts +2 -0
  18. package/dist/__tests__/software-capture-pixels.unit.test.d.ts.map +1 -0
  19. package/dist/__tests__/software-capture.unit.test.d.ts +2 -0
  20. package/dist/__tests__/software-capture.unit.test.d.ts.map +1 -0
  21. package/dist/assets.d.ts.map +1 -1
  22. package/dist/bootstrap-commands.d.ts.map +1 -1
  23. package/dist/cli-output.d.ts +4 -0
  24. package/dist/cli-output.d.ts.map +1 -0
  25. package/dist/cli.mjs +1863 -819
  26. package/dist/cli.mjs.map +1 -1
  27. package/dist/commands.d.ts +2 -0
  28. package/dist/commands.d.ts.map +1 -1
  29. package/dist/engine-binding.d.ts +58 -0
  30. package/dist/engine-binding.d.ts.map +1 -0
  31. package/dist/host/__tests__/bootstrap-root-owner.test-d.d.ts +2 -0
  32. package/dist/host/__tests__/bootstrap-root-owner.test-d.d.ts.map +1 -0
  33. package/dist/host/project-bootstrap.d.ts +4 -2
  34. package/dist/host/project-bootstrap.d.ts.map +1 -1
  35. package/dist/host/resource-bootstrap.d.ts +5 -3
  36. package/dist/host/resource-bootstrap.d.ts.map +1 -1
  37. package/dist/host.d.ts +2 -1
  38. package/dist/host.d.ts.map +1 -1
  39. package/dist/index.d.ts +11 -2
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.mjs +1714 -862
  42. package/dist/index.mjs.map +1 -1
  43. package/dist/project.d.ts +0 -1
  44. package/dist/project.d.ts.map +1 -1
  45. package/dist/rhi-debug/cli-context.d.ts.map +1 -1
  46. package/dist/rhi-debug/operations.d.ts +3 -3
  47. package/dist/rhi-debug/operations.d.ts.map +1 -1
  48. package/dist/sdk-bootstrap.d.ts +9 -0
  49. package/dist/sdk-bootstrap.d.ts.map +1 -1
  50. package/dist/sdk-cli.mjs +193 -25
  51. package/dist/sdk-cli.mjs.map +1 -1
  52. package/dist/sdk-install.d.ts.map +1 -1
  53. package/dist/sdk-update.d.ts +23 -0
  54. package/dist/sdk-update.d.ts.map +1 -0
  55. package/dist/software-capture.d.ts +123 -0
  56. package/dist/software-capture.d.ts.map +1 -0
  57. package/dist/tools/benchmark/__tests__/benchmark-vocabulary-owner.test-d.d.ts +2 -0
  58. package/dist/tools/benchmark/__tests__/benchmark-vocabulary-owner.test-d.d.ts.map +1 -0
  59. package/dist/tools/benchmark/harness.d.ts.map +1 -1
  60. package/dist/tools/browser-host.d.ts.map +1 -1
  61. package/dist/tools/commands.d.ts +5 -0
  62. package/dist/tools/commands.d.ts.map +1 -1
  63. package/dist/tools/native-preview.d.ts.map +1 -1
  64. package/dist/types.d.ts +28 -1
  65. package/dist/types.d.ts.map +1 -1
  66. package/package.json +32 -31
  67. package/dist/__tests__/tool-migration.test.d.ts +0 -2
  68. package/dist/__tests__/tool-migration.test.d.ts.map +0 -1
package/dist/project.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  import type { CommandError, CommandResult, ProjectFacts } from './types.js';
2
2
  export declare function readProjectFacts(rootInput?: string): Promise<CommandResult<ProjectFacts>>;
3
- export declare function isCommandError(value: unknown): value is CommandError;
4
3
  export declare function commandError(cause: unknown, fallbackCode: string): CommandError;
5
4
  //# sourceMappingURL=project.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAyC5E,wBAAsB,gBAAgB,CACpC,SAAS,SAAgB,GACxB,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAiItC;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAWpE;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,YAAY,CAQ/E"}
1
+ {"version":3,"file":"project.d.ts","sourceRoot":"","sources":["../src/project.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAyC5E,wBAAsB,gBAAgB,CACpC,SAAS,SAAgB,GACxB,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAiItC;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,GAAG,YAAY,CAiB/E"}
@@ -1 +1 @@
1
- {"version":3,"file":"cli-context.d.ts","sourceRoot":"","sources":["../../src/rhi-debug/cli-context.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE7E,wBAAgB,iCAAiC,IAAI,wBAAwB,CAkE5E"}
1
+ {"version":3,"file":"cli-context.d.ts","sourceRoot":"","sources":["../../src/rhi-debug/cli-context.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAE7E,wBAAgB,iCAAiC,IAAI,wBAAwB,CAuG5E"}
@@ -1,4 +1,4 @@
1
- import { type FrameModel, type InspectField, type ReplayBackend, type RhiDebugError, type WorkInspection } from '@forgeax/engine-rhi-debug';
1
+ import { type FrameModel, type InspectField, type ReplayBackend, type RhiDebugError, type V7Tape, type WorkInspection } from '@forgeax/engine-rhi-debug';
2
2
  import { type Result } from '@forgeax/engine-types';
3
3
  import type { CommandResult } from '../types.js';
4
4
  export declare const RHI_TAPE_ARTIFACT_KIND: "rhi-tape";
@@ -43,12 +43,12 @@ export type RhiDebugOperationOutput = ArtifactRef | RhiSummaryOutput | RhiInspec
43
43
  export interface RhiDebugOperationContext {
44
44
  readonly captureFrame: (input?: RhiCaptureInput) => Promise<Result<CapturedRhiTape, RhiDebugError>>;
45
45
  readonly readArtifact: (artifact: ArtifactRef) => Promise<CommandResult<Uint8Array>>;
46
- readonly createReplayBackend?: () => Promise<CommandResult<ReplayBackend>>;
46
+ readonly createReplayBackend?: (tape: V7Tape) => Promise<CommandResult<ReplayBackend>>;
47
47
  }
48
48
  export interface RhiDebugOperationHost {
49
49
  readonly captureFrame: (input?: RhiCaptureInput) => Promise<Result<RhiCaptureFrameValue, RhiDebugError>>;
50
50
  readonly readArtifact: (artifact: ArtifactRef) => Promise<CommandResult<Uint8Array>>;
51
- readonly createReplayBackend?: () => Promise<CommandResult<ReplayBackend>>;
51
+ readonly createReplayBackend?: (tape: V7Tape) => Promise<CommandResult<ReplayBackend>>;
52
52
  }
53
53
  export declare function createRhiDebugOperationContext(host: RhiDebugOperationHost): RhiDebugOperationContext;
54
54
  export interface JsonSchema {
@@ -1 +1 @@
1
- {"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../src/rhi-debug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,CAAC,CAAC"}
@@ -13,7 +13,16 @@ export interface SdkInitState {
13
13
  export interface SdkInitReport extends SdkInitState {
14
14
  readonly root: string;
15
15
  readonly store: 'offline' | 'registry';
16
+ readonly onboarding: AgentOnboarding;
16
17
  }
18
+ export interface AgentOnboarding {
19
+ readonly read: readonly string[];
20
+ readonly next: {
21
+ readonly cwd: string;
22
+ readonly argv: readonly string[];
23
+ };
24
+ }
25
+ export declare function agentOnboarding(sdk: SdkContext, projectRoot?: string): AgentOnboarding;
17
26
  export declare function sdkProjectInstallArgs(store: string | undefined): string[];
18
27
  export declare function readSdkInitState(sdk: SdkContext): Promise<SdkInitState | undefined>;
19
28
  export declare function requireSdkInitialization(sdk: SdkContext): Promise<CommandResult<SdkInitState>>;
@@ -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;CACxC;AAeD,wBA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AAC;IACvC,QAAQ,CAAC,UAAU,EAAE,eAAe,CAAC;CACtC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,IAAI,EAAE;QACb,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;QACrB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;KAClC,CAAC;CACH;AAED,wBAAgB,eAAe,CAAC,GAAG,EAAE,UAAU,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,eAAe,CAgBtF;AAeD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,EAAE,CAYzE;AAmDD,wBAAsB,gBAAgB,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CAOzF;AAED,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,UAAU,GACd,OAAO,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAkBtC;AAsBD,wBAAsB,cAAc,CAClC,GAAG,EAAE,UAAU,EACf,OAAO,GAAE;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,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
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ import { execFile, spawn } from 'child_process';
2
3
  import { resolve, dirname, basename, relative, sep, isAbsolute } from 'path';
3
- import { pathToFileURL, fileURLToPath } from 'url';
4
- import { execFile } from 'child_process';
5
4
  import { readdir, mkdir, mkdtemp, cp, rename, rm, copyFile, readFile, realpath, writeFile, symlink, access, lstat, readlink, rmdir } from 'fs/promises';
6
5
  import { promisify } from 'util';
6
+ import { fileURLToPath } from 'url';
7
7
  import { tmpdir } from 'os';
8
8
 
9
9
  var __defProp = Object.defineProperty;
@@ -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.1.5"
34
+ vitest: "4.0.18"
35
35
  };
36
36
  function createInitPlan(facts, sdk) {
37
37
  const manifest = structuredClone(facts.packageJson);
@@ -4776,7 +4776,7 @@ async function readJson(path) {
4776
4776
  function firstUnsupportedStandaloneRealm(entries, inheritedRealm = "engine") {
4777
4777
  for (const entry of entries) {
4778
4778
  const realm = entry.realm ?? inheritedRealm ?? "engine";
4779
- if (realm === "host") return { id: entry.id, realm };
4779
+ if (realm !== "engine") return { id: entry.id, realm };
4780
4780
  if (entry.group === true) {
4781
4781
  const unsupported = firstUnsupportedStandaloneRealm(
4782
4782
  entry.config,
@@ -4894,13 +4894,10 @@ async function readProjectFacts(rootInput = process.cwd()) {
4894
4894
  }
4895
4895
  };
4896
4896
  }
4897
- function isCommandError(value) {
4898
- if (value === null || typeof value !== "object" || Array.isArray(value)) return false;
4899
- const candidate = value;
4900
- return typeof candidate.code === "string" && typeof candidate.expected === "string" && typeof candidate.hint === "string" && candidate.detail !== null && typeof candidate.detail === "object" && !Array.isArray(candidate.detail);
4901
- }
4902
4897
  function commandError(cause, fallbackCode) {
4903
- if (isCommandError(cause)) return cause;
4898
+ if (cause !== null && typeof cause === "object" && "code" in cause && "expected" in cause && "hint" in cause && "detail" in cause) {
4899
+ return cause;
4900
+ }
4904
4901
  return {
4905
4902
  code: fallbackCode,
4906
4903
  expected: "the ForgeaX command to complete",
@@ -4945,6 +4942,20 @@ async function findSdkContext() {
4945
4942
  var execFileAsync = promisify(execFile);
4946
4943
  var SDK_INIT_PATH = [".forgeax", "sdk-init.json"];
4947
4944
  var SDK_INIT_SCHEMA_VERSION = "1.0.0";
4945
+ function agentOnboarding(sdk, projectRoot) {
4946
+ const root2 = projectRoot ?? sdk.root;
4947
+ return {
4948
+ read: [
4949
+ resolve(root2, "AGENTS.md"),
4950
+ resolve(root2, "skills", "forgeax-engine-sdk", "SKILL.md"),
4951
+ resolve(root2, "skills", "forgeax-engine-sdk", "references", "feature-catalog.md")
4952
+ ],
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"] }
4957
+ };
4958
+ }
4948
4959
  function sdkInitPath(sdk) {
4949
4960
  return resolve(sdk.root, ...SDK_INIT_PATH);
4950
4961
  }
@@ -4956,19 +4967,21 @@ function sdkProjectInstallArgs(store) {
4956
4967
  "install",
4957
4968
  "--frozen-lockfile",
4958
4969
  "--ignore-scripts",
4970
+ "--config.pm-on-fail=ignore",
4959
4971
  "--side-effects-cache=true",
4960
4972
  "--child-concurrency=1"
4961
4973
  ];
4962
- return store === void 0 ? common : [...common, "--offline", "--trust-lockfile", "--store-dir", store];
4974
+ return store === void 0 ? common : [...common, "--offline", "--config.trust-lockfile=true", "--store-dir", store];
4963
4975
  }
4964
4976
  function sdkBootstrapInstallArgs(store) {
4965
4977
  const common = [
4966
4978
  "install",
4967
4979
  "--frozen-lockfile",
4980
+ "--config.pm-on-fail=ignore",
4968
4981
  "--child-concurrency=1",
4969
4982
  "--side-effects-cache=true"
4970
4983
  ];
4971
- return store === void 0 ? common : [...common, "--offline", "--trust-lockfile", "--store-dir", store];
4984
+ return store === void 0 ? common : [...common, "--offline", "--config.trust-lockfile=true", "--store-dir", store];
4972
4985
  }
4973
4986
  function supportedPnpm(version) {
4974
4987
  const [major = 0, minor = 0] = version.split(".").map(Number);
@@ -5058,7 +5071,8 @@ async function sdkInitCommand(sdk, options = {}) {
5058
5071
  const report = {
5059
5072
  ...state,
5060
5073
  root: sdk.root,
5061
- store: sdk.store === void 0 ? "registry" : "offline"
5074
+ store: sdk.store === void 0 ? "registry" : "offline",
5075
+ onboarding: agentOnboarding(sdk)
5062
5076
  };
5063
5077
  if (options.dryRun === true || options.install === false) return { ok: true, value: report };
5064
5078
  let staging;
@@ -5085,6 +5099,102 @@ async function sdkInitCommand(sdk, options = {}) {
5085
5099
  if (staging !== void 0) await rm(staging, { recursive: true, force: true });
5086
5100
  }
5087
5101
  }
5102
+
5103
+ // src/sdk-update.ts
5104
+ var UPDATE_MIGRATION_RISK = "Install a newer SDK in a separate directory. Existing games remain pinned and are not migrated automatically; review release notes and migrate and test each game before changing its Engine version.";
5105
+ function parseVersion(version) {
5106
+ const match = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(
5107
+ version
5108
+ );
5109
+ if (match === null) return void 0;
5110
+ const major = match[1];
5111
+ const minor = match[2];
5112
+ const patch = match[3];
5113
+ if (major === void 0 || minor === void 0 || patch === void 0) return void 0;
5114
+ const prerelease = match[4]?.split(".");
5115
+ if (prerelease?.some(
5116
+ (identifier) => identifier.length === 0 || /^\d+$/.test(identifier) && /^0\d+/.test(identifier)
5117
+ )) {
5118
+ return void 0;
5119
+ }
5120
+ return {
5121
+ core: [major, minor, patch],
5122
+ ...prerelease === void 0 ? {} : { prerelease }
5123
+ };
5124
+ }
5125
+ function compareNumericIdentifier(current, latest) {
5126
+ if (current.length !== latest.length) return latest.length > current.length ? 1 : -1;
5127
+ if (current === latest) return 0;
5128
+ return latest > current ? 1 : -1;
5129
+ }
5130
+ function comparePrerelease(current, latest) {
5131
+ const length = Math.max(current.length, latest.length);
5132
+ for (let index = 0; index < length; index += 1) {
5133
+ const currentIdentifier = current[index];
5134
+ const latestIdentifier = latest[index];
5135
+ if (currentIdentifier === void 0) return 1;
5136
+ if (latestIdentifier === void 0) return -1;
5137
+ if (currentIdentifier === latestIdentifier) continue;
5138
+ const currentNumeric = /^\d+$/.test(currentIdentifier);
5139
+ const latestNumeric = /^\d+$/.test(latestIdentifier);
5140
+ if (currentNumeric && latestNumeric) {
5141
+ return compareNumericIdentifier(currentIdentifier, latestIdentifier);
5142
+ }
5143
+ if (currentNumeric !== latestNumeric) return latestNumeric ? -1 : 1;
5144
+ return latestIdentifier > currentIdentifier ? 1 : -1;
5145
+ }
5146
+ return 0;
5147
+ }
5148
+ function newerSdkVersion(currentVersion, latestVersion) {
5149
+ const current = parseVersion(currentVersion);
5150
+ const latest = parseVersion(latestVersion);
5151
+ if (current === void 0 || latest === void 0) return false;
5152
+ for (let index = 0; index < current.core.length; index += 1) {
5153
+ const precedence = compareNumericIdentifier(
5154
+ current.core[index] ?? "0",
5155
+ latest.core[index] ?? "0"
5156
+ );
5157
+ if (precedence !== 0) return precedence > 0;
5158
+ }
5159
+ if (current.prerelease !== void 0 && latest.prerelease === void 0) return true;
5160
+ if (current.prerelease === void 0 || latest.prerelease === void 0) return false;
5161
+ return comparePrerelease(current.prerelease, latest.prerelease) > 0;
5162
+ }
5163
+ function offline() {
5164
+ return ["1", "true"].includes((process.env.npm_config_offline ?? "").toLowerCase());
5165
+ }
5166
+ async function checkSdkUpdate(currentVersion) {
5167
+ if (process.env.FORGEAX_DISABLE_UPDATE_CHECK === "1") {
5168
+ return { status: "skipped", currentVersion, reason: "disabled" };
5169
+ }
5170
+ if (offline()) return { status: "skipped", currentVersion, reason: "offline" };
5171
+ try {
5172
+ const registry = process.env.npm_config_registry ?? "https://registry.npmjs.org/";
5173
+ const response = await fetch(
5174
+ new URL("@forgeax%2Fengine-sdk", `${registry.replace(/\/$/, "")}/`),
5175
+ {
5176
+ headers: { accept: "application/vnd.npm.install-v1+json" },
5177
+ signal: AbortSignal.timeout(2e3)
5178
+ }
5179
+ );
5180
+ if (!response.ok) throw new Error(`registry-http-${response.status}`);
5181
+ const metadata = await response.json();
5182
+ const latestVersion = metadata["dist-tags"]?.latest;
5183
+ if (typeof latestVersion !== "string") throw new Error("registry-latest-version-missing");
5184
+ return newerSdkVersion(currentVersion, latestVersion) ? {
5185
+ status: "available",
5186
+ currentVersion,
5187
+ latestVersion,
5188
+ migrationRisk: UPDATE_MIGRATION_RISK
5189
+ } : { status: "current", currentVersion, latestVersion };
5190
+ } catch (cause) {
5191
+ return {
5192
+ status: "unavailable",
5193
+ currentVersion,
5194
+ reason: cause instanceof Error ? cause.message : String(cause)
5195
+ };
5196
+ }
5197
+ }
5088
5198
  var PROJECT_SKILL_MOUNT_ROOTS = Object.freeze([
5089
5199
  ".codebuddy/skills",
5090
5200
  ".cursor/skills",
@@ -5657,9 +5767,16 @@ async function newCommand(options = {}) {
5657
5767
  env: { ...process.env, CI: "true" },
5658
5768
  maxBuffer: 16 * 1024 * 1024
5659
5769
  });
5770
+ const sdkUpdate = await checkSdkUpdate(sdk.manifest.sdkVersion);
5660
5771
  return {
5661
5772
  ok: true,
5662
- value: { root: root2, template: templateId, sdkVersion: sdk.manifest.sdkVersion }
5773
+ value: {
5774
+ root: root2,
5775
+ template: templateId,
5776
+ sdkVersion: sdk.manifest.sdkVersion,
5777
+ onboarding: agentOnboarding(sdk, root2),
5778
+ sdkUpdate
5779
+ }
5663
5780
  };
5664
5781
  } catch (cause) {
5665
5782
  if (staging !== void 0) await rm(staging, { recursive: true, force: true });
@@ -5686,11 +5803,42 @@ async function newCommand(options = {}) {
5686
5803
  }
5687
5804
  }
5688
5805
 
5806
+ // src/cli-output.ts
5807
+ function agentOnboardingLines(value) {
5808
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return [];
5809
+ const onboarding = value.onboarding;
5810
+ if (onboarding === null || typeof onboarding !== "object" || Array.isArray(onboarding)) return [];
5811
+ const candidate = onboarding;
5812
+ const lines = Array.isArray(candidate.read) ? candidate.read.filter((path) => typeof path === "string").map((path) => `[forgeax] read: ${path}`) : [];
5813
+ if (typeof candidate.next?.cwd === "string" && Array.isArray(candidate.next.argv) && candidate.next.argv.every((part) => typeof part === "string")) {
5814
+ lines.push(`[forgeax] next cwd: ${candidate.next.cwd}`);
5815
+ lines.push(`[forgeax] next: ${candidate.next.argv.join(" ")}`);
5816
+ }
5817
+ return lines;
5818
+ }
5819
+ function sdkUpdateLines(value) {
5820
+ if (value === null || typeof value !== "object" || Array.isArray(value)) return [];
5821
+ const update = value.sdkUpdate;
5822
+ if (update === null || typeof update !== "object" || Array.isArray(update)) return [];
5823
+ const candidate = update;
5824
+ if (candidate.status !== "available" || typeof candidate.currentVersion !== "string" || typeof candidate.latestVersion !== "string" || typeof candidate.migrationRisk !== "string") {
5825
+ return [];
5826
+ }
5827
+ return [
5828
+ `[forgeax] update available: @forgeax/engine-sdk ${candidate.currentVersion} -> ${candidate.latestVersion}`,
5829
+ `[forgeax] update note: ${candidate.migrationRisk}`
5830
+ ];
5831
+ }
5832
+ 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";
5834
+ }
5835
+
5689
5836
  // src/sdk-cli.ts
5690
- var args = process.argv.slice(2);
5837
+ var rawArgs = process.argv.slice(2);
5838
+ var args = [...rawArgs];
5691
5839
  var commandArg = args.shift();
5692
5840
  var command = commandArg;
5693
- var help = commandArg === "--help" || commandArg === "-h";
5841
+ var help = rawArgs.includes("--help") || rawArgs.includes("-h");
5694
5842
  var json = args.includes("--json");
5695
5843
  var dryRun = args.includes("--dry-run");
5696
5844
  var noInstall = args.includes("--no-install");
@@ -5700,23 +5848,43 @@ var positional = args.find(
5700
5848
  (value, index) => !value.startsWith("--") && (templateIndex < 0 || index !== templateIndex + 1)
5701
5849
  );
5702
5850
  var root = command === "new" || command === "init" || command === "doctor" ? positional ?? process.cwd() : process.cwd();
5703
- if (command === "new" || command === "init" || command === "doctor") {
5851
+ if (help) {
5852
+ process.stdout.write(renderForgeaxUsage());
5853
+ } else if (command === "new" || command === "init" || command === "doctor") {
5704
5854
  const result = await (command === "new" ? newCommand({ root, dryRun, ...template === void 0 ? {} : { template } }) : command === "init" ? initCommand({ root, dryRun, install: !noInstall }) : doctorCommand({ root}));
5705
5855
  const envelope = result.ok ? { schemaVersion: "1.0.0", command, ok: true, value: result.value } : { schemaVersion: "1.0.0", command, ok: false, error: result.error };
5706
5856
  if (json) process.stdout.write(`${JSON.stringify(envelope)}
5707
5857
  `);
5708
- else if (result.ok) process.stdout.write(`[forgeax] ${command} ready
5858
+ else if (result.ok) {
5859
+ process.stdout.write(`[forgeax] ${command} ready
5709
5860
  `);
5710
- else process.stderr.write(`[forgeax] ${result.error.code}: ${result.error.hint}
5861
+ for (const line of agentOnboardingLines(result.value)) process.stdout.write(`${line}
5862
+ `);
5863
+ for (const line of sdkUpdateLines(result.value)) process.stdout.write(`${line}
5864
+ `);
5865
+ } else process.stderr.write(`[forgeax] ${result.error.code}: ${result.error.hint}
5711
5866
  `);
5712
5867
  if (!result.ok) process.exitCode = 1;
5713
- } else if (command !== void 0 && !help) {
5714
- const cli = resolve(root, "node_modules", "@forgeax", "engine-devkit", "dist", "cli.mjs");
5715
- await import(pathToFileURL(cli).href);
5868
+ } else if (command !== void 0) {
5869
+ const localForgeax = resolve(
5870
+ root,
5871
+ "node_modules",
5872
+ ".bin",
5873
+ process.platform === "win32" ? "forgeax.cmd" : "forgeax"
5874
+ );
5875
+ const child = spawn(localForgeax, [command, ...args], {
5876
+ cwd: root,
5877
+ shell: process.platform === "win32",
5878
+ stdio: "inherit"
5879
+ });
5880
+ const exitCode = await new Promise((resolveExit, reject) => {
5881
+ child.once("error", reject);
5882
+ child.once("exit", resolveExit);
5883
+ });
5884
+ if (exitCode !== 0) process.exitCode = exitCode ?? 1;
5716
5885
  } else {
5717
- const output = "Usage: forgeax new [directory] [--template empty|game-default]\n forgeax <init|doctor|test|dev|build|serve|preview> [directory]\n forgeax skill <install|verify> # from a game project\n";
5718
- (help ? process.stdout : process.stderr).write(output);
5719
- if (!help) process.exitCode = 2;
5886
+ process.stderr.write(renderForgeaxUsage());
5887
+ process.exitCode = 2;
5720
5888
  }
5721
5889
  /*! Bundled license information:
5722
5890