wave3d-agent-sdk 0.2.3 → 0.2.5

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.
package/README.md CHANGED
@@ -14,18 +14,26 @@ Vocabulary:
14
14
  - WaveEngine Agent SDK: same-machine live MCP transport from `wave3d-agent-sdk start`.
15
15
  - HTTP Gateway: Wave Studio Next/Vercel MCP transport for remote/cloud/sandbox fallback Studio operations.
16
16
  - WaveEngine SDK Cache: package-bundled public-safe skill/API/example lookup data.
17
- - MCP Session: paired Wave Studio browser session and bearer-token state.
17
+ - MCP Session: paired Wave Studio browser session and MCP_TOKEN state.
18
+ - Local Pairing Secret: MCP_TOKEN on localhost. It pairs the local SDK process to the current Studio session; it is not account/cloud auth.
19
+ - HTTP Gateway Bearer: MCP_TOKEN on an HTTP Gateway URL. It can be adopted locally, but localhost health remains the source of truth for SDK state.
18
20
  - VFS Mirror: HTTP Gateway read/edit snapshot. Local SDK live reads/writes use browser VFS.
19
21
  - Project: user workspace content. Reading a project is not opening/replacing live workspace.
20
22
 
21
23
  ```bash
22
- npx -y wave3d-agent-sdk@0.2.3 start
24
+ npx -y wave3d-agent-sdk@0.2.5 start
25
+ ```
26
+
27
+ After Copy to Agent, restart stale SDK processes with MCP_TOKEN preserved as the local pairing secret. Keep it hidden:
28
+
29
+ ```bash
30
+ WAVE3D_MCP_TOKEN="$MCP_TOKEN" npx -y wave3d-agent-sdk@0.2.5 start
23
31
  ```
24
32
 
25
33
  Check SDK build before trusting a running SDK process:
26
34
 
27
35
  ```bash
28
- npx -y wave3d-agent-sdk@0.2.3 --version
36
+ npx -y wave3d-agent-sdk@0.2.5 --version
29
37
  ```
30
38
 
31
39
  The package bundles the WaveEngine SDK lookup corpus. No normal session needs a separate protected zip download.
@@ -35,12 +43,12 @@ The package bundles the WaveEngine SDK lookup corpus. No normal session needs a
35
43
  Wave Studio Copy to Agent defaults same-machine live MCP transport to this SDK:
36
44
 
37
45
  ```bash
38
- npx -y wave3d-agent-sdk@0.2.3 start
46
+ npx -y wave3d-agent-sdk@0.2.5 start
39
47
  ```
40
48
 
41
49
  Agents choose topology first:
42
50
 
43
- - Same computer as Wave Studio browser: try copied localhost `MCP_URL`, call `self_check_wave_mcp` with copied `expectedVersion` and `expectedBuildHash`, and restart exact SDK command from Copy to Agent if `self_check_wave_mcp` is missing, SDK is stale, tools are missing, or the SDK prints bearer tokens before fallback.
51
+ - Same computer as Wave Studio browser: try copied localhost `MCP_URL`, call `self_check_wave_mcp` with copied `expectedVersion` and `expectedBuildHash`, and restart exact SDK command from Copy to Agent if `self_check_wave_mcp` is missing, SDK is stale, tools are missing, or the SDK prints secrets before fallback. If restart happens after Copy to Agent, preserve MCP_TOKEN with `WAVE3D_MCP_TOKEN="$MCP_TOKEN"` so the new SDK process can authorize that local pairing secret. HTTP Gateway is degraded fallback only after SDK cannot run, update, or adopt; successful Gateway auth or convenience is not a same-machine fallback reason.
44
52
  - Different machine, remote container, cloud agent, sandbox without shell/Node/npm, or localhost points to agent machine instead of user browser machine: use `MCP_HTTP_GATEWAY_FALLBACK_URL` directly. Do not start WaveEngine Agent SDK on wrong machine.
45
53
 
46
54
  Call `get_wave_mcp_health` (aliases: `mcp_health`, `mcp_status`) whenever transport, SDK, or session status is unclear. It reports endpoint kind, SDK version/build, tool catalog hash/count, paired sessions, and WaveEngine SDK Cache state.
@@ -50,13 +58,13 @@ Use `MCP_HTTP_GATEWAY_FALLBACK_URL` only for topology mismatch, remote/sandboxed
50
58
  For unfamiliar authoring, use the local SDK tools:
51
59
 
52
60
  ```bash
53
- npx -y wave3d-agent-sdk@0.2.3 cache search "continuous left rotation"
61
+ npx -y wave3d-agent-sdk@0.2.5 cache search "continuous left rotation"
54
62
  ```
55
63
 
56
64
  `cache refresh` without MCP arguments reinstalls the bundled SDK into `~/.wave3d/agent-cache`:
57
65
 
58
66
  ```bash
59
- npx -y wave3d-agent-sdk@0.2.3 cache refresh
67
+ npx -y wave3d-agent-sdk@0.2.5 cache refresh
60
68
  ```
61
69
 
62
70
  Old `cache refresh --mcp-url <url> --token <token>` arguments are ignored. Normal users update the npm package; no separate zip download exists.
@@ -92,4 +100,4 @@ wave3d-agent-sdk cache clear
92
100
 
93
101
  ## Token Safety
94
102
 
95
- Treat Wave Studio MCP bearer tokens as secrets. Prefer passing them through `WAVE3D_MCP_TOKEN` or `WAVESTUDIO_MCP_TOKEN` rather than shell history when possible.
103
+ Treat Wave Studio MCP_TOKEN values as secrets. Prefer passing them through `WAVE3D_MCP_TOKEN` or `WAVESTUDIO_MCP_TOKEN` rather than shell history when possible.
package/dist/cli.js CHANGED
@@ -42533,10 +42533,12 @@ function normalizeWaveGenieAssetUploadRequest(request) {
42533
42533
 
42534
42534
  // ../../src/lib/waveStudio/aiAssist/bridge/localAgentSdkContract.ts
42535
42535
  var WAVE3D_AGENT_SDK_PACKAGE_NAME = "wave3d-agent-sdk";
42536
- var WAVE3D_AGENT_SDK_REQUIRED_VERSION = "0.2.3";
42537
- var WAVE3D_AGENT_SDK_REQUIRED_BUILD = "agent-sdk-20260617.4";
42536
+ var WAVE3D_AGENT_SDK_REQUIRED_VERSION = "0.2.5";
42537
+ var WAVE3D_AGENT_SDK_REQUIRED_BUILD = "agent-sdk-20260617.6";
42538
42538
  var WAVE3D_AGENT_SDK_PACKAGE_SPEC = `${WAVE3D_AGENT_SDK_PACKAGE_NAME}@${WAVE3D_AGENT_SDK_REQUIRED_VERSION}`;
42539
42539
  var WAVE3D_AGENT_SDK_START_COMMAND = `npx -y ${WAVE3D_AGENT_SDK_PACKAGE_SPEC} start`;
42540
+ var WAVE3D_AGENT_SDK_TOKEN_ENV_VAR = "WAVE3D_MCP_TOKEN";
42541
+ var WAVE3D_AGENT_SDK_TOKEN_PRESERVING_START_COMMAND = `${WAVE3D_AGENT_SDK_TOKEN_ENV_VAR}="$MCP_TOKEN" ${WAVE3D_AGENT_SDK_START_COMMAND}`;
42540
42542
  var WAVE3D_AGENT_SDK_CACHE_REFRESH_COMMAND_TEMPLATE = `npx -y ${WAVE3D_AGENT_SDK_PACKAGE_SPEC} cache refresh`;
42541
42543
  var WAVE3D_AGENT_SDK_CACHE_REFRESH_SHELL_COMMAND = `npx -y ${WAVE3D_AGENT_SDK_PACKAGE_SPEC} cache refresh`;
42542
42544
 
@@ -42612,7 +42614,7 @@ var SEMANTIC_GUESS_UNSAFE_PATTERN = /\b(add|append|create|insert|spawn|new line|
42612
42614
  var SEMANTIC_GUESS_NEGATED_UNSAFE_PHRASE_PATTERN = /\b(?:no|not|without|avoid|avoids|don't|do not|doesn't|does not|isn't|is not|won't|will not|shouldn't|should not|needless|unneeded)\s+(?:(?:need|use|write|make|make a|create|add|insert|switch|choose)\s+)?(?:new\s+(?:line|object|api|code|pattern|builder)|another\s+api|different\s+api|api\s+switch|switch\s+api|builder|layout|placement|place\s+in|place\s+around|place\s+inline|line\s+of|row\s+of|grid\s+of|clone|multiple|many|several|loop|for\s+each)\b/giu;
42613
42615
  var WAVE_MCP_TASK_PHASE_VALUES = ["context", "lookup", "execute", "verify", "general"];
42614
42616
  var WAVE_MCP_TASK_EDIT_INTENT_VALUES = ["none", "readOnly", "modifyCode", "modifyVfs", "modifyAssets", "modifyProject", "debugOnly", "previewOnly"];
42615
- var WAVE_MCP_BEHAVIOR_HARNESS_RULE = "Choose work mode before tool calls. Observe tools read directly. Operate tools run direct Studio commands without start_wave_task when the target is exact. Author/Diagnose tools are route-bound and phase/intent-gated with start_wave_task. query_wave_api, edit_wave_file, apply_wave_patch, code.direct_edit, code.semantic_guess_edit, and code.author are routed work. Direct Operate examples: run/hot reload/save/share/rename/open/new project/exact VFS create/rename/delete/asset upload/rename/delete. Direct Observe examples: session/files/assets/diagnostics/performance/screenshot/entity snapshots/markers.";
42617
+ var WAVE_MCP_BEHAVIOR_HARNESS_RULE = "Choose work mode before tool calls. Observe tools read directly. Operate tools run direct Studio commands without start_wave_task when the target is exact. Author/Diagnose tools are route-bound and phase/intent-gated with start_wave_task. query_wave_api, edit_wave_file, apply_wave_patch, code.direct_edit, code.semantic_guess_edit, and code.author are routed work. Direct Operate examples: run/hot reload/pause/resume/save/share/rename/open/new project/exact VFS create/rename/delete/asset upload/rename/delete. Direct Observe examples: session/files/assets/diagnostics/performance/screenshot/entity snapshots/markers.";
42616
42618
  var WAVE_MCP_TOOL_ALIAS_CANONICAL_NAMES = {
42617
42619
  list_wave_assets_by_category: "find_wave_assets_by_category",
42618
42620
  search_wave_assets_by_category: "find_wave_assets_by_category",
@@ -42647,6 +42649,12 @@ var WAVE_MCP_TOOL_ALIAS_CANONICAL_NAMES = {
42647
42649
  run_wave_project: "run_wave_preview",
42648
42650
  run_project: "run_wave_preview",
42649
42651
  run_wave_scene: "run_wave_preview",
42652
+ pause_wave_engine: "pause_wave_preview",
42653
+ pause_engine: "pause_wave_preview",
42654
+ pause_preview: "pause_wave_preview",
42655
+ resume_wave_engine: "resume_wave_preview",
42656
+ resume_engine: "resume_wave_preview",
42657
+ resume_preview: "resume_wave_preview",
42650
42658
  read_wave_files: "list_wave_files",
42651
42659
  get_wave_files: "list_wave_files",
42652
42660
  list_wave_project: "list_wave_projects",
@@ -42828,7 +42836,9 @@ var WAVE_MCP_TOOL_CONTRACTS = {
42828
42836
  new_wave_project: { workMode: "operate", domain: "project", safety: "workspaceOperation", targetPolicy: "none", requiresTaskRoute: false, supportsTaskRoute: true, directIntentKind: "project.manage", directEditIntent: "modifyProject", destructive: true },
42829
42837
  open_wave_project: { workMode: "operate", domain: "project", safety: "workspaceOperation", targetPolicy: "exactProjectIdRequired", requiresTaskRoute: false, supportsTaskRoute: true, directIntentKind: "project.manage", directEditIntent: "modifyProject", destructive: true },
42830
42838
  hot_reload_wave_preview: { workMode: "operate", domain: "preview", safety: "runtimeOperation", targetPolicy: "none", requiresTaskRoute: false, supportsTaskRoute: true, directIntentKind: "preview.control", directEditIntent: "previewOnly" },
42831
- run_wave_preview: { workMode: "operate", domain: "preview", safety: "runtimeOperation", targetPolicy: "none", requiresTaskRoute: false, supportsTaskRoute: true, directIntentKind: "preview.control", directEditIntent: "previewOnly" }
42839
+ run_wave_preview: { workMode: "operate", domain: "preview", safety: "runtimeOperation", targetPolicy: "none", requiresTaskRoute: false, supportsTaskRoute: true, directIntentKind: "preview.control", directEditIntent: "previewOnly" },
42840
+ pause_wave_preview: { workMode: "operate", domain: "preview", safety: "runtimeOperation", targetPolicy: "none", requiresTaskRoute: false, supportsTaskRoute: true, directIntentKind: "preview.control", directEditIntent: "previewOnly" },
42841
+ resume_wave_preview: { workMode: "operate", domain: "preview", safety: "runtimeOperation", targetPolicy: "none", requiresTaskRoute: false, supportsTaskRoute: true, directIntentKind: "preview.control", directEditIntent: "previewOnly" }
42832
42842
  };
42833
42843
  var WAVE_MCP_SETUP_TOOL_NAMES = /* @__PURE__ */ new Set([
42834
42844
  "get_wave_agent_onboarding",
@@ -42888,7 +42898,9 @@ var WAVE_MCP_TASK_EXECUTE_TOOL_NAMES = /* @__PURE__ */ new Set([
42888
42898
  "new_wave_project",
42889
42899
  "open_wave_project",
42890
42900
  "hot_reload_wave_preview",
42891
- "run_wave_preview"
42901
+ "run_wave_preview",
42902
+ "pause_wave_preview",
42903
+ "resume_wave_preview"
42892
42904
  ]);
42893
42905
  var WAVE_MCP_TASK_VERIFY_TOOL_NAMES = /* @__PURE__ */ new Set([
42894
42906
  "get_wave_command_result",
@@ -43562,7 +43574,7 @@ function buildWaveMcpTaskRouteRecommendedNextToolCall(route) {
43562
43574
  }
43563
43575
  if (route.editIntent === "previewOnly") {
43564
43576
  return {
43565
- tool: "hot_reload_wave_preview | run_wave_preview",
43577
+ tool: "hot_reload_wave_preview | run_wave_preview | pause_wave_preview | resume_wave_preview",
43566
43578
  arguments: {},
43567
43579
  note: "Poll get_wave_runtime_diagnostics afterward for real outcome."
43568
43580
  };
@@ -43631,7 +43643,7 @@ function toolIntentAllowed(toolName, route) {
43631
43643
  if (canonicalToolName === "create_wave_file" || canonicalToolName === "rename_wave_file" || canonicalToolName === "delete_wave_file") {
43632
43644
  return routeHasAnyIntent(route, ["vfs.manage", "code.author"]);
43633
43645
  }
43634
- if (canonicalToolName === "hot_reload_wave_preview" || canonicalToolName === "run_wave_preview") {
43646
+ if (canonicalToolName === "hot_reload_wave_preview" || canonicalToolName === "run_wave_preview" || canonicalToolName === "pause_wave_preview" || canonicalToolName === "resume_wave_preview") {
43635
43647
  return routeHasAnyIntent(route, ["preview.control", "code.direct_edit", "code.semantic_guess_edit", "code.author", "code.debug"]);
43636
43648
  }
43637
43649
  if (canonicalToolName === "get_wave_runtime_entity_snapshot") {
@@ -43736,7 +43748,7 @@ function canFastExecuteExactEditTool(input) {
43736
43748
  }
43737
43749
  function isWriteTool(toolName) {
43738
43750
  const canonicalToolName = canonicalizeWaveMcpToolName(toolName);
43739
- return WAVE_MCP_TASK_EXECUTE_TOOL_NAMES.has(canonicalToolName) && canonicalToolName !== "get_wave_asset_upload_status" && canonicalToolName !== "hot_reload_wave_preview" && canonicalToolName !== "run_wave_preview";
43751
+ return WAVE_MCP_TASK_EXECUTE_TOOL_NAMES.has(canonicalToolName) && canonicalToolName !== "get_wave_asset_upload_status" && canonicalToolName !== "hot_reload_wave_preview" && canonicalToolName !== "run_wave_preview" && canonicalToolName !== "pause_wave_preview" && canonicalToolName !== "resume_wave_preview";
43740
43752
  }
43741
43753
  function waveMcpToolRequiresTaskRoute(toolName) {
43742
43754
  const canonicalToolName = canonicalizeWaveMcpToolName(toolName);
@@ -44015,7 +44027,7 @@ function validateWaveMcpTaskToolCall(input) {
44015
44027
  if (!input.route || input.route.taskRouteId !== taskRouteId) {
44016
44028
  return {
44017
44029
  code: "task_route_not_found",
44018
- message: "The provided taskRouteId is not the active Wave task route for this agent token.",
44030
+ message: "The provided taskRouteId is not the active Wave task route for this MCP session.",
44019
44031
  details: {
44020
44032
  taskRouteId
44021
44033
  }
@@ -44112,7 +44124,7 @@ function recordWaveMcpTaskEvidenceUse(input) {
44112
44124
  }
44113
44125
  if (WAVE_MCP_ASSET_MUTATION_TOOL_NAMES.has(canonicalToolName)) evidence = { ...evidence, assetsMutated: true };
44114
44126
  if (WAVE_MCP_PROJECT_MUTATION_TOOL_NAMES.has(canonicalToolName)) evidence = { ...evidence, projectMutated: true };
44115
- if (canonicalToolName === "hot_reload_wave_preview" || canonicalToolName === "run_wave_preview") evidence = { ...evidence, previewControlled: true };
44127
+ if (canonicalToolName === "hot_reload_wave_preview" || canonicalToolName === "run_wave_preview" || canonicalToolName === "pause_wave_preview" || canonicalToolName === "resume_wave_preview") evidence = { ...evidence, previewControlled: true };
44116
44128
  if (canonicalToolName === "get_wave_runtime_diagnostics" || canonicalToolName === "get_wave_runtime_performance_snapshot") {
44117
44129
  evidence = { ...evidence, diagnosticsRead: true, runtimeInspected: true };
44118
44130
  }
@@ -44428,9 +44440,9 @@ var WAVE_MCP_AGENT_BRIEF = [
44428
44440
  '0-role. Roleplay lock: you are the Wave Studio authoring agent for this session. Stay in that role, follow Wave authoring strategy, use concrete MCP tools, and briefly confirm "Wave Studio authoring role accepted" after onboarding acceptance.',
44429
44441
  "0. Think in skills, act with tools. `studio.*` names are routing families, not callable tool names; call the real MCP tools listed under each family.",
44430
44442
  "0a. Do not invent MCP tool names. After onboarding, call `tools/list` (or read the returned tool catalog) and use concrete names. Common aliases and safe high-confidence typos are tolerated; destructive/write fuzzy matches require an exact follow-up call. There is no `get_wave_current_project`; use `get_wave_session` for current project/session/active-file context.",
44431
- `0b. Transport rule: choose topology first. Same-machine agent + same Wave Studio browser computer -> use copied \`MCP_URL\` WaveEngine Agent SDK (\`http://127.0.0.1:47231/mcp\`). If localhost is refused/unreachable, start exact SDK \`${WAVE3D_AGENT_SDK_START_COMMAND}\` when your runtime allows shell/Node/npm. If SDK is stale, missing tools, or prints bearer tokens, stop it and restart with that exact command, then recheck /health and tools/list. Same-machine stale/missing tools/401-with-Gateway-success means repair local SDK first, do not use HTTP Gateway first. Different machine, remote container, cloud agent, sandbox without shell/Node/npm, or localhost points to the agent machine -> use \`MCP_HTTP_GATEWAY_FALLBACK_URL\` directly. Do not start WaveEngine Agent SDK on the wrong machine.`,
44432
- "0b-recovery. If connection/session/onboarding/cache/mirror/timeout state is unclear, call `get_wave_mcp_health` (aliases `mcp_health`, `mcp_status`) first for status, then call `recover_wave_connection({ lastErrorCode?, failedTool?, symptom? })` and follow its `nextAction` exactly. Use recovery after `agent_onboarding_required`, `session_not_found`, `command_timeout`, `command_lease_expired`, `workspace_mirror_not_ready`, `hosted_mcp_proxy_failed`, local/HTTP Gateway fallback confusion, or sleeping-tab symptoms. If local HTTP returns 401 but HTTP Gateway accepts the same token, update/restart WaveEngine Agent SDK first. If every endpoint returns 401/bridge_auth_invalid before any tool result, ask user for fresh Copy to Agent.",
44433
- `0c. Cache priorities: Priority 1 is active role/context cache. Keep the role, coding guardrails, authoring workflow, full intent taxonomy (${WAVE_MCP_TASK_INTENT_KIND_VALUES.join(", ")}), Studio tool policy, assets/VFS/hot-reload rules, prompt version, and prompt hash in active LLM context as system-prompt-like rules. Priority 2 is WaveEngine SDK Cache. Production HTTP Gateway/local-SDK bearer onboarding must not claim normal cached success until SDK cache is prepared or explicit accept proof passes. If cache cannot work because sandbox/no filesystem/no Node/npm/user refusal/refresh failure, accept degraded fallback explicitly with \`waveEngineSdkFallbackMode:"studio_ops_only"\` plus \`waveEngineSdkUnavailableReason\` plus \`studioOpsOnlyFallbackAccepted:true\`, and warn user HTTP Gateway is Studio-ops-only and exact API lookup requires local SDK/cache repair. Keep live transport and retrieval cache separate: \`wave3d-agent-sdk start\` is long-running MCP transport; \`wave3d-agent-sdk cache refresh\` reinstalls the package-bundled SDK locally. Never use cache refresh to switch MCP transport, and never treat cache failure as local transport failure. Use SDK Cache for unfamiliar authoring skill/API lookup when Node/npm/local cache are allowed.`,
44443
+ `0b. Transport rule: choose topology first. Same-machine agent + same Wave Studio browser computer -> use copied \`MCP_URL\` WaveEngine Agent SDK (\`http://127.0.0.1:47231/mcp\`). On localhost, MCP_TOKEN is a local pairing secret, not account/cloud auth. If localhost is refused/unreachable, start exact SDK \`${WAVE3D_AGENT_SDK_START_COMMAND}\` when your runtime allows shell/Node/npm. If SDK is stale, missing tools, printing secrets, or local 401 follows an SDK restart, stop it and restart while preserving MCP_TOKEN as the local pairing secret with \`${WAVE3D_AGENT_SDK_TOKEN_PRESERVING_START_COMMAND}\`; use the current MCP_TOKEN value without printing it. Then recheck /health and tools/list. Same-machine stale/missing tools/401-with-Gateway-success means repair local SDK first, do not use HTTP Gateway first. Same-machine HTTP Gateway is degraded fallback only after SDK cannot run, update, or adopt; convenience, habit, or successful Gateway auth is not a valid fallback reason. Different machine, remote container, cloud agent, sandbox without shell/Node/npm, or localhost points to the agent machine -> use \`MCP_HTTP_GATEWAY_FALLBACK_URL\` directly, where MCP_TOKEN is an HTTP Gateway bearer. Do not start WaveEngine Agent SDK on the wrong machine.`,
44444
+ "0b-recovery. If connection/session/onboarding/cache/mirror/timeout state is unclear, call `get_wave_mcp_health` (aliases `mcp_health`, `mcp_status`) first for status, then call `recover_wave_connection({ lastErrorCode?, failedTool?, symptom? })` and follow its `nextAction` exactly. Use recovery after `agent_onboarding_required`, `session_not_found`, `command_timeout`, `command_lease_expired`, `workspace_mirror_not_ready`, `hosted_mcp_proxy_failed`, local/HTTP Gateway fallback confusion, or sleeping-tab symptoms. If local HTTP returns 401 but HTTP Gateway accepts the same MCP_TOKEN, update/restart WaveEngine Agent SDK first. If every endpoint returns 401/bridge_auth_invalid before any tool result, ask user for fresh Copy to Agent.",
44445
+ `0c. Cache priorities: Priority 1 is active role/context cache. Keep the role, coding guardrails, authoring workflow, full intent taxonomy (${WAVE_MCP_TASK_INTENT_KIND_VALUES.join(", ")}), Studio tool policy, assets/VFS/hot-reload rules, prompt version, and prompt hash in active LLM context as system-prompt-like rules. Priority 2 is WaveEngine SDK Cache. Production HTTP Gateway/local-SDK onboarding must not claim normal cached success until SDK cache is prepared or explicit accept proof passes. If cache cannot work because sandbox/no filesystem/no Node/npm/user refusal/refresh failure, accept degraded fallback explicitly with \`waveEngineSdkFallbackMode:"studio_ops_only"\` plus \`waveEngineSdkUnavailableReason\` plus \`studioOpsOnlyFallbackAccepted:true\`, and warn user HTTP Gateway is Studio-ops-only and exact API lookup requires local SDK/cache repair. Keep live transport and retrieval cache separate: \`wave3d-agent-sdk start\` is long-running MCP transport; \`wave3d-agent-sdk cache refresh\` reinstalls the package-bundled SDK locally. Never use cache refresh to switch MCP transport, and never treat cache failure as local transport failure. Use SDK Cache for unfamiliar authoring skill/API lookup when Node/npm/local cache are allowed.`,
44434
44446
  '0d. Local parity rule: WaveEngine Agent SDK `tools/list` mirrors the HTTP Gateway catalog plus SDK session discovery extras. Live-session tools run through the paired browser. Local calls wait directly for browser results. Only call `get_wave_command_result` when a tool response actually includes `status:"pending"` and `requestId`; on local it is normally catalog parity only.',
44435
44447
  '0e. Agent behavior harness: choose MECE work mode first. Observe = read/inspect/answer only; call read tools directly. Operate = direct Studio command with no code/design choice; call concrete tools directly without `start_wave_task` for run preview, hot reload, save/share, exact VFS create/rename/delete, asset upload/rename/delete, new project, project rename, and open project by exact projectId. Author = create/change behavior/content through code/API; call `start_wave_task`, gather evidence, optionally fast-start with `nextPhase:"execute"` and editPlan, then edit. Diagnose = find root cause first; observe/read first, then transition to Operate or Author. General = not concrete Wave work; use `agent.general`. `query_wave_api`, `edit_wave_file`, `apply_wave_patch`, and code authoring fast lanes remain route-bound. Exact target rule: never invent paths, asset paths, or project ids; list/read/ask first.',
44436
44448
  "0f. Diagnose-only tasks use `code.debug`; bug-fix tasks use both `code.debug` and `code.author` so evidence can lead to edits.",
@@ -44458,7 +44470,7 @@ var WAVE_MCP_AGENT_BRIEF = [
44458
44470
  "Assets: when quoting or passing an existing asset, use typed bare refs in main files: `models.X`, `textures.X`, `materials.X`, `audios.X`, `hdr.X`, `cubeMaps.X`, `animations.X`, etc. Do not paste raw paths or edit Studio-managed generated files just to register assets. If the exact ref is not already visible, call category-first asset discovery (`find_wave_assets_by_category`, alias `list_wave_assets_by_category`, alias `search_wave_assets_by_category`, or tolerant `list_wave_assets`) with required `category` from user intent, semantic `query`, and small `limit` before editing code; category-filtered results can still be capped/truncated, so refine query before concluding absence. Use `list_wave_explorer_assets` only for uploaded library metadata, rename/delete, URL, path, size, or display/ref-name management.",
44459
44471
  "Asset authoring facade split: typed refs quote existing assets; `waveMaterial` authors material handles; `assetManager` is only for exact asset-pipeline/generated-asset APIs that a skill or API lookup names, such as SDF surfaces or surface ribbons. Do not treat `assetManager` as the default creative facade for materials or normal asset arguments.",
44460
44472
  "Material authoring: when creating, configuring, forking, or intentionally editing material handles, route to `wave.material.authoring` and start from `waveMaterial` (`createWater`, `createGrid`, `createSplatMaterial`, `createFromAsset`, `editAsset`). If a material handle later needs runtime sync, `assetManager` may be passed as the sync target; it is still not the authoring root.",
44461
- "Preview: default to hot reload after code changes. On the final edit use `awaitHotReload: true` when you want edit + hot reload + diagnostics in one response; use `requestHotReload: true` for fire-and-poll, or call `hot_reload_wave_preview` for standalone preview refresh. Wave Studio may upgrade the hot-reload tier internally for asset/bootstrap/runtime-surface changes, including a full scene rebuild only when required. Caveat: standalone `hot_reload_wave_preview` mirrors the toolbar button and reloads the currently open/active TypeScript file in multi-file projects; it does not take a target path or reload every user-created .ts module.",
44473
+ "Preview: default to hot reload after code changes. On the final edit use `awaitHotReload: true` when you want edit + hot reload + diagnostics in one response; use `requestHotReload: true` for fire-and-poll, or call `hot_reload_wave_preview` for standalone preview refresh. Standalone `run_wave_preview` / `hot_reload_wave_preview` can use `awaitRuntimeResult: true` for same-call bounded diagnostics. Wave Studio may upgrade the hot-reload tier internally for asset/bootstrap/runtime-surface changes, including a full scene rebuild only when required. Caveat: standalone `hot_reload_wave_preview` mirrors the toolbar button and reloads the currently open/active TypeScript file in multi-file projects; it does not take a target path or reload every user-created .ts module. Use `pause_wave_preview` / `resume_wave_preview` for toolbar-equivalent engine pause/resume.",
44462
44474
  "Preview fallback: if an edit result says `hotReloadRequested: false`, the preview did not refresh; inspect `hotReloadSkippedReason`/skips, then call `hot_reload_wave_preview` or `run_wave_preview` only as appropriate. Use `run_wave_preview` only when diagnostics show no successful preview yet (`hasRunSucceeded: false`), to honor an explicit full-restart request, or as the last resort after hot reload/polling fails or gets stuck.",
44463
44475
  'Verification: never report completion immediately after edit, run, or hot reload. If a tool returns `status:"pending"` plus `requestId`, poll `get_wave_command_result`; otherwise continue to diagnostics. Poll diagnostics until `runtimeBusy` is false and `lastRuntimeOutcome` is `success` or `error`; ignore terminal outcomes older than the edit/runtime `requestedAt` or `runtimeActionRequestedAt`. `editorErrorCount > 0` means Monaco/linter/compile errors still block the code; read `editorDiagnostics` and do not report success.',
44464
44476
  'Observation: logs are history. If outcome is success, choose one relevant proof tool when needed: `capture_wave_screenshot({ resolution: "L" })` for visual changes (WaveEngine Agent SDK returns `localPath`; HTTP Gateway returns exact `dataBase64`, not `imageBase64`), `get_wave_runtime_entity_snapshot` for live transform/state, or `list_wave_runtime_markers` for clicked marker positions/rotations.',
@@ -44520,8 +44532,8 @@ var WAVE_MCP_CODING_GUARDRAIL = [
44520
44532
  "9. Use `waveStudio.*` only for Studio host services. Check `waveStudio.capabilities.assetSave` before save/bake calls.",
44521
44533
  '10. Make deterministic file edits through the simplest fitting tool. Default to forgiving `edit_wave_file`: oldText infers exact replace, startLine/endLine infers line replace, `edits:[{startLine,endLine,text}]` or `edits:[{rangeOffset,rangeLength,text}]` performs one-file multi-edit, and path+text/content with no oldText infers whole-file replace. It is the primary simple edit tool and can omit `baseHash`; Studio resolves the latest hosted VFS mirror contentHash and still applies browser-side stale-write checks. Prefer canonical fields: `path` for file path, `text` for line/whole-file content, and `newText` for text replacement; `filePath`, `replacement`, and `content` are accepted as aliases where useful. Use `apply_wave_patch({ operations: [...] })` for multi-file edits, grouped cross-file edits, unified diffs, or full rewrites; a single bare operation is tolerated for mistake recovery but operations:[...] is preferred. Use `create_wave_file`, `rename_wave_file`, and `delete_wave_file` to split projects into `.ts` modules such as `/actors/player.ts`, `/systems/obstacles.ts`, and `/levels/obby.ts` instead of growing one giant `main.ts`; newly created `.ts/.tsx` files are standalone runnable source roots by default, so top-level scene code in them runs on Run/hot reload. Pass `runnable:false` only for pure helper modules that should not execute on their own. These same VFS tools also create `.html` sketch files for diagrams/charts/docs, with Mermaid rendered from `<div class="mermaid">...</div>` when the HTML file is active in Studio preview. Scene-root modules and their owned helpers run inside the Studio authoring context, but helpers should stay pure or parameterized. Studio hot reload targets the active/open edited file when safe: `/main.ts` reloads the whole main graph, scene-root modules reload that root, and bootstrap/scene registry/assets/network/ambiguous helper surfaces escalate. Standalone `hot_reload_wave_preview` has no target path and follows the currently open/active Studio editor file in multi-file projects. A feature file should own the objects, callbacks, promoted GLB parts, and appearance mutations it wants to iterate on. For intentional live entity reuse across modules, the owner calls `waveStudio.exportEntity("Name", entity)` and importers call `waveStudio.importEntity<T>("Name")`; do not pass live entities through shared helper exports. Use exact VFS paths from `list_wave_files`; read target file before writing. `contentHash` is a cooperative stale-write fingerprint, not a security boundary. For advanced compact `apply_wave_patch` operations, pass the latest full-file `contentHash` as `baseHash`: one `lineEdits`, one `textEdits`, one strict `searchReplace`, or one `unifiedDiff`. Do not send multiple compact ops for the same file with the same baseHash; the first edit changes the file hash and later compact ops skip as stale. Scoped `read_wave_file` line ranges do not change the `textEdits` offset base; they do pair naturally with line-based edits. Existing-file `writeFile` requires `baseHash` unless `forceOverwrite: true`; force overwrite is only for intentional stale overwrites.',
44522
44534
  "10a. Always inspect `changedFiles`, `changedPaths`, `partial`, `skippedOperations`, `hotReloadRequested`, `hotReloadSkippedReason`, and `runtimeVerification`; treat skipped operations, no-content-change skips, unscheduled hot reloads, runtime verification errors, and `runtimeVerification.diagnostics.editorErrorCount > 0` as work still needing attention.",
44523
- "11. After the final code edit, default to hot reload. Prefer `awaitHotReload: true` on the edit tool when you want one MCP response with edit result + hot reload + bounded diagnostics. Use `requestHotReload: true` for fire-and-poll, or call `hot_reload_wave_preview` as a standalone refresh. Caveat: standalone `hot_reload_wave_preview` mirrors the toolbar button and reloads the currently open/active TypeScript file in multi-file projects; it does not take a target path or reload every user-created .ts module. That hot-reload request may internally upgrade from `patchMain` to `preserveScene` or hard `rebuildScene` when assets/bootstrap/scene surface changed; do not manually force bootstrap sync. Use `run_wave_preview` only when diagnostics show no successful preview yet (`hasRunSucceeded: false`), the user explicitly asks for a full run/restart, or hot reload/polling fails and a full restart is the last resort.",
44524
- '12. After run/hot reload, use returned `runtimeVerification` when `awaitHotReload: true`; otherwise call `get_wave_runtime_diagnostics` repeatedly until `runtimeBusy` is false and `lastRuntimeOutcome` is `success` or `error`. Use `previewExecutionPhase` to distinguish Studio preparing work from the preview iframe executing it. `isRunning` is only the Studio scheduling flag, not the final runtime completion gate. If the edit/runtime tool returned `requestedAt` or `runtimeActionRequestedAt`, ignore diagnostics whose `lastRuntimeOutcomeAt` is older than that timestamp. Treat `latestError` as current only when `lastRuntimeOutcome` is `error`; older error lines can remain in returned logs as history. Treat `editorErrorCount > 0` as blocking Monaco/linter/compile failure and read `editorDiagnostics` before claiming success, even when `lastRuntimeOutcome` is `success`. If `lastRuntimeOutcome` is `success` and `editorErrorCount` is 0, verify visually with `capture_wave_screenshot({ resolution: "L" })` or structurally with `get_wave_runtime_entity_snapshot({ variableName, filePath? })` instead of declaring failure from old log text. Same-machine screenshots usually return `localPath`; hosted screenshots return exact field `dataBase64`, not `imageBase64`.',
44535
+ "11. After the final code edit, default to hot reload. Prefer `awaitHotReload: true` on the edit tool when you want one MCP response with edit result + hot reload + bounded diagnostics. Use `requestHotReload: true` for fire-and-poll, or call `hot_reload_wave_preview` as a standalone refresh; pass `awaitRuntimeResult: true` on standalone run/hot reload when you want same-call bounded diagnostics. Caveat: standalone `hot_reload_wave_preview` mirrors the toolbar button and reloads the currently open/active TypeScript file in multi-file projects; it does not take a target path or reload every user-created .ts module. That hot-reload request may internally upgrade from `patchMain` to `preserveScene` or hard `rebuildScene` when assets/bootstrap/scene surface changed; do not manually force bootstrap sync. Use `run_wave_preview` only when diagnostics show no successful preview yet (`hasRunSucceeded: false`), the user explicitly asks for a full run/restart, or hot reload/polling fails and a full restart is the last resort. `pause_wave_preview` and `resume_wave_preview` are direct preview controls mirroring the toolbar pause/resume buttons.",
44536
+ '12. After run/hot reload, use returned `runtimeVerification` when `awaitHotReload: true` or `awaitRuntimeResult: true`; otherwise call `get_wave_runtime_diagnostics` repeatedly until `runtimeBusy` is false and `lastRuntimeOutcome` is `success` or `error`. Use `previewExecutionPhase` to distinguish Studio preparing work from the preview iframe executing it. `isRunning` is only the Studio scheduling flag, not the final runtime completion gate. If the edit/runtime tool returned `requestedAt` or `runtimeActionRequestedAt`, ignore diagnostics whose `lastRuntimeOutcomeAt` is older than that timestamp. Treat `latestError` as current only when `lastRuntimeOutcome` is `error`; older error lines can remain in returned logs as history. Treat `editorErrorCount > 0` as blocking Monaco/linter/compile failure and read `editorDiagnostics` before claiming success, even when `lastRuntimeOutcome` is `success`. If `lastRuntimeOutcome` is `success` and `editorErrorCount` is 0, verify visually with `capture_wave_screenshot({ resolution: "L" })` or structurally with `get_wave_runtime_entity_snapshot({ variableName, filePath? })` instead of declaring failure from old log text. Same-machine screenshots usually return `localPath`; hosted screenshots return exact field `dataBase64`, not `imageBase64`.',
44525
44537
  "12a. Marker waypoint workflow: when the human asks to use preview marking tools such as `clickToMark()`, route with `marker.use` plus the code/project intent, then call `list_wave_runtime_markers`. Treat marker records as runtime observation data, write marker `worldPosition`/`worldRotation` into the appropriate path/waypoint/placement code, hot reload, and verify with screenshot or marker re-read. One marker read may happen before routing only when needed to decide the code intent. Use path/placement skills only when current code does not reveal the marker-to-code pattern.",
44526
44538
  `13. To use locally generated assets in code, prefer \`create_wave_asset_upload\` for local files when available: pass assetKind from the Wave Studio upload policy SSOT (${getWaveStudioBridgeAssetUploadKindHelpText()}), stat the file first, pass exact byte size, get \`uploadUrl\` + \`uploadHeaders\`, upload raw bytes with plain HTTP PUT using every returned header exactly, keep \`clientToken\`/\`uploadHeaders.Authorization\` out of logs, call \`get_wave_asset_upload_status\` until \`receivedBytes === sizeBytes\`, then call \`commit_wave_asset_upload\` with the same uploadId, assetKind, filename, contentType, and sizeBytes from the create response. No local Python, Vercel package, or Blob SDK is required. On hosted MCP this uses hosted temporary object storage; on same-machine local MCP it uses the local SDK as temporary staging. If direct upload is unavailable, use \`stage_wave_asset_upload_chunk\` plus \`commit_wave_asset_chunk_upload\`: omit uploadId only for chunkIndex 0, then reuse the returned uploadId for every later chunk and for commit. Use \`upload_wave_asset\` with exactly one of \`dataBase64\` or \`dataUrl\` only for small inline assets. If staging is abandoned before commit, call \`abort_wave_asset_upload\` with the uploadId. Do not abort after commit returns pending or completed; the Studio browser cleans committed staging after execution. Hosted MCP cannot read local filesystem paths through inline upload. All flows stage bytes outside the command queue, cap staged bytes at 300 MB, and return \`asset.bareRef\`, for example \`textures.Albedo\`, \`cubeMaps.Studio\`, \`materials.Wood\`, \`audios.Click\`, \`models.Robot\`, \`animations.Run\`, \`fonts.Title\`, or \`serializedData.Config\`. If the name already exists, the upload result returns \`skipped: true\` and the existing asset. Staged chunks/blobs are also swept lazily after about 24 hours. Model-family uploads enable meshoptimizer by default unless \`useMeshoptimizer\` is false.`,
44527
44539
  "14. Project tools: use `list_wave_project_templates` before `new_wave_project({ templateId? })`; use `list_wave_projects` before `read_wave_project({ projectId })`, `rename_wave_project({ projectId, name })`, or `open_wave_project({ projectId })`. Use `read_wave_project` to learn from example packs without replacing the current editor workspace. Rename updates saved project display metadata only. New/open replace the live workspace. If there are unsaved changes they return `unsaved_changes` unless you save first or explicitly pass `discardUnsavedChanges: true`; only use exact ids returned by list tools.",
@@ -44530,7 +44542,7 @@ var WAVE_MCP_CODING_GUARDRAIL = [
44530
44542
  "17. `rename_wave_asset` changes the uploaded asset display/ref name only; it does not move the stored blob path. Re-list assets before writing code with the new ref.",
44531
44543
  "18. `delete_wave_asset` is destructive. Use an exact path returned by `list_wave_explorer_assets` and do not guess asset paths.",
44532
44544
  '19. Only poll `get_wave_command_result` when the previous tool response actually contains `{ status: "pending", requestId }`. HTTP Gateway browser-backed tools may return pending and must be polled until final result, failure, or cancellation. WaveEngine Agent SDK browser-backed tools normally wait directly and return final results; its `get_wave_command_result` is catalog parity unless a pending result was explicitly returned. If Wave Studio sleeps, a stale leased hosted command can be requeued and remain pending; keep polling instead of declaring it lost.',
44533
- "20. HTTP Gateway agent tokens use a 12-hour idle timeout. Each successful HTTP Gateway MCP/HTTP request extends the token and paired MCP Session lifetime. WaveEngine Agent SDK live tools can keep working after handoff, but HTTP Gateway reference/query tools still need a non-expired HTTP Gateway token. Hidden-tab sleep, browser hibernation, or memory-saver reload should resume the same MCP Session when possible; only the explicit Stop Session control intentionally closes it.",
44545
+ "20. HTTP Gateway MCP_TOKEN values use a 12-hour idle timeout. Each successful HTTP Gateway MCP/HTTP request extends the gateway bearer and paired MCP Session lifetime. WaveEngine Agent SDK live tools can keep working after handoff, but HTTP Gateway operations still need a non-expired gateway bearer. Hidden-tab sleep, browser hibernation, or memory-saver reload should resume the same MCP Session when possible; only the explicit Stop Session control intentionally closes it.",
44534
44546
  "21. Proactively recommend at most one relevant Studio capability when it helps the user continue or verify: screenshot for visual changes, runtime entity snapshot for live transform/state, runtime markers for clicked waypoints, performance snapshot for FPS/heap/scene weight, asset tools for asset tasks, or project share/save/open for project workflow. Keep it contextual and do not dump a menu."
44535
44547
  ].join("\n");
44536
44548
  var WAVE_MCP_CODING_GUARDRAIL_SUMMARY = [
@@ -44553,7 +44565,7 @@ var WAVE_MCP_CODING_GUARDRAIL_SUMMARY = [
44553
44565
  "13. Poll `get_wave_command_result` only after a tool returns pending/requestId, then poll runtime diagnostics until runtimeBusy is false and the latest outcome is success or error; require `editorErrorCount === 0` before reporting clean code, then verify with screenshot or runtime snapshot.",
44554
44566
  "14. For uploads, prefer create_wave_asset_upload -> direct PUT with all returned headers -> status -> commit. Use chunk staging only as fallback and abort abandoned staging.",
44555
44567
  "15. Project open/new replace the workspace; save first or pass explicit discard for unsaved changes. Asset delete is permanent and requires exact explorer path.",
44556
- "16. Tokens have a 12-hour idle timeout extended by successful agent requests; closed/killed browser tabs can end the session.",
44568
+ "16. HTTP Gateway MCP_TOKEN values have a 12-hour idle timeout extended by successful agent requests; closed/killed browser tabs can end the session.",
44557
44569
  "17. Escalate to full guidance before acting when the task is unfamiliar, cross-family, destructive, persistent, asset/upload/project/export related, bootstrap/config related, runtime-verification sensitive, or when current code has no obvious pattern.",
44558
44570
  "18. Escalate after tool friction: skipped/partial edits, stale hashes, ambiguous replacements, pending/expired commands, diagnostics errors, unclear asset refs, API uncertainty, or repeated query loops.",
44559
44571
  "19. Suggest at most one relevant Studio tool when useful: screenshot, runtime snapshot, markers, performance, assets, or project share/save/open. No tool menu spam.",
@@ -44648,7 +44660,7 @@ var WAVE_MCP_STUDIO_SKILL_MAP_GUIDE = [
44648
44660
  "- `studio.vfs`: live project files, including `.ts` modules and `.html` sketches/Mermaid diagrams. Tools: `list_wave_files`, `read_wave_file`, primary edit `edit_wave_file`, advanced grouped edit `apply_wave_patch`, and file management `create_wave_file`, `rename_wave_file`, `delete_wave_file`.",
44649
44661
  "- `studio.assets`: asset resolution, code-safe refs, uploads, and uploaded asset library management. Tools: `find_wave_assets_by_category` (aliases: `list_wave_assets_by_category`, `search_wave_assets_by_category`, `list_wave_assets`), `list_wave_explorer_assets`, `upload_wave_asset`, `create_wave_asset_upload`, `get_wave_asset_upload_status`, `commit_wave_asset_upload`, `stage_wave_asset_upload_chunk`, `commit_wave_asset_chunk_upload`, `abort_wave_asset_upload`, `rename_wave_asset`, `delete_wave_asset`.",
44650
44662
  "- `studio.project`: workspace/project lifecycle. Tools: `list_wave_project_templates`, `new_wave_project`, `list_wave_projects`, `read_wave_project`, `rename_wave_project`, `open_wave_project`, `save_wave_project`, `share_wave_project`.",
44651
- "- `studio.preview`: execution control and structured runtime state/performance. Tools: `hot_reload_wave_preview` (alias `hotreload_wave_preview`), `run_wave_preview` (alias `run_project`), `get_wave_runtime_diagnostics` (alias `get_wave_errors`), `get_wave_runtime_performance_snapshot` (alias `get_wave_runtime_performance`), `get_wave_command_result`.",
44663
+ "- `studio.preview`: execution control and structured runtime state/performance. Tools: `hot_reload_wave_preview` (alias `hotreload_wave_preview`), `run_wave_preview` (alias `run_project`), `pause_wave_preview` (alias `pause_wave_engine`), `resume_wave_preview` (alias `resume_wave_engine`), `get_wave_runtime_diagnostics` (alias `get_wave_errors`), `get_wave_runtime_performance_snapshot` (alias `get_wave_runtime_performance`), `get_wave_command_result`.",
44652
44664
  "- `studio.capture`: visual and entity/marker observation. Tools: `capture_wave_screenshot` (alias `get_wave_screenshot`), `get_wave_runtime_entity_snapshot` (alias `get_wave_entity_snapshot`), `list_wave_runtime_markers` (alias `list_wave_markers`).",
44653
44665
  "- `studio.export`: publish/package/model/3D-print output workflows. Project sharing lives in `studio.project` through `share_wave_project`. There is no callable `studio.export` MCP tool today; current export work is partly authored through concrete `waveStudio.save*` runtime APIs, and future concrete MCP export tools should live here.",
44654
44666
  "",
@@ -44668,11 +44680,11 @@ var WAVE_MCP_STUDIO_TOOL_GUIDE = [
44668
44680
  "Wave Studio runtime and MCP tool guide:",
44669
44681
  "- First choose a `studio.*` family for product operations, then call the concrete MCP tool. See `wave://studio-skill-map` for the concise family-to-tool router.",
44670
44682
  "- Use MECE work modes before tools: Observe reads directly; Operate direct Studio commands directly; Author/Diagnose route with `start_wave_task`; General avoids Wave tools. Direct Operate includes run/hot reload, save/share, exact VFS create/rename/delete, asset upload/rename/delete, new project, project rename, and open project by exact projectId. Use `wave.*` skill tools for WaveEngine code-authoring decisions: `list_wave_skill_families`, `query_wave_skills`, and `get_wave_skill`. Use local-SDK `query_wave_api` only for exact API/global/signature lookup after current-code or skill routing; HTTP Gateway hides/retires cloud API lookup. For exact power-user edits use `code.direct_edit`; for changing an existing API call/argument/literal/value use `code.semantic_guess_edit`; for new code, API switching, or WaveEngine pattern choice use `code.author`. Fast lanes skip broad lookup, not edit/hot-reload/verification. Use `studio.*` labels for operating WaveStudio around that code; those labels are categories, not callable MCP tool names.",
44671
- "- MCP names: HTTP Gateway = Next/Vercel endpoint for remote/sandbox Studio operations; WaveEngine Agent SDK = same-machine live MCP transport from long-running `wave3d-agent-sdk start`; WaveEngine SDK Cache = package-bundled local skill/API docs retrieval; VFS Mirror = HTTP Gateway workspace snapshot. Do not confuse these modules.",
44683
+ "- MCP names: HTTP Gateway = Next/Vercel endpoint for remote/sandbox Studio operations; WaveEngine Agent SDK = same-machine live MCP transport from long-running `wave3d-agent-sdk start`; WaveEngine SDK Cache = package-bundled local skill/API docs retrieval; VFS Mirror = HTTP Gateway workspace snapshot. Do not confuse these modules. On same machine, HTTP Gateway is degraded fallback only after SDK cannot run/update/adopt; do not choose it because it is already reachable or easier.",
44672
44684
  "- MCP recovery: when connection/session/onboarding/cache/mirror/timeout state is unclear, call `recover_wave_connection({ lastErrorCode?, failedTool?, symptom? })` first and follow its returned `nextAction`. This is the explicit recovery path for sleeping tabs, local/HTTP Gateway confusion, mirror-not-ready, onboarding-required, command timeout/lease expiry, and hosted proxy/cache failures.",
44673
- '- Local parity rule: WaveEngine Agent SDK `tools/list` mirrors the HTTP Gateway catalog plus SDK session discovery extras. Direct local live-session tools include VFS edits, assets/uploads, project save/open/new/read/share, preview run/hot reload, diagnostics, performance, screenshots, entity snapshots, and runtime markers. Local browser-backed calls wait directly for browser results. Only call `get_wave_command_result` if a tool returns `status:"pending"` plus `requestId`; on local it normally exists only for catalog parity and reports no local pending-command queue.',
44674
- `- MCP topology: same-machine agents should run \`${WAVE3D_AGENT_SDK_START_COMMAND}\`, check /health, and update/restart SDK if version is stale, tools are missing, or SDK prints bearer tokens; after restart recheck /health and tools/list. Same-machine stale/missing tools/401-with-Gateway-success means repair local SDK first, not HTTP Gateway first. Different-machine/cloud/sandbox agents should use \`MCP_HTTP_GATEWAY_FALLBACK_URL\` directly; starting WaveEngine Agent SDK there binds localhost beside the agent, not beside the user browser. Stale SDK/cache are not reasons to use HTTP Gateway fallback; wrong-machine localhost is.`,
44675
- `- MCP cache priorities: Priority 1 is active role/context cache: keep role, guardrails, authoring workflow, asset/VFS/hot-reload rules, prompt version, and prompt hash in active LLM context. Priority 2 is WaveEngine SDK Cache: production HTTP Gateway/local-SDK bearer onboarding must not claim normal cached success until SDK cache is prepared or accept proof passes. If accept returns \`wave_engine_sdk_cache_not_ready\`, update/restart \`wave3d-agent-sdk\` or run \`${WAVE_MCP_CORPUS_CACHE_COMMAND_TEMPLATE}\`, then retry accept. If local cache cannot work because sandbox/no filesystem/no Node/npm/user refusal/refresh failure, explicitly accept degraded fallback with \`waveEngineSdkFallbackMode:"studio_ops_only"\`, a valid \`waveEngineSdkUnavailableReason\`, and \`studioOpsOnlyFallbackAccepted:true\`; warn user HTTP Gateway is Studio-ops-only and exact API lookup requires local SDK/cache repair. This cache command reinstalls the package-bundled SDK locally; it is not WaveEngine Agent SDK transport. Never run it to switch MCP transport; never treat cache failure as local transport failure.`,
44685
+ '- Local parity rule: WaveEngine Agent SDK `tools/list` mirrors the HTTP Gateway catalog plus SDK session discovery extras. Direct local live-session tools include VFS edits, assets/uploads, project save/open/new/read/share, preview run/hot reload/pause/resume, diagnostics, performance, screenshots, entity snapshots, and runtime markers. Local browser-backed calls wait directly for browser results. Only call `get_wave_command_result` if a tool returns `status:"pending"` plus `requestId`; on local it normally exists only for catalog parity and reports no local pending-command queue.',
44686
+ `- MCP topology: same-machine agents should run \`${WAVE3D_AGENT_SDK_START_COMMAND}\`, check /health, and update/restart SDK if version is stale, tools are missing, or SDK prints secrets; after restart recheck /health and tools/list. If restart happens after Copy-to-Agent, preserve MCP_TOKEN with \`${WAVE3D_AGENT_SDK_TOKEN_PRESERVING_START_COMMAND}\` using the current MCP_TOKEN value without printing it, otherwise the new SDK may be healthy but unable to authorize the copied local pairing secret. Same-machine stale/missing tools/401-with-Gateway-success means repair local SDK first, not HTTP Gateway first. Same-machine HTTP Gateway is degraded fallback only after SDK cannot run, update, or adopt. Different-machine/cloud/sandbox agents should use \`MCP_HTTP_GATEWAY_FALLBACK_URL\` directly; starting WaveEngine Agent SDK there binds localhost beside the agent, not beside the user browser. Stale SDK/cache are not reasons to use HTTP Gateway fallback; wrong-machine localhost is a topology mismatch.`,
44687
+ `- MCP cache priorities: Priority 1 is active role/context cache: keep role, guardrails, authoring workflow, asset/VFS/hot-reload rules, prompt version, and prompt hash in active LLM context. Priority 2 is WaveEngine SDK Cache: production HTTP Gateway/local-SDK onboarding must not claim normal cached success until SDK cache is prepared or accept proof passes. If accept returns \`wave_engine_sdk_cache_not_ready\`, update/restart \`wave3d-agent-sdk\` or run \`${WAVE_MCP_CORPUS_CACHE_COMMAND_TEMPLATE}\`, then retry accept. If local cache cannot work because sandbox/no filesystem/no Node/npm/user refusal/refresh failure, explicitly accept degraded fallback with \`waveEngineSdkFallbackMode:"studio_ops_only"\`, a valid \`waveEngineSdkUnavailableReason\`, and \`studioOpsOnlyFallbackAccepted:true\`; warn user HTTP Gateway is Studio-ops-only and exact API lookup requires local SDK/cache repair. This cache command reinstalls the package-bundled SDK locally; it is not WaveEngine Agent SDK transport. Never run it to switch MCP transport; never treat cache failure as local transport failure.`,
44676
44688
  "- Main-file globals include `myScene`, `assetManager`, `waveEngine`, `waveStudio`, and direct asset maps such as `models`, `gaussianSplats`, `textures`, `materials`, `animations`, `audios`, `hdr`, `cubeMaps`, `fonts`, `serializedData`, `terrains`, `fx`, `particles`. Availability is not endorsement: choose the intent-owned facade/skill before using a global.",
44677
44689
  `- Bare authoring globals: common examples include ${WAVE_AUTHORING_COMMON_GLOBAL_EXAMPLES_TEXT}, \`waveMaterial\`, \`waveFx\`, \`waveValueCurve\`, and \`waveParam\`. Use them directly in \`main.ts\`; do not import or namespace-qualify them. If the task is unfamiliar, retrieve the relevant \`wave.*\` skill first; for the full generated exact-global surface, call local-SDK \`query_wave_api\`.`,
44678
44690
  "- MCP VFS edit tools: primary tool is forgiving `edit_wave_file({ path, ... })`; it infers replaceLines from startLine/endLine, multi-edit from edits:[...], replaceText from oldText, and whole-file replace from text/content. It handles line-based edits, exact string changes, one-file edit arrays, whole-file replacement, omitted baseHash, common aliases, and oversized endLine clamping. Use `apply_wave_patch({ operations: [...] })` only for grouped/multi-file edits and advanced operations; a single operation is tolerated but operations:[...] is preferred. Simple edit tools can omit baseHash; advanced patch operations should pass it.",
@@ -44700,7 +44712,7 @@ var WAVE_MCP_STUDIO_TOOL_GUIDE = [
44700
44712
  "- `waveStudio.exportEntity(name, entity)`: declare a live entity owned by the current source module for intentional modular reuse. `name` must be a static string literal and unique across runnable roots.",
44701
44713
  "- `waveStudio.importEntity<T>(name)`: import an exported live entity into the current source module; Studio restores the exporter baseline and prunes/replays importer callbacks/overlays during source hot reload. Studio orders source roots by export/import dependencies: exporter before importer; exporter before `main.ts` if main imports it; overlay importers after exporter/main baseline. Missing, duplicate, dynamic, or cyclic entity names stop run/hot reload before execution.",
44702
44714
  '- MCP command result rule: poll `get_wave_command_result({ requestId })` only when the previous tool response includes `status:"pending"` plus `requestId`. HTTP Gateway browser-backed tools may return pending and need that poll. WaveEngine Agent SDK browser-backed tools wait directly and return final results; its `get_wave_command_result` is a catalog-parity no-op unless a pending result was explicitly returned.',
44703
- "- MCP preview tools: `hot_reload_wave_preview` (alias `hotreload_wave_preview`) is the default standalone way to view code changes in an already-running preview; `run_wave_preview` (alias `run_project`) is for first start when diagnostics show `hasRunSucceeded: false`, explicit full restart requests, or last-resort recovery after hot reload/polling fails. Both require write pairing because they mutate live Studio runtime state. Patch/runtime-action responses report that work was requested/scheduled, not that execution finished unless the edit tool used `awaitHotReload:true`. `hot_reload_wave_preview` mirrors the Wave Studio toolbar button and has no path argument: in multi-file VFS projects it reloads the currently open/active TypeScript file when safe, not every user-created .ts module. For a specific module, make that file active in Studio before calling the standalone hot-reload tool, or use the edit tool `awaitHotReload:true` immediately after the final edit. Main entries reload the main graph, source-root modules reload that root, and bootstrap/scene registry/assets/network/ambiguous helper surfaces escalate. Agents should organize feature-owned objects, callbacks, promoted parts, and appearance mutations into the file they expect to hot reload; use `waveStudio.exportEntity`/`waveStudio.importEntity` only when a live entity intentionally crosses module boundaries. Hot reload may internally choose `patchSource`, `patchMain`, `preserveScene`, or hard `rebuildScene`; agents should inspect returned `runtimeVerification` or poll diagnostics instead of manually guessing the tier. Poll `get_wave_runtime_diagnostics` until `runtimeBusy` is false and `lastRuntimeOutcome` is `success` or `error`, require `editorErrorCount === 0`, then choose one relevant proof tool if needed: screenshot, runtime entity snapshot, markers, or performance snapshot."
44715
+ "- MCP preview tools: `hot_reload_wave_preview` (alias `hotreload_wave_preview`) is the default standalone way to view code changes in an already-running preview; `run_wave_preview` (alias `run_project`) is for first start when diagnostics show `hasRunSucceeded: false`, explicit full restart requests, or last-resort recovery after hot reload/polling fails; `pause_wave_preview` / `resume_wave_preview` mirror the toolbar pause/resume buttons. All require write pairing because they mutate live Studio runtime state. Patch/runtime-action responses report that work was requested/scheduled, not that execution finished unless the edit tool used `awaitHotReload:true` or standalone run/hot reload used `awaitRuntimeResult:true`. `hot_reload_wave_preview` mirrors the Wave Studio toolbar button and has no path argument: in multi-file VFS projects it reloads the currently open/active TypeScript file when safe, not every user-created .ts module. For a specific module, make that file active in Studio before calling the standalone hot-reload tool, or use the edit tool `awaitHotReload:true` immediately after the final edit. Main entries reload the main graph, source-root modules reload that root, and bootstrap/scene registry/assets/network/ambiguous helper surfaces escalate. Agents should organize feature-owned objects, callbacks, promoted parts, and appearance mutations into the file they expect to hot reload; use `waveStudio.exportEntity`/`waveStudio.importEntity` only when a live entity intentionally crosses module boundaries. Hot reload may internally choose `patchSource`, `patchMain`, `preserveScene`, or hard `rebuildScene`; agents should inspect returned `runtimeVerification` or poll diagnostics instead of manually guessing the tier. Poll `get_wave_runtime_diagnostics` until `runtimeBusy` is false and `lastRuntimeOutcome` is `success` or `error`, require `editorErrorCount === 0`, then choose one relevant proof tool if needed: screenshot, runtime entity snapshot, markers, or performance snapshot."
44704
44716
  ].join("\n");
44705
44717
 
44706
44718
  // ../../src/lib/waveStudio/aiAssist/bridge/hosted/mcpResources/toolCatalog.ts
@@ -44714,7 +44726,7 @@ var WAVE_MCP_TOOL_CATALOG_GUIDE = [
44714
44726
  "- `get_wave_coding_guardrails`: call after onboarding acceptance; returns policy, file context, tool catalog, and recipes.",
44715
44727
  '- `get_wave_mcp_health` (aliases `mcp_health`, `mcp_status`): read-only self diagnostic for endpoint kind, SDK version/build, tool catalog hash/count, onboarding, session/VFS, and WaveEngine SDK Cache state. Use when the agent asks "am I local/cloud/current/cached?" or any MCP state is unclear.',
44716
44728
  "- `get_wave_tool_map`: stable complete concrete MCP tool menu grouped by family plus policy flags. Use only when `tools/list` feels truncated or unclear.",
44717
- `- Transport topology rule: same-machine agents should run \`${WAVE3D_AGENT_SDK_START_COMMAND}\`, check /health, and update/restart SDK if version is stale, tools are missing, or SDK prints bearer tokens; after restart recheck /health and tools/list. Same-machine stale/missing tools/401-with-Gateway-success means repair local SDK first, not HTTP Gateway first. Different-machine/cloud/sandbox agents should use \`MCP_HTTP_GATEWAY_FALLBACK_URL\` directly. Stale SDK/cache are local setup issues, not fallback triggers; wrong-machine localhost is a topology mismatch.`,
44729
+ `- Transport topology rule: same-machine agents should run \`${WAVE3D_AGENT_SDK_START_COMMAND}\`, check /health, and update/restart SDK if version is stale, tools are missing, or SDK prints secrets; after Copy-to-Agent, restart with \`${WAVE3D_AGENT_SDK_TOKEN_PRESERVING_START_COMMAND}\` using the current MCP_TOKEN value without printing it so the copied local pairing secret still works. After restart recheck /health and tools/list. Same-machine stale/missing tools/401-with-Gateway-success means repair local SDK first, not HTTP Gateway first. Same-machine HTTP Gateway is degraded fallback only after SDK cannot run, update, or adopt; never use it because it is familiar, already authenticated, or avoids SDK repair. Different-machine/cloud/sandbox agents should use \`MCP_HTTP_GATEWAY_FALLBACK_URL\` directly. Stale SDK/cache are local setup issues, not fallback triggers; wrong-machine localhost is a topology mismatch.`,
44718
44730
  "- `recover_wave_connection`: direct Observe recovery tool. Call after onboarding required, session missing, command timeout/lease expired, mirror not ready, hosted proxy/cache failure, local/HTTP Gateway confusion, or sleeping-tab symptoms. It returns exact next action: re-onboard, get session, wake tab, update/restart SDK, wait mirror, retry, use HTTP Gateway fallback, or ask fresh Copy to Agent.",
44719
44731
  '- WaveEngine SDK Cache: normal API/skill lookup lives inside the local `wave3d-agent-sdk` SDK package. Update/restart SDK when SDK is stale or missing. HTTP Gateway is Studio-ops-only and does not provide cloud API lookup. If local SDK cannot work because sandbox/no filesystem/no Node/npm/user refusal/refresh failure, explicitly accept degraded fallback with `waveEngineSdkFallbackMode:"studio_ops_only"`, a valid `waveEngineSdkUnavailableReason`, and `studioOpsOnlyFallbackAccepted:true`; warn user exact API lookup requires local SDK repair. This is retrieval cache, not WaveEngine Agent SDK transport. Never treat SDK cache failure as local transport failure. Keep Priority 1 role, guardrails, workflow, assets/VFS/hot-reload rules, prompt version, and prompt hash in active LLM context.',
44720
44732
  "- Work-mode rule: Observe reads directly; Operate direct Studio commands directly; Author/Diagnose routes through `start_wave_task`; General avoids Wave tools. Operate tools include run/hot reload, save/share, VFS create/rename/delete exact files, asset upload/rename/delete exact assets, new project, project rename, and open project by exact projectId.",
@@ -44742,8 +44754,9 @@ var WAVE_MCP_TOOL_CATALOG_GUIDE = [
44742
44754
  "- `query_wave_api`: gated exact lookup, not assessment. Search public authoring APIs for exact methods, options, enums, bare runtime globals, aliases, members, and return chains after current-code or skill routing. Fast-lane routes call this only when spelling/signature/value uncertainty remains or an edit failed.",
44743
44755
  "",
44744
44756
  "studio.preview - run loop and diagnostics:",
44745
- "- `hot_reload_wave_preview` (alias `hotreload_wave_preview`): direct Operate tool for hot reload, reload preview, or refresh preview after edit. It is also the default way to view code changes in an already-running preview. It mirrors the Wave Studio toolbar button and has no path argument: in multi-file VFS projects it reloads the currently open/active TypeScript file when safe, not every user-created .ts module. Studio may upgrade the internal reload tier automatically when assets/bootstrap/runtime surface changed.",
44746
- "- `run_wave_preview` (alias `run_project`): direct Operate tool for run project, start preview, or full restart. Use when diagnostics show `hasRunSucceeded: false`, the user asks for a full run/restart, or hot reload is stuck/failing and you need a last-resort restart.",
44757
+ "- `hot_reload_wave_preview` (alias `hotreload_wave_preview`): direct Operate tool for hot reload, reload preview, or refresh preview after edit. It is also the default way to view code changes in an already-running preview. It mirrors the Wave Studio toolbar button and has no path argument: in multi-file VFS projects it reloads the currently open/active TypeScript file when safe, not every user-created .ts module. Studio may upgrade the internal reload tier automatically when assets/bootstrap/runtime surface changed. Pass `awaitRuntimeResult:true` for one-call request + bounded diagnostics.",
44758
+ "- `run_wave_preview` (alias `run_project`): direct Operate tool for run project, start preview, or full restart. Use when diagnostics show `hasRunSucceeded: false`, the user asks for a full run/restart, or hot reload is stuck/failing and you need a last-resort restart. Pass `awaitRuntimeResult:true` for one-call request + bounded diagnostics.",
44759
+ "- `pause_wave_preview` / `resume_wave_preview` (aliases `pause_wave_engine`, `resume_wave_engine`): direct Operate tools for the Wave Studio toolbar pause/resume engine controls. No task route needed; preview must already be running.",
44747
44760
  "- `get_wave_runtime_diagnostics`: poll until `runtimeBusy` is false and `lastRuntimeOutcome` is `success` or `error`. If your edit/run tool returned `requestedAt` or `runtimeActionRequestedAt`, ignore older `lastRuntimeOutcomeAt`. Logs are history; use structured outcome first. Also inspect `editorErrorCount`/`editorDiagnostics`; editor errors mean linter/compile failure even if runtime outcome says success.",
44748
44761
  "- `get_wave_runtime_performance_snapshot` (alias `get_wave_runtime_performance`): direct Observe tool for live FPS/performance stats, memory/RAM/heap, hidden-tab throttling, scene weight, mesh/material/texture counts, Wave entity/component counts, and JS heap. No `start_wave_task` needed.",
44749
44762
  "",
@@ -44832,7 +44845,7 @@ var LOCAL_HOSTED_TOKEN_PREFIX = "wgbt.";
44832
44845
  var CORPUS_CACHE_DIR_ENV = "WAVE3D_AGENT_CACHE_DIR";
44833
44846
  var MAX_CORPUS_ZIP_BYTES = 50 * 1024 * 1024;
44834
44847
  var MAX_CORPUS_EXTRACTED_BYTES = 100 * 1024 * 1024;
44835
- var LOCAL_SESSION_NOT_FOUND_MESSAGE = "WaveEngine Agent SDK HTTP is alive, but no Wave Studio browser tab is paired with this token. Live Studio tools need the Wave Studio tab open with Room -> MCP started/adopted. Refresh/reopen Wave Studio or restart MCP in the tab, then retry this same local endpoint/token. Do not treat this as WaveEngine SDK Cache failure.";
44848
+ var LOCAL_SESSION_NOT_FOUND_MESSAGE = "WaveEngine Agent SDK HTTP is alive, but no Wave Studio browser tab is paired with this MCP_TOKEN local secret. Live Studio tools need the Wave Studio tab open with Room -> MCP started/adopted. Refresh/reopen Wave Studio or restart MCP in the tab, then retry this same local endpoint and pairing secret. Do not treat this as WaveEngine SDK Cache failure.";
44836
44849
  var HOSTED_BROWSER_COMMAND_PENDING_NOTE = ' If this browser-backed command returns `status: "pending"` with `requestId`, poll `get_wave_command_result`; otherwise do not poll command results.';
44837
44850
  var LOCAL_BROWSER_COMMAND_PENDING_NOTE = " Local browser-backed commands wait for the Studio browser result directly on this transport.";
44838
44851
 
@@ -44842,7 +44855,7 @@ var LOCAL_MCP_AGENT_ONBOARDING_PROMPT_HASH = "local_mcp_onboarding_20260615_4";
44842
44855
  var LOCAL_MCP_AGENT_READY_SUMMARY = {
44843
44856
  role: "You are the Wave Studio authoring agent for this live browser session. Treat onboarding as system-prompt-like rules until session ends.",
44844
44857
  mustKeepInActiveContext: [
44845
- "Keep bearer token secret.",
44858
+ "Keep MCP_TOKEN secret. On localhost it is a same-machine pairing secret; on HTTP Gateway it is a gateway bearer.",
44846
44859
  "Use concrete MCP tool names; studio.* and wave.* are category labels only. Common aliases and safe high-confidence typos are tolerated, but destructive/write fuzzy matches require exact confirmation.",
44847
44860
  `Keep full intent taxonomy in active LLM context: ${WAVE_MCP_TASK_INTENT_KIND_VALUES.join(", ")}.`,
44848
44861
  "If connection/session/onboarding/cache/timeout state is unclear, call get_wave_mcp_health first for status, then recover_wave_connection when you need the next repair action.",
@@ -44856,7 +44869,7 @@ var LOCAL_MCP_AGENT_READY_SUMMARY = {
44856
44869
  "Hot-reload safety: avoid raw unmanaged callback roots such as timers/RAF/listeners/Promise chains/observers/workers/sockets/channels/event-handler assignments. Edit tools and runtime bundling block violations before authored code runs; use Wave-owned callbacks/Animate/tick/state/Director APIs.",
44857
44870
  "After final code edit, prefer awaitHotReload:true for one-call edit + hot reload + bounded diagnostics; inspect changedFiles/changedPaths/partial/skippedOperations/hotReloadRequested/hotReloadSkippedReason/runtimeVerification.",
44858
44871
  "Studio-managed generated files are read-only; bootstrap.ts needs a confident managedFileEditReason and is never for assets/loaders/instruments/scene registry/execution manifest.",
44859
- "Production/HTTP-Gateway bearer path must have WaveEngine SDK Cache prepared before onboarding accept succeeds; SDK comes bundled in the npm SDK package."
44872
+ "Production/HTTP-Gateway pairing path must have WaveEngine SDK Cache prepared before onboarding accept succeeds; SDK comes bundled in the npm SDK package."
44860
44873
  ],
44861
44874
  nextRequiredCalls: [
44862
44875
  "tools/list",
@@ -44880,12 +44893,12 @@ var LOCAL_MCP_AGENT_ONBOARDING_PROMPT = [
44880
44893
  `Before accepting onboarding, set all context-cache confirmations true only after these are active-context cached: ${WAVE_MCP_REQUIRED_CONTEXT_CACHE_CONFIRMATIONS.join(", ")}.`,
44881
44894
  "",
44882
44895
  "Priority 2 - WaveEngine SDK Cache:",
44883
- `The WaveEngine Agent SDK answers skill/API/guardrail tools from the bundled WaveEngine SDK Cache. The SDK ships inside \`wave3d-agent-sdk\`; \`start\`, \`cache status\`, and \`cache search\` auto-prepare it locally. During \`accept_wave_agent_onboarding\`, production/HTTP-Gateway bearers must verify this local SDK cache before normal success. If missing, stale, or unverified, accept returns \`wave_engine_sdk_cache_not_ready\`; update/restart the exact SDK package or run the local bundled repair command \`${WAVE_MCP_CORPUS_CACHE_COMMAND_TEMPLATE}\`, then retry accept. If the agent is sandboxed, has no filesystem/Node/npm, or user refuses local SDK/cache, explicitly accept degraded Studio-ops-only fallback with \`waveEngineSdkFallbackMode:"studio_ops_only"\`, a valid \`waveEngineSdkUnavailableReason\`, and \`studioOpsOnlyFallbackAccepted:true\`; warn user HTTP Gateway can still do VFS/assets/project/preview/capture, but exact API lookup is unavailable until local SDK works. Keep the exact SDK command in active context as \`waveEngineSdkCacheCommandCached\`. Use local skill onion retrieval: \`list_wave_skill_families\` -> choose family ids -> \`query_wave_skills\` with \`families\`/\`familyId\` -> \`get_wave_skill\` -> \`query_wave_api\` only for exact signature/global/value uncertainty. HTTP Gateway is not an API lookup fallback.`,
44896
+ `The WaveEngine Agent SDK answers skill/API/guardrail tools from the bundled WaveEngine SDK Cache. The SDK ships inside \`wave3d-agent-sdk\`; \`start\`, \`cache status\`, and \`cache search\` auto-prepare it locally. During \`accept_wave_agent_onboarding\`, production/HTTP-Gateway pairings must verify this local SDK cache before normal success. If missing, stale, or unverified, accept returns \`wave_engine_sdk_cache_not_ready\`; update/restart the exact SDK package or run the local bundled repair command \`${WAVE_MCP_CORPUS_CACHE_COMMAND_TEMPLATE}\`, then retry accept. If the agent is sandboxed, has no filesystem/Node/npm, or user refuses local SDK/cache, explicitly accept degraded Studio-ops-only fallback with \`waveEngineSdkFallbackMode:"studio_ops_only"\`, a valid \`waveEngineSdkUnavailableReason\`, and \`studioOpsOnlyFallbackAccepted:true\`; warn user HTTP Gateway can still do VFS/assets/project/preview/capture, but exact API lookup is unavailable until local SDK works. Keep the exact SDK command in active context as \`waveEngineSdkCacheCommandCached\`. Use local skill onion retrieval: \`list_wave_skill_families\` -> choose family ids -> \`query_wave_skills\` with \`families\`/\`familyId\` -> \`get_wave_skill\` -> \`query_wave_api\` only for exact signature/global/value uncertainty. HTTP Gateway is not an API lookup fallback.`,
44884
44897
  "",
44885
44898
  "Mandatory phased handshake:",
44886
- "Phase 0 WaveEngine Agent SDK preflight is not optional. Do these phases in order before user work: 1 initialize endpoint; 2 call `self_check_wave_mcp` with the exact `expectedVersion` and `expectedBuildHash` from Copy-to-Agent; hard-stop if stale/hardStop is true or tool count/hash looks missing, then restart the SDK command from the copy block and retry; 2a when status is unclear, call `get_wave_mcp_health`/`mcp_status` to read endpoint/SDK/tool/SDK/session state; 3 call `get_wave_agent_onboarding` and cache Priority 1 rules in active context; 4 call `accept_wave_agent_onboarding` with acceptedRole true, current promptVersion/promptHash, all required cachedSections, full intentKindsCached list, exact waveEngineSdkCacheCommandCached template, and every context-cache confirmation true; if it returns `wave_engine_sdk_cache_not_ready`, update/restart SDK or run the bundled SDK repair command and retry accept; if local SDK cannot work, explicitly accept Studio-ops-only fallback and do not do unfamiliar API authoring; 5 call `tools/list` and prefer concrete tool names from the returned catalog; 6 call `get_wave_session`; 7 call `list_wave_files`; 8 if the tool menu is unclear, call `get_wave_tool_map`. Observe tools such as file reads, assets, diagnostics, screenshots, snapshots, performance, and markers stay open. Operate tools such as run preview, hot reload, save/share/rename/open/new project, VFS create/rename/delete, and asset upload/rename/delete are direct Studio commands when the user asks for that operation. Author/Diagnose tools such as `query_wave_api`, `edit_wave_file`, `apply_wave_patch`, and code behavior changes use `start_wave_task`. After startup, report phase status briefly. If a required phase fails or any later MCP state is unclear, call `get_wave_mcp_health` for state and `recover_wave_connection({ lastErrorCode?, failedTool?, symptom? })` for nextAction before asking user for a fresh copy; do not skip ahead.",
44899
+ `Phase 0 WaveEngine Agent SDK preflight is not optional. Do these phases in order before user work: 1 initialize endpoint; 2 call \`self_check_wave_mcp\` with the exact \`expectedVersion\` and \`expectedBuildHash\` from Copy-to-Agent; hard-stop if stale/hardStop is true or tool count/hash looks missing, then restart SDK while preserving the copied MCP_TOKEN/local pairing secret with \`${WAVE3D_AGENT_SDK_TOKEN_PRESERVING_START_COMMAND}\` using the current MCP_TOKEN value hidden; same-machine HTTP Gateway is degraded fallback only after SDK cannot run, update, or adopt, never because Gateway is familiar/easier; 2a when status is unclear, call \`get_wave_mcp_health\`/\`mcp_status\` to read endpoint/SDK/tool/SDK/session state; 3 call \`get_wave_agent_onboarding\` and cache Priority 1 rules in active context; 4 call \`accept_wave_agent_onboarding\` with acceptedRole true, current promptVersion/promptHash, all required cachedSections, full intentKindsCached list, exact waveEngineSdkCacheCommandCached template, and every context-cache confirmation true; if it returns \`wave_engine_sdk_cache_not_ready\`, update/restart SDK or run the bundled SDK repair command and retry accept; if local SDK cannot work, explicitly accept Studio-ops-only fallback and do not do unfamiliar API authoring; 5 call \`tools/list\` and prefer concrete tool names from the returned catalog; 6 call \`get_wave_session\`; 7 call \`list_wave_files\`; 8 if the tool menu is unclear, call \`get_wave_tool_map\`. Observe tools such as file reads, assets, diagnostics, screenshots, snapshots, performance, and markers stay open. Operate tools such as run preview, hot reload, save/share/rename/open/new project, VFS create/rename/delete, and asset upload/rename/delete are direct Studio commands when the user asks for that operation. Author/Diagnose tools such as \`query_wave_api\`, \`edit_wave_file\`, \`apply_wave_patch\`, and code behavior changes use \`start_wave_task\`. After startup, report phase status briefly. If a required phase fails or any later MCP state is unclear, call \`get_wave_mcp_health\` for state and \`recover_wave_connection({ lastErrorCode?, failedTool?, symptom? })\` for nextAction before asking user for a fresh copy; do not skip ahead.`,
44887
44900
  "Tool-name tolerance: concrete names from tools/list remain preferred. Common aliases and safe high-confidence typos are tolerated. Destructive/write fuzzy matches return did-you-mean instead of executing.",
44888
- "Glossary: WaveEngine Agent SDK = same-machine live MCP transport plus bundled SDK lookup; HTTP Gateway = Next/Vercel MCP transport for remote/sandbox Studio ops; WaveEngine SDK Cache = package-bundled public docs/API/skill retrieval; MCP Session = browser pairing/token state; VFS Mirror = HTTP Gateway read/edit hash snapshot; Project = user workspace content. Do not merge these concepts.",
44901
+ "Glossary: WaveEngine Agent SDK = same-machine live MCP transport plus bundled SDK lookup; Local Pairing Secret = MCP_TOKEN on localhost, not account/cloud auth; HTTP Gateway Bearer = MCP_TOKEN on HTTP Gateway; WaveEngine SDK Cache = package-bundled public docs/API/skill retrieval; MCP Session = browser pairing state; VFS Mirror = HTTP Gateway read/edit hash snapshot; Project = user workspace content. Do not merge these concepts.",
44889
44902
  "",
44890
44903
  "Required workflow:",
44891
44904
  '1. Use the MECE work-mode split before choosing tools. Observe = read/inspect/answer only, so call open read tools directly. Operate = direct Studio command with no code/design choice, so call the concrete Studio tool directly without `start_wave_task`: run preview, hot reload, save/share, create/delete/rename exact files/assets, upload assets, new project, project rename, or open project by exact projectId. Author = create/change Wave behavior/content through code/API, so call `start_wave_task`, gather evidence, optionally fast-start execute with `nextPhase:"execute"` plus editPlan, then edit. For exact one-file line/text edits, `edit_wave_file` can run immediately after `start_wave_task` when it has exact path plus `startLine`/`endLine`/`text`, `edits:[{startLine,endLine,text}]`, or `oldText`/`newText`; use this for trivial deletes/renames instead of a separate advance call. Diagnose = find root cause first, observe/read first, then transition to Operate or Author only when cause and action are clear. General = not concrete Wave work; use `agent.general`. `query_wave_api`, `edit_wave_file`, `apply_wave_patch`, and semantic/direct code edits are Author/Diagnose tools and remain route-bound. For direct Operate delete/rename/open, exact target is required: project names must be resolved with `list_wave_projects` before `rename_wave_project` or `open_wave_project`; vague file/asset targets require list/read or asking.',
@@ -44907,7 +44920,7 @@ var LOCAL_MCP_AGENT_ONBOARDING_PROMPT = [
44907
44920
  "",
44908
44921
  "WaveEngine Agent SDK scope:",
44909
44922
  'This endpoint mirrors the HTTP Gateway tool catalog plus local SDK session-discovery extras. Live-session Studio tools for VFS, preview, capture, runtime probes, assets, uploads, project save/share/open/new/read, and file operations run through the connected browser. Local browser-backed calls wait for the browser result directly. Only call `get_wave_command_result` when a tool result actually contains `status:"pending"` plus `requestId`; otherwise local `get_wave_command_result` exists only for catalog parity and reports that no local pending-command queue is used. Skill/API/guardrail tools read the bundled WaveEngine SDK Cache prepared by the SDK package. Do not treat SDK cache miss as local transport failure.',
44910
- "Recovery rule: `recover_wave_connection` is the first tool after `agent_onboarding_required`, `session_not_found`, `command_timeout`, `command_lease_expired`, `hosted_mcp_proxy_failed`, unclear local/HTTP Gateway fallback, or sleeping-tab symptoms. If local HTTP refuses, start/restart WaveEngine Agent SDK and retry 10 seconds. If local HTTP returns 401 but HTTP Gateway accepts the same token, SDK is stale/not adopted: restart exact SDK and retry local. If every endpoint rejects token before a tool result, ask user for fresh Copy to Agent."
44923
+ `Recovery rule: \`recover_wave_connection\` is the first tool after \`agent_onboarding_required\`, \`session_not_found\`, \`command_timeout\`, \`command_lease_expired\`, \`hosted_mcp_proxy_failed\`, unclear local/HTTP Gateway fallback, or sleeping-tab symptoms. If local HTTP refuses, start/restart WaveEngine Agent SDK and retry 10 seconds. If local HTTP returns 401 but HTTP Gateway accepts the same MCP_TOKEN, SDK is stale/not adopted: restart with \`${WAVE3D_AGENT_SDK_TOKEN_PRESERVING_START_COMMAND}\` using the current MCP_TOKEN value hidden, then retry local. If every endpoint rejects MCP_TOKEN before a tool result, ask user for fresh Copy to Agent.`
44911
44924
  ].join("\n");
44912
44925
 
44913
44926
  // ../../scripts/wavegenie-sdk/mcp/referenceTools.ts
@@ -45295,12 +45308,12 @@ function localCorpusSource(current) {
45295
45308
  };
45296
45309
  }
45297
45310
  async function inspectLocalCorpusCacheForContext(context) {
45298
- const productionBearer = context.agentToken?.startsWith(LOCAL_HOSTED_TOKEN_PREFIX) ?? false;
45311
+ const productionGatewayPairing = context.agentToken?.startsWith(LOCAL_HOSTED_TOKEN_PREFIX) ?? false;
45299
45312
  const current = await readLocalCorpusCurrent();
45300
45313
  const cacheRoot = getLocalCorpusCacheRoot();
45301
45314
  if (current) {
45302
45315
  return {
45303
- required: productionBearer,
45316
+ required: productionGatewayPairing,
45304
45317
  ready: true,
45305
45318
  exists: true,
45306
45319
  verification: "package_bundled_sdk_cache_verified_on_disk",
@@ -45309,11 +45322,11 @@ async function inspectLocalCorpusCacheForContext(context) {
45309
45322
  };
45310
45323
  }
45311
45324
  return {
45312
- required: productionBearer,
45325
+ required: productionGatewayPairing,
45313
45326
  ready: false,
45314
45327
  exists: false,
45315
- errorCode: productionBearer ? "wave_engine_sdk_cache_not_ready" : "wave_engine_sdk_cache_missing",
45316
- message: productionBearer ? "No verified local WaveEngine SDK Cache exists. Update/restart SDK or run bundled SDK repair before normal production onboarding success, or explicitly accept degraded Studio-ops-only fallback if local SDK cannot work." : "No local WaveEngine SDK Cache exists. Live Studio tools can still work; run bundled SDK repair before unfamiliar skill/API lookup.",
45328
+ errorCode: productionGatewayPairing ? "wave_engine_sdk_cache_not_ready" : "wave_engine_sdk_cache_missing",
45329
+ message: productionGatewayPairing ? "No verified local WaveEngine SDK Cache exists. Update/restart SDK or run bundled SDK repair before normal production onboarding success, or explicitly accept degraded Studio-ops-only fallback if local SDK cannot work." : "No local WaveEngine SDK Cache exists. Live Studio tools can still work; run bundled SDK repair before unfamiliar skill/API lookup.",
45317
45330
  cacheRoot,
45318
45331
  commandTemplate: WAVE_MCP_CORPUS_CACHE_COMMAND_TEMPLATE
45319
45332
  };
@@ -45740,21 +45753,21 @@ async function ensureLocalCorpusCurrent(context) {
45740
45753
  return await readLocalCorpusCurrent();
45741
45754
  }
45742
45755
  async function prepareLocalCorpusForOnboarding(context) {
45743
- const productionBearer = context.agentToken?.startsWith(LOCAL_HOSTED_TOKEN_PREFIX) ?? false;
45756
+ const productionGatewayPairing = context.agentToken?.startsWith(LOCAL_HOSTED_TOKEN_PREFIX) ?? false;
45744
45757
  const current = await ensureLocalCorpusCurrent(context);
45745
45758
  if (current) {
45746
45759
  return {
45747
- required: productionBearer,
45760
+ required: productionGatewayPairing,
45748
45761
  ready: true,
45749
45762
  verification: "package_bundled_sdk_cache_verified_on_disk",
45750
45763
  ...localCorpusSource(current)
45751
45764
  };
45752
45765
  }
45753
45766
  return {
45754
- required: productionBearer,
45767
+ required: productionGatewayPairing,
45755
45768
  ready: false,
45756
45769
  errorCode: "wave_engine_sdk_cache_not_ready",
45757
- message: productionBearer ? "Production HTTP-Gateway bearer requires local WaveEngine SDK Cache before onboarding can be accepted." : "Local-only/dev bearer has no current WaveEngine SDK Cache; live Studio tools can work, but unfamiliar skill/API lookup needs bundled SDK repair.",
45770
+ message: productionGatewayPairing ? "Production HTTP Gateway pairing requires local WaveEngine SDK Cache before onboarding can be accepted." : "Local-only/dev pairing has no current WaveEngine SDK Cache; live Studio tools can work, but unfamiliar skill/API lookup needs bundled SDK repair.",
45758
45771
  cacheRoot: getLocalCorpusCacheRoot(),
45759
45772
  commandTemplate: WAVE_MCP_CORPUS_CACHE_COMMAND_TEMPLATE
45760
45773
  };
@@ -47984,7 +47997,7 @@ function buildHostedWaveStudioMcpToolDefinitions() {
47984
47997
  },
47985
47998
  {
47986
47999
  name: "advance_wave_task",
47987
- description: "[studio.mcp] Advance an Author/Diagnose task route after evidence is gathered. taskRouteId is recommended, but if omitted Studio uses this agent token\u2019s active route and still enforces phase/intent checks; routeId and nested route.taskRouteId/id are accepted. Phase aliases targetPhase and phase are accepted. Use before query_wave_api (lookup), broad authoring edits/apply_patch (execute), and final route verification. Do not advance just to run direct Operate tools such as run_wave_preview, hot_reload_wave_preview, save_wave_project, or create_wave_file when the user asked for that operation directly. Fast-lane direct/semantic code routes can skip lookup and advance straight to execute when exact user wording or current code is enough. This is the checkpoint that prevents jump-to-API/jump-to-edit behavior.",
48000
+ description: "[studio.mcp] Advance an Author/Diagnose task route after evidence is gathered. taskRouteId is recommended, but if omitted Studio uses this MCP session\u2019s active route and still enforces phase/intent checks; routeId and nested route.taskRouteId/id are accepted. Phase aliases targetPhase and phase are accepted. Use before query_wave_api (lookup), broad authoring edits/apply_patch (execute), and final route verification. Do not advance just to run direct Operate tools such as run_wave_preview, hot_reload_wave_preview, save_wave_project, or create_wave_file when the user asked for that operation directly. Fast-lane direct/semantic code routes can skip lookup and advance straight to execute when exact user wording or current code is enough. This is the checkpoint that prevents jump-to-API/jump-to-edit behavior.",
47988
48001
  inputSchema: {
47989
48002
  type: "object",
47990
48003
  properties: {
@@ -48074,7 +48087,7 @@ function buildHostedWaveStudioMcpToolDefinitions() {
48074
48087
  },
48075
48088
  {
48076
48089
  name: "get_wave_task_route",
48077
- description: "[studio.mcp] Return the current Wave Agent Behavior Harness route, phase, evidence, and currently unlocked tool families for this agent token. taskRouteId is optional; routeId aliases are accepted by routed tools.",
48090
+ description: "[studio.mcp] Return the current Wave Agent Behavior Harness route, phase, evidence, and currently unlocked tool families for this MCP session. taskRouteId is optional; routeId aliases are accepted by routed tools.",
48078
48091
  inputSchema: {
48079
48092
  type: "object",
48080
48093
  properties: {
@@ -49180,7 +49193,17 @@ function buildHostedWaveStudioMcpToolDefinitions() {
49180
49193
  inputSchema: {
49181
49194
  type: "object",
49182
49195
  properties: {
49183
- idempotencyKey: { type: "string" }
49196
+ idempotencyKey: { type: "string" },
49197
+ awaitRuntimeResult: {
49198
+ type: "boolean",
49199
+ description: "When true, wait in the same MCP call for bounded runtime diagnostics after the hot-reload request. Response includes runtimeVerification."
49200
+ },
49201
+ awaitDiagnostics: {
49202
+ type: "boolean",
49203
+ description: "Alias of awaitRuntimeResult."
49204
+ },
49205
+ runtimeDiagnosticsTimeoutMs: { type: "number", minimum: 500, maximum: 15e3 },
49206
+ runtimeDiagnosticsLimit: { type: "number", minimum: 1, maximum: 500 }
49184
49207
  },
49185
49208
  additionalProperties: false
49186
49209
  }
@@ -49188,6 +49211,38 @@ function buildHostedWaveStudioMcpToolDefinitions() {
49188
49211
  {
49189
49212
  name: "run_wave_preview",
49190
49213
  description: `[studio.preview] Trigger a full Wave Studio preview run/start through the paired browser session. Natural-language aliases: run project, start preview, start project, full restart, restart scene, kick the scene again. Do not use this as the normal post-edit path; use edit-tool awaitHotReload:true after edits or standalone hot_reload_wave_preview for preview refresh first. Use run only when diagnostics show hasRunSucceeded false, the user explicitly asks for a full restart, or hot reload/polling fails and a full restart is the last resort. This tool confirms the request was accepted, not that runtime execution has finished; use returned requestedAt and poll diagnostics until lastRuntimeOutcomeAt is newer and lastRuntimeOutcome is success or error, then inspect latestError/screenshot/entity snapshots.${WRITE_PAIRING_REQUIRED_NOTE}${BROWSER_COMMAND_PENDING_NOTE}`,
49214
+ inputSchema: {
49215
+ type: "object",
49216
+ properties: {
49217
+ idempotencyKey: { type: "string" },
49218
+ awaitRuntimeResult: {
49219
+ type: "boolean",
49220
+ description: "When true, wait in the same MCP call for bounded runtime diagnostics after the run request. Response includes runtimeVerification."
49221
+ },
49222
+ awaitDiagnostics: {
49223
+ type: "boolean",
49224
+ description: "Alias of awaitRuntimeResult."
49225
+ },
49226
+ runtimeDiagnosticsTimeoutMs: { type: "number", minimum: 500, maximum: 15e3 },
49227
+ runtimeDiagnosticsLimit: { type: "number", minimum: 1, maximum: 500 }
49228
+ },
49229
+ additionalProperties: false
49230
+ }
49231
+ },
49232
+ {
49233
+ name: "pause_wave_preview",
49234
+ description: `[studio.preview] Pause the running Wave Studio preview/engine through the paired browser session. Natural-language aliases: pause engine, pause preview, freeze preview. Direct Operate tool; no start_wave_task needed. Requires a running preview.${WRITE_PAIRING_REQUIRED_NOTE}${BROWSER_COMMAND_PENDING_NOTE}`,
49235
+ inputSchema: {
49236
+ type: "object",
49237
+ properties: {
49238
+ idempotencyKey: { type: "string" }
49239
+ },
49240
+ additionalProperties: false
49241
+ }
49242
+ },
49243
+ {
49244
+ name: "resume_wave_preview",
49245
+ description: `[studio.preview] Resume the paused Wave Studio preview/engine through the paired browser session. Natural-language aliases: resume engine, resume preview, unpause preview. Direct Operate tool; no start_wave_task needed. Requires a running preview.${WRITE_PAIRING_REQUIRED_NOTE}${BROWSER_COMMAND_PENDING_NOTE}`,
49191
49246
  inputSchema: {
49192
49247
  type: "object",
49193
49248
  properties: {
@@ -49245,6 +49300,16 @@ function buildHostedWaveStudioMcpToolDefinitions() {
49245
49300
  canonicalName: "run_wave_preview",
49246
49301
  description: `[studio.preview] Alias of run_wave_preview for natural "run project" requests. Use for first start, explicit full restart, or last-resort recovery after hot reload fails/stalls.${WRITE_PAIRING_REQUIRED_NOTE}${BROWSER_COMMAND_PENDING_NOTE}`
49247
49302
  }),
49303
+ aliasToolDefinition(definitions, {
49304
+ name: "pause_wave_engine",
49305
+ canonicalName: "pause_wave_preview",
49306
+ description: `[studio.preview] Alias of pause_wave_preview for "pause engine" requests.${WRITE_PAIRING_REQUIRED_NOTE}${BROWSER_COMMAND_PENDING_NOTE}`
49307
+ }),
49308
+ aliasToolDefinition(definitions, {
49309
+ name: "resume_wave_engine",
49310
+ canonicalName: "resume_wave_preview",
49311
+ description: `[studio.preview] Alias of resume_wave_preview for "resume engine" requests.${WRITE_PAIRING_REQUIRED_NOTE}${BROWSER_COMMAND_PENDING_NOTE}`
49312
+ }),
49248
49313
  aliasToolDefinition(definitions, {
49249
49314
  name: "mcp_health",
49250
49315
  canonicalName: "get_wave_mcp_health",
@@ -49328,13 +49393,17 @@ var LOCAL_OPTIONAL_SESSION_TOOL_NAMES = /* @__PURE__ */ new Set([
49328
49393
  "hot_reload_wave_preview",
49329
49394
  "hotreload_wave_preview",
49330
49395
  "run_wave_preview",
49331
- "run_project"
49396
+ "run_project",
49397
+ "pause_wave_preview",
49398
+ "pause_wave_engine",
49399
+ "resume_wave_preview",
49400
+ "resume_wave_engine"
49332
49401
  ]);
49333
49402
  function getReadToolDefinitions() {
49334
49403
  return [
49335
49404
  {
49336
49405
  name: "self_check_wave_mcp",
49337
- description: "Run first local-SDK self-check. Pass expectedVersion and expectedBuildHash exactly from the Copy-to-Agent message; without external expected values a stale SDK can only compare against itself. Verifies SDK version/build, tool catalog hash/count, paired session count, and route-evidence health. If stale/hardStop is true, restart the exact SDK command from Copy to Agent before doing user work.",
49406
+ description: `Run first local-SDK self-check. Pass expectedVersion and expectedBuildHash exactly from the Copy-to-Agent message; without external expected values a stale SDK can only compare against itself. Verifies SDK version/build, tool catalog hash/count, paired session count, and route-evidence health. If stale/hardStop is true, restart SDK with the copied MCP_TOKEN/local pairing secret preserved via ${WAVE3D_AGENT_SDK_TOKEN_PRESERVING_START_COMMAND} before doing user work.`,
49338
49407
  inputSchema: {
49339
49408
  type: "object",
49340
49409
  properties: {
@@ -49362,7 +49431,7 @@ function getReadToolDefinitions() {
49362
49431
  },
49363
49432
  {
49364
49433
  name: "accept_wave_agent_onboarding",
49365
- description: "Acknowledge that the agent has read and cached the current Wave Studio local MCP onboarding prompt before using normal tools. Call only after keeping coding guardrails, full intent taxonomy, authoring workflow, and Studio tool policy in active LLM context. Production bearers require bundled WaveEngine SDK Cache proof/preparation before normal cached success; if SDK cache cannot work, explicitly pass degraded Studio-ops-only fallback fields and warn user exact API lookup needs local SDK repair.",
49434
+ description: "Acknowledge that the agent has read and cached the current Wave Studio local MCP onboarding prompt before using normal tools. Call only after keeping coding guardrails, full intent taxonomy, authoring workflow, and Studio tool policy in active LLM context. Production HTTP Gateway pairing requires bundled WaveEngine SDK Cache proof/preparation before normal cached success; if SDK cache cannot work, explicitly pass degraded Studio-ops-only fallback fields and warn user exact API lookup needs local SDK repair.",
49366
49435
  inputSchema: {
49367
49436
  type: "object",
49368
49437
  properties: {
@@ -49725,24 +49794,24 @@ function localConnectionRecoveryResult(args, context) {
49725
49794
  let requiresUserAction = false;
49726
49795
  if (!onboardingAccepted || lastErrorCode === "agent_onboarding_required") {
49727
49796
  state = "needs_onboarding";
49728
- nextAction = "Re-run onboarding on this same local endpoint/token: get_wave_agent_onboarding, accept_wave_agent_onboarding, tools/list, get_wave_session.";
49797
+ nextAction = "Re-run onboarding on this same local endpoint and MCP_TOKEN pairing secret: get_wave_agent_onboarding, accept_wave_agent_onboarding, tools/list, get_wave_session.";
49729
49798
  nextTool = "get_wave_agent_onboarding";
49730
49799
  steps.push("Do not ask user for new Copy to Agent unless local HTTP auth fails.");
49731
49800
  } else if (sessions.length === 0 || lastErrorCode === "session_not_found") {
49732
49801
  state = "no_paired_studio_tab";
49733
- nextAction = "WaveEngine Agent SDK HTTP is alive, but no Wave Studio tab is paired with this token. Ask user to wake/reopen Wave Studio, open Room -> MCP, and let it adopt this same local session/token; then call get_wave_session again.";
49802
+ nextAction = "WaveEngine Agent SDK HTTP is alive, but no Wave Studio tab is paired with this MCP_TOKEN local secret. Ask user to wake/reopen Wave Studio, open Room -> MCP, and let it adopt this same local session secret; then call get_wave_session again.";
49734
49803
  nextTool = "get_wave_session";
49735
49804
  requiresUserAction = true;
49736
49805
  steps.push("Do not switch to SDK cache or query tools as a transport fix.");
49737
49806
  } else if (lastErrorCode === "command_timeout" || lastErrorCode === "command_lease_expired" || symptom.toLowerCase().includes("hang") || symptom.toLowerCase().includes("timeout") || !selectedSessionReady) {
49738
49807
  state = "browser_tab_not_polling";
49739
- nextAction = "Wave Studio tab is paired but not actively polling commands, or browser-backed command timed out. Ask user to focus/wake the tab and verify MCP is live; retry the same tool once on the same local endpoint/token.";
49808
+ nextAction = "Wave Studio tab is paired but not actively polling commands, or browser-backed command timed out. Ask user to focus/wake the tab and verify MCP is live; retry the same tool once on the same local endpoint and MCP_TOKEN pairing secret.";
49740
49809
  nextTool = failedTool || "get_wave_session";
49741
49810
  requiresUserAction = true;
49742
- steps.push(`If SDK /health is down or stale, restart \`${WAVE3D_AGENT_SDK_START_COMMAND}\`; if /health is OK and version matches Copy to Agent, do not restart SDK first.`);
49811
+ steps.push(`If SDK /health is down before pairing, start \`${WAVE3D_AGENT_SDK_START_COMMAND}\`; after Copy-to-Agent, restart stale SDK with \`${WAVE3D_AGENT_SDK_TOKEN_PRESERVING_START_COMMAND}\` using the current MCP_TOKEN value hidden. If /health is OK and version matches Copy to Agent, do not restart SDK first.`);
49743
49812
  } else if (lastErrorCode === "session_write_not_allowed" || selectedSession?.accessMode !== "readwrite") {
49744
49813
  state = "write_access_not_ready";
49745
- nextAction = "Read tools can continue. For write/run/hot reload, user must make the Studio MCP session read-write/adopt WaveEngine Agent SDK, then retry same local endpoint/token or paste fresh Copy to Agent if token changed.";
49814
+ nextAction = "Read tools can continue. For write/run/hot reload, user must make the Studio MCP session read-write/adopt WaveEngine Agent SDK, then retry same local endpoint and MCP_TOKEN pairing secret or paste fresh Copy to Agent if the secret changed.";
49746
49815
  nextTool = "get_wave_session";
49747
49816
  requiresUserAction = true;
49748
49817
  } else if (lastErrorCode === "hosted_mcp_proxy_failed" || lastErrorCode === "wave_engine_sdk_cache_required") {
@@ -49794,8 +49863,8 @@ function localConnectionRecoveryResult(args, context) {
49794
49863
  steps,
49795
49864
  hardStopRules: [
49796
49865
  "Local HTTP refused/unreachable before MCP response: start WaveEngine Agent SDK, retry localhost for up to 10 seconds.",
49797
- "Local HTTP 401/bridge_auth_invalid: if HTTP Gateway accepts the same token, SDK is stale/not adopted: restart exact WaveEngine Agent SDK and retry local. If every endpoint rejects the token, ask user for fresh Copy to Agent.",
49798
- "No paired session or stale command poll: wake/reopen Wave Studio tab; keep same local endpoint/token first.",
49866
+ "Local HTTP 401/bridge_auth_invalid: if HTTP Gateway accepts the same MCP_TOKEN, SDK is stale/not adopted: restart exact WaveEngine Agent SDK so it adopts MCP_TOKEN as the local pairing secret, then retry local. If every endpoint rejects MCP_TOKEN, ask user for fresh Copy to Agent.",
49867
+ "No paired session or stale command poll: wake/reopen Wave Studio tab; keep same local endpoint and MCP_TOKEN pairing secret first.",
49799
49868
  "WaveEngine SDK Cache failure is not live transport failure."
49800
49869
  ]
49801
49870
  });
@@ -49843,7 +49912,7 @@ function localAuthoringReminderKindForToolName(toolName) {
49843
49912
  if (canonicalToolName === "edit_wave_file" || canonicalToolName === "create_wave_file" || canonicalToolName === "rename_wave_file" || canonicalToolName === "delete_wave_file" || canonicalToolName === "apply_wave_patch") {
49844
49913
  return "codeEdit";
49845
49914
  }
49846
- if (canonicalToolName === "get_wave_runtime_diagnostics" || canonicalToolName === "get_wave_runtime_performance_snapshot" || canonicalToolName === "hot_reload_wave_preview" || canonicalToolName === "run_wave_preview" || canonicalToolName === "capture_wave_screenshot" || canonicalToolName === "get_wave_runtime_entity_snapshot" || canonicalToolName === "list_wave_runtime_markers") return "preview";
49915
+ if (canonicalToolName === "get_wave_runtime_diagnostics" || canonicalToolName === "get_wave_runtime_performance_snapshot" || canonicalToolName === "hot_reload_wave_preview" || canonicalToolName === "run_wave_preview" || canonicalToolName === "pause_wave_preview" || canonicalToolName === "resume_wave_preview" || canonicalToolName === "capture_wave_screenshot" || canonicalToolName === "get_wave_runtime_entity_snapshot" || canonicalToolName === "list_wave_runtime_markers") return "preview";
49847
49916
  return "studio";
49848
49917
  }
49849
49918
  function attachAuthoringReminder(result, kind) {
@@ -49915,6 +49984,11 @@ function normalizeRuntimeDiagnosticsLimit(value) {
49915
49984
  if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
49916
49985
  return Math.min(Math.max(1, Math.trunc(value)), 500);
49917
49986
  }
49987
+ function normalizeRuntimeDiagnosticsTimeoutMs2(value) {
49988
+ if (typeof value === "undefined") return void 0;
49989
+ if (typeof value !== "number" || !Number.isFinite(value)) return void 0;
49990
+ return Math.min(Math.max(500, Math.trunc(value)), 15e3);
49991
+ }
49918
49992
  function resolveAssetCategoryBucket(value) {
49919
49993
  if (typeof value !== "string" || !value.trim()) return null;
49920
49994
  return getWaveStudioAssetBucketFromCategory(value.trim());
@@ -50079,7 +50153,7 @@ async function callReadTool(name, args, context) {
50079
50153
  { phase: 0, required: false, action: "WaveEngine Agent SDK preflight", fallback: "Already satisfied because this endpoint is local." },
50080
50154
  { phase: 1, required: true, action: "initialize", fallback: null },
50081
50155
  { phase: 2, required: true, action: "get_wave_agent_onboarding", fallback: null },
50082
- { phase: 3, required: true, action: "accept_wave_agent_onboarding; this verifies bundled WaveEngine SDK Cache before success when using production HTTP-Gateway bearer", fallback: "If SDK cache cannot prepare, accept returns wave_engine_sdk_cache_not_ready; update/restart SDK or explicitly accept degraded Studio-ops-only fallback only when local SDK cannot work." },
50156
+ { phase: 3, required: true, action: "accept_wave_agent_onboarding; this verifies bundled WaveEngine SDK Cache before success when using production HTTP Gateway pairing", fallback: "If SDK cache cannot prepare, accept returns wave_engine_sdk_cache_not_ready; update/restart SDK or explicitly accept degraded Studio-ops-only fallback only when local SDK cannot work." },
50083
50157
  { phase: 4, required: true, action: "tools/list", fallback: null },
50084
50158
  { phase: 5, required: true, action: "get_wave_session", fallback: null },
50085
50159
  { phase: 6, required: true, action: "list_wave_files", fallback: null },
@@ -50157,7 +50231,7 @@ async function callReadTool(name, args, context) {
50157
50231
  return successToolResult({
50158
50232
  ok: true,
50159
50233
  accepted: true,
50160
- statusMessage: waveEngineSdkCache.ready === true ? "Wave Studio authoring role accepted and bundled WaveEngine SDK Cache verified. Copy-to-Agent was bootstrap only; this ready summary is now the source of truth. Next: tools/list, get_wave_session, and list_wave_files." : sdkFallbackAccepted ? "Wave Studio authoring role accepted in degraded Studio-ops-only mode. WaveEngine SDK Cache is unavailable; warn user that exact API lookup needs local SDK repair." : "Wave Studio authoring role accepted for local-only/dev bearer. WaveEngine SDK Cache is not ready; live Studio tools can work, but unfamiliar skill/API lookup needs SDK repair.",
50234
+ statusMessage: waveEngineSdkCache.ready === true ? "Wave Studio authoring role accepted and bundled WaveEngine SDK Cache verified. Copy-to-Agent was bootstrap only; this ready summary is now the source of truth. Next: tools/list, get_wave_session, and list_wave_files." : sdkFallbackAccepted ? "Wave Studio authoring role accepted in degraded Studio-ops-only mode. WaveEngine SDK Cache is unavailable; warn user that exact API lookup needs local SDK repair." : "Wave Studio authoring role accepted for local-only/dev pairing secret. WaveEngine SDK Cache is not ready; live Studio tools can work, but unfamiliar skill/API lookup needs SDK repair.",
50161
50235
  promptVersion,
50162
50236
  promptHash,
50163
50237
  localSdk: true,
@@ -50199,7 +50273,7 @@ async function callReadTool(name, args, context) {
50199
50273
  const taskRouteId = readWaveMcpTaskRouteId(args);
50200
50274
  const route = getLocalActiveTaskRoute(context);
50201
50275
  if (!route || taskRouteId && route.taskRouteId !== taskRouteId) {
50202
- return taskRouteErrorToolResult("task_route_not_found", "Call start_wave_task first. taskRouteId may be omitted when the active route belongs to this local token.", {
50276
+ return taskRouteErrorToolResult("task_route_not_found", "Call start_wave_task first. taskRouteId may be omitted when the active route belongs to this local MCP_TOKEN pairing secret.", {
50203
50277
  taskRouteId: taskRouteId || null
50204
50278
  });
50205
50279
  }
@@ -50218,7 +50292,7 @@ async function callReadTool(name, args, context) {
50218
50292
  const taskRouteId = readWaveMcpTaskRouteId(args);
50219
50293
  const route = getLocalActiveTaskRoute(context);
50220
50294
  if (!route || taskRouteId && route.taskRouteId !== taskRouteId) {
50221
- return taskRouteErrorToolResult("task_route_not_found", "No active Wave task route found for this agent token. Call start_wave_task for the user request.", {
50295
+ return taskRouteErrorToolResult("task_route_not_found", "No active Wave task route found for this MCP session. Call start_wave_task for the user request.", {
50222
50296
  taskRouteId: taskRouteId || null,
50223
50297
  activeTaskRouteId: route?.taskRouteId ?? null,
50224
50298
  activeTaskPhase: route?.phase ?? null
@@ -50255,6 +50329,7 @@ async function callReadTool(name, args, context) {
50255
50329
  hash: getLocalToolCatalogHash(),
50256
50330
  hasEdit: toolDefinitions.some((definition) => definition.name === "edit_wave_file"),
50257
50331
  hasHotReload: toolDefinitions.some((definition) => definition.name === "hot_reload_wave_preview"),
50332
+ hasPauseResume: toolDefinitions.some((definition) => definition.name === "pause_wave_preview") && toolDefinitions.some((definition) => definition.name === "resume_wave_preview"),
50258
50333
  hasAssetCategorySearch: toolDefinitions.some((definition) => definition.name === "find_wave_assets_by_category"),
50259
50334
  hasProjectRename: toolDefinitions.some((definition) => definition.name === "rename_wave_project")
50260
50335
  },
@@ -50266,7 +50341,7 @@ async function callReadTool(name, args, context) {
50266
50341
  taskRouteId: activeRoute.taskRouteId,
50267
50342
  phase: activeRoute.phase
50268
50343
  } : null,
50269
- nextAction: !stale ? "Agent SDK version/build/tool catalog look current. Continue with get_wave_session and list_wave_files." : externalExpectedProvided ? `Agent SDK is stale. Stop it and restart with: ${WAVE3D_AGENT_SDK_START_COMMAND}` : "Self-check needs expectedVersion and expectedBuildHash from the Copy-to-Agent message; rerun self_check_wave_mcp with those exact values before user work.",
50344
+ nextAction: !stale ? "Agent SDK version/build/tool catalog look current. Continue with get_wave_session and list_wave_files." : externalExpectedProvided ? `Agent SDK is stale. Stop it and restart while preserving the copied MCP_TOKEN/local pairing secret: ${WAVE3D_AGENT_SDK_TOKEN_PRESERVING_START_COMMAND}` : "Self-check needs expectedVersion and expectedBuildHash from the Copy-to-Agent message; rerun self_check_wave_mcp with those exact values before user work.",
50270
50345
  hardStop: stale
50271
50346
  });
50272
50347
  }
@@ -50299,11 +50374,18 @@ async function callReadTool(name, args, context) {
50299
50374
  requiredBuildHash: WAVE3D_AGENT_SDK_REQUIRED_BUILD,
50300
50375
  startCommand: WAVE3D_AGENT_SDK_START_COMMAND
50301
50376
  },
50377
+ authModel: {
50378
+ mcpTokenMeaning: context.agentToken?.startsWith("wgbt.") ? "HTTP Gateway bearer adopted locally as a same-machine SDK pairing secret." : "Same-machine SDK local pairing secret.",
50379
+ localPairingSecret: "Required for localhost MCP. It pairs this SDK process with the live Wave Studio browser tab and is not account login.",
50380
+ httpGatewayBearer: "Only meaningful against MCP_HTTP_GATEWAY_FALLBACK_URL. Same string may be adopted locally, but localhost auth remains a local pairing check.",
50381
+ accountLogin: "Wave Studio login/account state is separate from MCP_TOKEN. Do not fix local SDK auth by changing account login."
50382
+ },
50302
50383
  tools: {
50303
50384
  count: toolDefinitions.length,
50304
50385
  hash: getLocalToolCatalogHash(),
50305
50386
  hasEdit: toolDefinitions.some((definition) => definition.name === "edit_wave_file"),
50306
50387
  hasHotReload: toolDefinitions.some((definition) => definition.name === "hot_reload_wave_preview"),
50388
+ hasPauseResume: toolDefinitions.some((definition) => definition.name === "pause_wave_preview") && toolDefinitions.some((definition) => definition.name === "resume_wave_preview"),
50307
50389
  hasAssetCategorySearch: toolDefinitions.some((definition) => definition.name === "find_wave_assets_by_category"),
50308
50390
  hasMcpHealth: toolDefinitions.some((definition) => definition.name === "get_wave_mcp_health"),
50309
50391
  hasProjectRename: toolDefinitions.some((definition) => definition.name === "rename_wave_project")
@@ -50349,7 +50431,7 @@ async function callReadTool(name, args, context) {
50349
50431
  "studio.vfs: list_wave_files, read_wave_file, edit_wave_file, apply_wave_patch, create_wave_file, rename_wave_file, delete_wave_file",
50350
50432
  "studio.assets: find_wave_assets_by_category (aliases: list_wave_assets_by_category, search_wave_assets_by_category, list_wave_assets), list_wave_explorer_assets, upload/stage/commit/abort asset tools, rename_wave_asset, delete_wave_asset",
50351
50433
  "studio.project: list_wave_project_templates, new_wave_project, list_wave_projects, read_wave_project, rename_wave_project, open_wave_project, save_wave_project, share_wave_project",
50352
- "studio.preview: hot_reload_wave_preview (alias: hotreload_wave_preview), run_wave_preview (alias: run_project), get_wave_runtime_diagnostics (alias: get_wave_errors), get_wave_runtime_performance_snapshot (alias: get_wave_runtime_performance)",
50434
+ "studio.preview: hot_reload_wave_preview (alias: hotreload_wave_preview), run_wave_preview (alias: run_project), pause_wave_preview (alias: pause_wave_engine), resume_wave_preview (alias: resume_wave_engine), get_wave_runtime_diagnostics (alias: get_wave_errors), get_wave_runtime_performance_snapshot (alias: get_wave_runtime_performance)",
50353
50435
  "studio.capture: capture_wave_screenshot (alias: get_wave_screenshot), get_wave_runtime_entity_snapshot (alias: get_wave_entity_snapshot), list_wave_runtime_markers (alias: list_wave_markers)",
50354
50436
  "wave.authoring: list_wave_skill_families, query_wave_skills, get_wave_skill, query_wave_api"
50355
50437
  ],
@@ -50426,7 +50508,7 @@ async function callReadTool(name, args, context) {
50426
50508
  ok: true,
50427
50509
  bridgeId: context.bridgeId,
50428
50510
  selectionBasis: sessionId ? "explicitSessionId" : pinnedSessionIdBeforeResolve ? "agentTokenPinnedSession" : "resolvedTargetPinnedOnce",
50429
- tokenMode: context.agentToken?.startsWith("wgbt.") ? "hostedGatewayBearerAdopted" : "localHelperBearer",
50511
+ tokenMode: context.agentToken?.startsWith("wgbt.") ? "hostedGatewayBearerAdopted" : "localPairingSecret",
50430
50512
  pinnedSessionId: getLocalPinnedSessionId(context),
50431
50513
  session: summarizeSession(session)
50432
50514
  });
@@ -50481,15 +50563,21 @@ async function callReadTool(name, args, context) {
50481
50563
  return errorToolResult("command_timeout", error instanceof Error ? error.message : "WaveEngine Agent SDK runtime performance snapshot timed out.");
50482
50564
  }
50483
50565
  }
50484
- if (name === "hot_reload_wave_preview" || name === "run_wave_preview") {
50566
+ if (name === "hot_reload_wave_preview" || name === "run_wave_preview" || name === "pause_wave_preview" || name === "resume_wave_preview") {
50485
50567
  const sessionResult = resolveWritableSession(args, context);
50486
50568
  if ("result" in sessionResult) return sessionResult.result;
50569
+ const action = name === "run_wave_preview" ? "run" : name === "pause_wave_preview" ? "pause" : name === "resume_wave_preview" ? "resume" : "hotReload";
50570
+ const runtimeDiagnosticsTimeoutMs = normalizeRuntimeDiagnosticsTimeoutMs2(args?.runtimeDiagnosticsTimeoutMs ?? args?.awaitTimeoutMs);
50571
+ const runtimeDiagnosticsLimit = normalizeRuntimeDiagnosticsLimit(args?.runtimeDiagnosticsLimit);
50487
50572
  return await enqueueBrowserCommand({
50488
50573
  context,
50489
50574
  session: sessionResult.session,
50490
50575
  command: {
50491
50576
  type: "runtimeAction",
50492
- action: name === "run_wave_preview" ? "run" : "hotReload"
50577
+ action,
50578
+ awaitRuntimeResult: args?.awaitRuntimeResult === true || args?.awaitDiagnostics === true,
50579
+ ...runtimeDiagnosticsTimeoutMs !== void 0 ? { runtimeDiagnosticsTimeoutMs } : {},
50580
+ ...runtimeDiagnosticsLimit !== void 0 ? { runtimeDiagnosticsLimit } : {}
50493
50581
  }
50494
50582
  });
50495
50583
  }
@@ -51729,6 +51817,12 @@ async function startWaveEngineAgentSdkServer(options = {}) {
51729
51817
  waveEngineSdkCache: "Package-bundled WaveEngine SDK Cache for local docs/API/skills lookup. Not transport and not a fix for live-session connectivity.",
51730
51818
  vfsMirror: "HTTP Gateway workspace snapshot for file reads/writes. Separate from WaveEngine Agent SDK live browser VFS."
51731
51819
  },
51820
+ authModel: {
51821
+ mcpTokenMeaning: "On this localhost SDK endpoint, MCP_TOKEN is a same-machine local pairing secret for a Studio browser session.",
51822
+ localPairingSecret: "Required for localhost MCP. It is random per SDK/Studio pairing and is not account login or cloud authorization.",
51823
+ httpGatewayBearer: "Only meaningful when calling an HTTP Gateway URL. A gateway bearer can be adopted by the SDK as a localhost pairing secret, but localhost auth remains local.",
51824
+ accountLogin: "Wave Studio sign-in may create an HTTP Gateway pairing, but it is separate from the local SDK pairing secret."
51825
+ },
51732
51826
  requiresAuthForSessions: true,
51733
51827
  sessionCount: registry.list().length
51734
51828
  };
@@ -51738,7 +51832,7 @@ async function startWaveEngineAgentSdkServer(options = {}) {
51738
51832
  if (method === "GET" && url.pathname === "/sessions") {
51739
51833
  const authorization = resolveAgentAuthorization(req.headers.authorization);
51740
51834
  if (!authorization) {
51741
- writeJson(res, 401, createWaveGenieError("bridge_auth_invalid", "Missing or invalid WaveEngine Agent SDK bearer token."), origin);
51835
+ writeJson(res, 401, createWaveGenieError("bridge_auth_invalid", "Missing or invalid WaveEngine Agent SDK local pairing secret."), origin);
51742
51836
  return;
51743
51837
  }
51744
51838
  const allowedSessionIds = authorization.authorizedSessionIds;
@@ -51765,7 +51859,7 @@ async function startWaveEngineAgentSdkServer(options = {}) {
51765
51859
  if (method === "POST" && url.pathname === "/mcp") {
51766
51860
  const authorization = resolveAgentAuthorization(req.headers.authorization);
51767
51861
  if (!authorization) {
51768
- writeJson(res, 401, createWaveGenieError("bridge_auth_invalid", "Missing or invalid WaveEngine Agent SDK bearer token."), origin);
51862
+ writeJson(res, 401, createWaveGenieError("bridge_auth_invalid", "Missing or invalid WaveEngine Agent SDK local pairing secret."), origin);
51769
51863
  return;
51770
51864
  }
51771
51865
  let body;
@@ -52259,11 +52353,11 @@ async function commandStart(options) {
52259
52353
  const handle = await startWaveEngineAgentSdkServer({
52260
52354
  host,
52261
52355
  port: readNumberFlag(options, "port") ?? DEFAULT_PORT2,
52262
- token: readStringFlag(options, "token"),
52356
+ token: readStringFlag(options, "token") ?? process.env.WAVE3D_MCP_TOKEN ?? process.env.WAVESTUDIO_MCP_TOKEN,
52263
52357
  sessionTtlMs: readNumberFlag(options, "session-ttl-ms")
52264
52358
  });
52265
52359
  console.log(`[WaveEngine Agent SDK] sdkId=${handle.bridgeId}`);
52266
- console.log("[WaveEngine Agent SDK] admin/MCP bearer token: hidden. Use Wave Studio Copy to Agent or WAVE3D_MCP_TOKEN; do not print bearer tokens.");
52360
+ console.log("[WaveEngine Agent SDK] admin/local MCP pairing secret: hidden. Use Wave Studio Copy to Agent or WAVE3D_MCP_TOKEN; do not print MCP_TOKEN values.");
52267
52361
  console.log(`[WaveEngine Agent SDK] MCP endpoint: http://${handle.host}:${handle.port}/mcp`);
52268
52362
  console.log("[WaveEngine Agent SDK] Live Studio tools also require a paired Wave Studio browser tab. Start/copy from the MCP orb, then call get_wave_session.");
52269
52363
  console.log(`[WaveEngine Agent SDK] WaveEngine SDK cache root: ${getCacheRoot(options)}`);
@@ -3,6 +3,6 @@
3
3
  Bundled public-safe WaveEngine SDK lookup cache for wave3d-agent-sdk.
4
4
  Generated from sanitized public API/skill corpus during package build.
5
5
 
6
- cacheKey: 2026-06-17.1.qWjJM6rOkct8YGTZNQGI1BLpjLQ56w7W
7
- bundleHash: qWjJM6rOkct8YGTZNQGI1BLpjLQ56w7W
8
- zip: wave-engine-sdk-2026-06-17.1.qWjJM6rOkct8YGTZNQGI1BLpjLQ56w7W.zip
6
+ cacheKey: 2026-06-17.1.n0oOEAqXJRog7nDZSiUwu5FW2XAzeQrH
7
+ bundleHash: n0oOEAqXJRog7nDZSiUwu5FW2XAzeQrH
8
+ zip: wave-engine-sdk-2026-06-17.1.n0oOEAqXJRog7nDZSiUwu5FW2XAzeQrH.zip
@@ -1,21 +1,21 @@
1
1
  {
2
- "version": "2026-06-17.1.qWjJM6rOkct8YGTZNQGI1BLpjLQ56w7W",
2
+ "version": "2026-06-17.1.n0oOEAqXJRog7nDZSiUwu5FW2XAzeQrH",
3
3
  "formatVersion": "2026-06-17.1",
4
- "cacheKey": "2026-06-17.1.qWjJM6rOkct8YGTZNQGI1BLpjLQ56w7W",
5
- "bundleFileName": "wave-engine-sdk-2026-06-17.1.qWjJM6rOkct8YGTZNQGI1BLpjLQ56w7W.zip",
6
- "bundleHash": "qWjJM6rOkct8YGTZNQGI1BLpjLQ56w7W",
4
+ "cacheKey": "2026-06-17.1.n0oOEAqXJRog7nDZSiUwu5FW2XAzeQrH",
5
+ "bundleFileName": "wave-engine-sdk-2026-06-17.1.n0oOEAqXJRog7nDZSiUwu5FW2XAzeQrH.zip",
6
+ "bundleHash": "n0oOEAqXJRog7nDZSiUwu5FW2XAzeQrH",
7
7
  "generatedAt": "2026-06-06T00:00:00.000Z",
8
8
  "sourceVersions": {
9
9
  "onboarding": {
10
10
  "promptVersion": "2026-06-15.2",
11
- "promptHash": "iK3pRMEOo0DHWhoh-mf2tMPA2Q6WFXIr"
11
+ "promptHash": "3e2iN6MmhnUr6td4i7eUsVRIcIWEgfH-"
12
12
  },
13
13
  "apiHandbook": {
14
14
  "version": "1",
15
- "contentHash": "ff608d6d66055f42"
15
+ "contentHash": "ca559d715cfd826c"
16
16
  },
17
- "waveSkillCorpusHash": "zYNMifq0Tf_Ck95E1rgKD7pb7o0EJDIO",
18
- "sdkLookupCorpusHash": "FmrK-8n-nsi1iRbkQolqhXdQ4rFhiE5o"
17
+ "waveSkillCorpusHash": "uLVgvHheEwNuV8Xhball1Pp_bFcuGBf5",
18
+ "sdkLookupCorpusHash": "JnC3w4jcOYUC7FqGE9mTjN_HQcrLjokO"
19
19
  },
20
20
  "cacheContract": {
21
21
  "llmContextCacheOnly": [
@@ -34,19 +34,19 @@
34
34
  "searchDocuments"
35
35
  ],
36
36
  "rule": "Priority 1 always-on sections must stay in LLM chat/system context. The WaveEngine SDK local cache is public-safe retrieval data, never the only memory for core policy.",
37
- "defaultRefreshCommand": "npx -y wave3d-agent-sdk@0.2.3 cache refresh",
37
+ "defaultRefreshCommand": "npx -y wave3d-agent-sdk@0.2.5 cache refresh",
38
38
  "refreshRule": "When using WaveEngine SDK local cache, compare cacheKey, bundleHash, and sourceVersions before trusting local lookup. If any value differs, update the SDK package or reinstall its bundled SDK cache and rebuild local indexes. Do not fetch a remote SDK zip.",
39
39
  "onlineFallback": "HTTP Gateway does not provide cloud API lookup. If local Node/npm or cache is refused/unavailable, use only concrete Studio operations and already-known code; repair the local WaveEngine SDK before unfamiliar API authoring."
40
40
  },
41
41
  "download": {
42
42
  "sameOriginPath": "/api/waveStudio/bridge/mcp/corpus",
43
43
  "cacheBustingQuery": "",
44
- "etag": "\"wave-engine-sdk-qWjJM6rOkct8YGTZNQGI1BLpjLQ56w7W\""
44
+ "etag": "\"wave-engine-sdk-n0oOEAqXJRog7nDZSiUwu5FW2XAzeQrH\""
45
45
  },
46
46
  "corpus": {
47
- "skillCount": 65,
48
- "apiEntryCount": 5000,
49
- "apiMethodGroupCount": 1143
47
+ "skillCount": 67,
48
+ "apiEntryCount": 5034,
49
+ "apiMethodGroupCount": 1158
50
50
  },
51
51
  "files": [
52
52
  {
@@ -54,14 +54,14 @@
54
54
  "mediaType": "application/json",
55
55
  "role": "lookup-guide",
56
56
  "bytes": 1288,
57
- "hash": "547CKidKl5HZAfrPg_R0-tO0MNNFf1Ew"
57
+ "hash": "5Y-iLRlUHhoRSqc8RFgt0XW088f6Gg9S"
58
58
  },
59
59
  {
60
60
  "path": "skills/wave-skills.jsonl",
61
61
  "mediaType": "application/jsonl",
62
62
  "role": "skill-corpus",
63
- "bytes": 472843,
64
- "hash": "BHx1prKm-ggF4ggk9ZUfKusRGPCmobPd"
63
+ "bytes": 494480,
64
+ "hash": "il2ZDuomya-dat5c6xGkSHhgu3C4AMBP"
65
65
  },
66
66
  {
67
67
  "path": "skills/foundations.jsonl",
@@ -74,36 +74,36 @@
74
74
  "path": "skills/families.json",
75
75
  "mediaType": "application/json",
76
76
  "role": "skill-corpus",
77
- "bytes": 44401,
78
- "hash": "MlM0qqK1BMGUsOv5Zgf3YbjGiIfU4IjM"
77
+ "bytes": 46799,
78
+ "hash": "hiiiaDgQD_XhiXR6aCkIHBvydCDdqZI8"
79
79
  },
80
80
  {
81
81
  "path": "api/entries.jsonl",
82
82
  "mediaType": "application/jsonl",
83
83
  "role": "api-corpus",
84
- "bytes": 4526446,
85
- "hash": "qOT8R4_becmncqN1sAZzCwo18n2OHgbe"
84
+ "bytes": 4556756,
85
+ "hash": "pZ2kqFdbKRhRj4RsmYNRVt8qCCzUxmM4"
86
86
  },
87
87
  {
88
88
  "path": "api/method-groups.jsonl",
89
89
  "mediaType": "application/jsonl",
90
90
  "role": "api-corpus",
91
- "bytes": 291474,
92
- "hash": "l9LZ0aztqPb3yy_6VQU21pgrzTr7G21Z"
91
+ "bytes": 294894,
92
+ "hash": "jkwCp1pDfP0E7c_o-nF9zGTLwSR07iWk"
93
93
  },
94
94
  {
95
95
  "path": "api/index-metadata.json",
96
96
  "mediaType": "application/json",
97
97
  "role": "api-corpus",
98
98
  "bytes": 192,
99
- "hash": "3RotzIDkoahE_90Fi1JQjv8lZKr6rhwH"
99
+ "hash": "lr1v9SUh-f868Ie-mVNJDBG0QxqX-TSC"
100
100
  },
101
101
  {
102
102
  "path": "search/search-documents.jsonl",
103
103
  "mediaType": "application/jsonl",
104
104
  "role": "search-index",
105
- "bytes": 4039188,
106
- "hash": "zIGmnONrO849VVRDhUW4wa4W-UgkRLzz"
105
+ "bytes": 4078414,
106
+ "hash": "YtRJaRuntvspPUU7AZZg_7vN2yIzliiI"
107
107
  },
108
108
  {
109
109
  "path": "README.md",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wave3d-agent-sdk",
3
- "version": "0.2.3",
3
+ "version": "0.2.5",
4
4
  "description": "WaveEngine Agent SDK for same-machine Wave Studio MCP plus bundled WaveEngine lookup.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",