@skillcap/gdh 0.18.1 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/INSTALL-BUNDLE.json +1 -1
  2. package/README.md +4 -4
  3. package/RELEASE-SPAN-UPDATE-CONTRACTS.json +145 -8
  4. package/node_modules/@gdh/adapters/dist/authoring-hook-render.d.ts +10 -0
  5. package/node_modules/@gdh/adapters/dist/authoring-hook-render.d.ts.map +1 -0
  6. package/node_modules/@gdh/adapters/dist/authoring-hook-render.js +150 -0
  7. package/node_modules/@gdh/adapters/dist/authoring-hook-render.js.map +1 -0
  8. package/node_modules/@gdh/adapters/dist/claude-settings-patch.d.ts +2 -0
  9. package/node_modules/@gdh/adapters/dist/claude-settings-patch.d.ts.map +1 -1
  10. package/node_modules/@gdh/adapters/dist/claude-settings-patch.js +71 -6
  11. package/node_modules/@gdh/adapters/dist/claude-settings-patch.js.map +1 -1
  12. package/node_modules/@gdh/adapters/dist/index.d.ts +18 -30
  13. package/node_modules/@gdh/adapters/dist/index.d.ts.map +1 -1
  14. package/node_modules/@gdh/adapters/dist/index.js +364 -1128
  15. package/node_modules/@gdh/adapters/dist/index.js.map +1 -1
  16. package/node_modules/@gdh/adapters/dist/skill-rendering.d.ts +45 -0
  17. package/node_modules/@gdh/adapters/dist/skill-rendering.d.ts.map +1 -0
  18. package/node_modules/@gdh/adapters/dist/skill-rendering.js +419 -0
  19. package/node_modules/@gdh/adapters/dist/skill-rendering.js.map +1 -0
  20. package/node_modules/@gdh/adapters/package.json +8 -8
  21. package/node_modules/@gdh/authoring/dist/diagnostics-summary.d.ts +8 -0
  22. package/node_modules/@gdh/authoring/dist/diagnostics-summary.d.ts.map +1 -0
  23. package/node_modules/@gdh/authoring/dist/diagnostics-summary.js +22 -0
  24. package/node_modules/@gdh/authoring/dist/diagnostics-summary.js.map +1 -0
  25. package/node_modules/@gdh/authoring/dist/index.d.ts +4 -1
  26. package/node_modules/@gdh/authoring/dist/index.d.ts.map +1 -1
  27. package/node_modules/@gdh/authoring/dist/index.js +17 -2
  28. package/node_modules/@gdh/authoring/dist/index.js.map +1 -1
  29. package/node_modules/@gdh/authoring/dist/lsp.d.ts +5 -1
  30. package/node_modules/@gdh/authoring/dist/lsp.d.ts.map +1 -1
  31. package/node_modules/@gdh/authoring/dist/lsp.js +95 -1
  32. package/node_modules/@gdh/authoring/dist/lsp.js.map +1 -1
  33. package/node_modules/@gdh/authoring/dist/project.d.ts.map +1 -1
  34. package/node_modules/@gdh/authoring/dist/project.js +1 -0
  35. package/node_modules/@gdh/authoring/dist/project.js.map +1 -1
  36. package/node_modules/@gdh/authoring/dist/scene-resource.d.ts +2 -0
  37. package/node_modules/@gdh/authoring/dist/scene-resource.d.ts.map +1 -1
  38. package/node_modules/@gdh/authoring/dist/scene-resource.js +15 -1
  39. package/node_modules/@gdh/authoring/dist/scene-resource.js.map +1 -1
  40. package/node_modules/@gdh/authoring/package.json +2 -2
  41. package/node_modules/@gdh/cli/dist/index.d.ts.map +1 -1
  42. package/node_modules/@gdh/cli/dist/index.js +206 -280
  43. package/node_modules/@gdh/cli/dist/index.js.map +1 -1
  44. package/node_modules/@gdh/cli/package.json +10 -10
  45. package/node_modules/@gdh/core/dist/index.d.ts +78 -83
  46. package/node_modules/@gdh/core/dist/index.d.ts.map +1 -1
  47. package/node_modules/@gdh/core/dist/index.js +4 -4
  48. package/node_modules/@gdh/core/dist/index.js.map +1 -1
  49. package/node_modules/@gdh/core/package.json +1 -1
  50. package/node_modules/@gdh/docs/dist/agent-contract.js +1 -1
  51. package/node_modules/@gdh/docs/dist/agent-contract.js.map +1 -1
  52. package/node_modules/@gdh/docs/dist/guidance.d.ts.map +1 -1
  53. package/node_modules/@gdh/docs/dist/guidance.js +117 -18
  54. package/node_modules/@gdh/docs/dist/guidance.js.map +1 -1
  55. package/node_modules/@gdh/docs/dist/rules.js +3 -3
  56. package/node_modules/@gdh/docs/dist/rules.js.map +1 -1
  57. package/node_modules/@gdh/docs/package.json +2 -2
  58. package/node_modules/@gdh/mcp/package.json +8 -8
  59. package/node_modules/@gdh/observability/dist/guidance-audit.d.ts.map +1 -1
  60. package/node_modules/@gdh/observability/dist/guidance-audit.js +1 -50
  61. package/node_modules/@gdh/observability/dist/guidance-audit.js.map +1 -1
  62. package/node_modules/@gdh/observability/package.json +2 -2
  63. package/node_modules/@gdh/runtime/dist/bridge-broker-contract.d.ts +23 -0
  64. package/node_modules/@gdh/runtime/dist/bridge-broker-contract.d.ts.map +1 -0
  65. package/node_modules/@gdh/runtime/dist/bridge-broker-contract.js +120 -0
  66. package/node_modules/@gdh/runtime/dist/bridge-broker-contract.js.map +1 -0
  67. package/node_modules/@gdh/runtime/dist/index.d.ts +2 -1
  68. package/node_modules/@gdh/runtime/dist/index.d.ts.map +1 -1
  69. package/node_modules/@gdh/runtime/dist/index.js +28 -62
  70. package/node_modules/@gdh/runtime/dist/index.js.map +1 -1
  71. package/node_modules/@gdh/runtime/package.json +2 -2
  72. package/node_modules/@gdh/scan/package.json +3 -3
  73. package/node_modules/@gdh/verify/dist/index.d.ts +0 -1
  74. package/node_modules/@gdh/verify/dist/index.d.ts.map +1 -1
  75. package/node_modules/@gdh/verify/dist/index.js +1 -2
  76. package/node_modules/@gdh/verify/dist/index.js.map +1 -1
  77. package/node_modules/@gdh/verify/package.json +7 -7
  78. package/package.json +11 -11
@@ -5,11 +5,12 @@ import net from "node:net";
5
5
  import os from "node:os";
6
6
  import path from "node:path";
7
7
  import { promisify } from "node:util";
8
+ import { definePackageBoundary, detectFatalGodotStderr, GDH_RECIPE_SCHEMA_VERSION, GDH_RUNTIME_RECIPE_RUN_VERSION, presentPublicRuntimeTerms, resolveConfiguredGodotEditorBin, } from "@gdh/core";
8
9
  import WebSocket, {} from "ws";
9
- import { GDH_RECIPE_SCHEMA_VERSION, GDH_RUNTIME_RECIPE_RUN_VERSION, detectFatalGodotStderr, definePackageBoundary, presentPublicRuntimeTerms, resolveConfiguredGodotEditorBin, } from "@gdh/core";
10
10
  import { parse } from "yaml";
11
11
  import { inspectRuntimeBridgeSurface } from "./bridge-surface.js";
12
12
  import { buildDockerRuntimeLaunchPreview, ensureDockerRuntimeImagePlan, inspectDockerRuntimeProvider, toDockerContainerPath, } from "./docker-provider.js";
13
+ export { BROKER_DEFAULT_HEARTBEAT_STALE_AFTER_MS, BROKER_LOOPBACK_HOST, BROKER_PROTOCOL_VERSION, normalizeBrokerTargetIdentity, validateBrokerHandshake, } from "./bridge-broker-contract.js";
13
14
  export { inspectRuntimeBridgeSurface, installRuntimeBridgeSurface, removeRuntimeBridgeSurface, repairRuntimeBridgeSurface, resolveRuntimeBridgeConfig, } from "./bridge-surface.js";
14
15
  export { inspectRuntimeKnowledgeSurface } from "./knowledge-surface.js";
15
16
  export const runtimePackage = definePackageBoundary({
@@ -199,9 +200,7 @@ export async function runRuntimeRecipe(input) {
199
200
  : execution.errorMessage !== null
200
201
  ? `Runtime recipe "${input.recipeId}" failed before the process exited: ${execution.errorMessage}.`
201
202
  : `Runtime recipe "${input.recipeId}" exited with code ${execution.exitCode}.`),
202
- reasons: execution.errorMessage !== null
203
- ? ["launch_process_error"]
204
- : execution.reasons,
203
+ reasons: execution.errorMessage !== null ? ["launch_process_error"] : execution.reasons,
205
204
  recipe: executionCheck.recipe,
206
205
  check: executionCheck,
207
206
  session,
@@ -530,9 +529,7 @@ function resolveRuntimeValues(recipe, input) {
530
529
  }
531
530
  const featureEnv = new Map();
532
531
  for (const featureFlag of featureFlags) {
533
- if (featureFlag.enabled &&
534
- featureFlag.envVarName !== null &&
535
- featureFlag.envValue !== null) {
532
+ if (featureFlag.enabled && featureFlag.envVarName !== null && featureFlag.envValue !== null) {
536
533
  featureEnv.set(featureFlag.envVarName, featureFlag.envValue);
537
534
  }
538
535
  }
@@ -753,9 +750,7 @@ async function resolvePrechecks(input) {
753
750
  }
754
751
  const envValue = definition.envVarName === null
755
752
  ? null
756
- : environmentMap.get(definition.envVarName) ??
757
- process.env[definition.envVarName] ??
758
- null;
753
+ : (environmentMap.get(definition.envVarName) ?? process.env[definition.envVarName] ?? null);
759
754
  results.push({
760
755
  ...definition,
761
756
  status: envValue === null ? "failed" : "passed",
@@ -776,9 +771,7 @@ async function buildLaunchPreview(input) {
776
771
  }
777
772
  }
778
773
  for (const featureFlag of input.values.featureFlags) {
779
- if (featureFlag.enabled &&
780
- featureFlag.envVarName !== null &&
781
- featureFlag.envValue !== null) {
774
+ if (featureFlag.enabled && featureFlag.envVarName !== null && featureFlag.envValue !== null) {
782
775
  environmentMap.set(featureFlag.envVarName, featureFlag.envValue);
783
776
  }
784
777
  }
@@ -825,7 +818,7 @@ async function buildLaunchPreview(input) {
825
818
  return buildDockerRuntimeLaunchPreview({
826
819
  evaluationRootPath: input.evaluationRootPath,
827
820
  containerWorkingDirectory: toDockerContainerPath(input.evaluationRootPath, path.join(input.evaluationRootPath, input.recipe.launch.kind === "project_launch_adapter"
828
- ? input.recipe.launch.workingDirectory ?? input.recipe.projectPath
821
+ ? (input.recipe.launch.workingDirectory ?? input.recipe.projectPath)
829
822
  : input.recipe.projectPath)),
830
823
  command: dockerCommand,
831
824
  environment: environmentEntries,
@@ -863,12 +856,7 @@ async function buildLaunchPreview(input) {
863
856
  }
864
857
  const scriptPath = path.join(input.evaluationRootPath, input.recipe.launch.scriptPath);
865
858
  const command = input.recipe.launch.interpreter === null
866
- ? [
867
- scriptPath,
868
- ...input.recipe.launch.arguments,
869
- ...parameterArguments,
870
- ...featureArguments,
871
- ]
859
+ ? [scriptPath, ...input.recipe.launch.arguments, ...parameterArguments, ...featureArguments]
872
860
  : [
873
861
  input.recipe.launch.interpreter,
874
862
  scriptPath,
@@ -909,9 +897,7 @@ async function prepareDockerGodotProjectLaunch(input) {
909
897
  const sanitizedProjectGodot = projectGodotContent === null
910
898
  ? null
911
899
  : sanitizeProjectGodotAutoloadUids(projectGodotContent, uidLookup);
912
- const sanitizedExtensionList = extensionListContent === null
913
- ? null
914
- : sanitizeDockerExtensionList(extensionListContent);
900
+ const sanitizedExtensionList = extensionListContent === null ? null : sanitizeDockerExtensionList(extensionListContent);
915
901
  const needsProjectGodotOverlay = projectGodotContent !== null && sanitizedProjectGodot !== projectGodotContent;
916
902
  const needsExtensionListOverlay = extensionListContent !== null && sanitizedExtensionList !== extensionListContent;
917
903
  if (!needsProjectGodotOverlay && !needsExtensionListOverlay) {
@@ -1001,9 +987,7 @@ function sanitizeProjectGodotAutoloadUids(content, uidLookup) {
1001
987
  return `${nextLines.join("\n").replace(/\n+$/, "\n")}`;
1002
988
  }
1003
989
  function sanitizeDockerExtensionList(content) {
1004
- const nextLines = content
1005
- .split(/\r?\n/)
1006
- .filter((line) => !line.startsWith("res://temp/"));
990
+ const nextLines = content.split(/\r?\n/).filter((line) => !line.startsWith("res://temp/"));
1007
991
  return `${nextLines.join("\n").replace(/\n+$/, "\n")}`;
1008
992
  }
1009
993
  function findProjectSettingSection(lines, name) {
@@ -1124,9 +1108,7 @@ function isDockerLaunchPreview(preview) {
1124
1108
  }
1125
1109
  function attachDockerScreenshotCapture(preview, artifactDirectory) {
1126
1110
  const prepareHint = (preview.prepareHints ?? []).find((hint) => hint.kind === "docker_runtime_image") ?? null;
1127
- if (prepareHint === null ||
1128
- preview.command === null ||
1129
- preview.command[0] !== "docker") {
1111
+ if (prepareHint === null || preview.command === null || preview.command[0] !== "docker") {
1130
1112
  return preview;
1131
1113
  }
1132
1114
  const imageIndex = preview.command.lastIndexOf(prepareHint.imageTag);
@@ -1208,20 +1190,14 @@ async function ensureExplicitScreenshotCaptureDirectories(capture) {
1208
1190
  }
1209
1191
  function attachDockerExplicitScreenshotCapture(preview, capture) {
1210
1192
  const prepareHint = (preview.prepareHints ?? []).find((hint) => hint.kind === "docker_runtime_image") ?? null;
1211
- if (prepareHint === null ||
1212
- preview.command === null ||
1213
- preview.command[0] !== "docker") {
1193
+ if (prepareHint === null || preview.command === null || preview.command[0] !== "docker") {
1214
1194
  return preview;
1215
1195
  }
1216
1196
  const imageIndex = preview.command.lastIndexOf(prepareHint.imageTag);
1217
1197
  if (imageIndex <= 0) {
1218
1198
  return preview;
1219
1199
  }
1220
- const beforeImage = stripDockerEnvArguments(preview.command.slice(1, imageIndex), new Set([
1221
- ENV_SCREENSHOT_CAPTURE,
1222
- ENV_SCREENSHOT_PATH,
1223
- ENV_SCREENSHOT_METADATA_PATH,
1224
- ]));
1200
+ const beforeImage = stripDockerEnvArguments(preview.command.slice(1, imageIndex), new Set([ENV_SCREENSHOT_CAPTURE, ENV_SCREENSHOT_PATH, ENV_SCREENSHOT_METADATA_PATH]));
1225
1201
  const afterImage = preview.command.slice(imageIndex);
1226
1202
  const mountMappings = new Map();
1227
1203
  const mapHostFileToContainer = (hostFilePath) => {
@@ -1264,7 +1240,7 @@ function stripDockerEnvArguments(dockerArgs, environmentNames) {
1264
1240
  continue;
1265
1241
  }
1266
1242
  const next = dockerArgs[index + 1];
1267
- const environmentName = typeof next === "string" ? next.split("=")[0] ?? "" : "";
1243
+ const environmentName = typeof next === "string" ? (next.split("=")[0] ?? "") : "";
1268
1244
  if (next !== undefined && environmentNames.has(environmentName)) {
1269
1245
  index += 1;
1270
1246
  continue;
@@ -1306,9 +1282,7 @@ async function finalizeRuntimeScreenshotCapture(provisional) {
1306
1282
  reason: "screenshot_metadata_invalid",
1307
1283
  };
1308
1284
  }
1309
- const state = parsed?.state === "captured" ||
1310
- parsed?.state === "unavailable" ||
1311
- parsed?.state === "failed"
1285
+ const state = parsed?.state === "captured" || parsed?.state === "unavailable" || parsed?.state === "failed"
1312
1286
  ? parsed.state
1313
1287
  : "failed";
1314
1288
  const reason = typeof parsed?.reason === "string" ? parsed.reason : null;
@@ -1320,8 +1294,7 @@ async function finalizeRuntimeScreenshotCapture(provisional) {
1320
1294
  ? "Rendered screenshot capture was unavailable for this run."
1321
1295
  : "Rendered screenshot capture failed.";
1322
1296
  if (state === "captured") {
1323
- const imagePresent = provisional.imagePath !== null &&
1324
- (await pathExists(provisional.imagePath));
1297
+ const imagePresent = provisional.imagePath !== null && (await pathExists(provisional.imagePath));
1325
1298
  if (!imagePresent) {
1326
1299
  return {
1327
1300
  ...provisional,
@@ -1586,7 +1559,9 @@ export function createRuntimeBridgeManager() {
1586
1559
  return {
1587
1560
  async startSession(input) {
1588
1561
  const liveCheck = await checkRuntimeRecipe(input);
1589
- if (liveCheck.state !== "runnable" || liveCheck.recipe === null || liveCheck.launchPreview === null) {
1562
+ if (liveCheck.state !== "runnable" ||
1563
+ liveCheck.recipe === null ||
1564
+ liveCheck.launchPreview === null) {
1590
1565
  return {
1591
1566
  targetPath: input.targetPath,
1592
1567
  recipeId: input.recipeId,
@@ -1609,10 +1584,7 @@ export function createRuntimeBridgeManager() {
1609
1584
  recipeId: input.recipeId,
1610
1585
  state: "blocked",
1611
1586
  summary: "Runtime bridge session start is blocked until the project-side GDH bridge is installed and healthy for direct Godot launches.",
1612
- reasons: [
1613
- "runtime_bridge_surface_not_ready",
1614
- ...bridgeStatus.reasons,
1615
- ],
1587
+ reasons: ["runtime_bridge_surface_not_ready", ...bridgeStatus.reasons],
1616
1588
  bridge: bridgeMissing(bridgeStatus.summary),
1617
1589
  launchCommand: liveCheck.launchPreview.command,
1618
1590
  session: null,
@@ -1970,10 +1942,7 @@ async function stopBridgeSessionHandle(session) {
1970
1942
  }
1971
1943
  if (session.exitCode.value === null) {
1972
1944
  session.child.kill("SIGTERM");
1973
- const exited = await Promise.race([
1974
- session.exitPromise,
1975
- waitMs(2000).then(() => null),
1976
- ]);
1945
+ const exited = await Promise.race([session.exitPromise, waitMs(2000).then(() => null)]);
1977
1946
  if (exited === null) {
1978
1947
  session.child.kill("SIGKILL");
1979
1948
  await session.exitPromise;
@@ -2144,7 +2113,7 @@ async function invokeInputSequenceRunEntry(session, inputValue) {
2144
2113
  }
2145
2114
  continue;
2146
2115
  }
2147
- if (Object.prototype.hasOwnProperty.call(step, "delayMs")) {
2116
+ if (Object.hasOwn(step, "delayMs")) {
2148
2117
  const delayMs = clampNumber(step["delayMs"], 1, 1, 5000);
2149
2118
  recordBridgeEvent(session, "sequence_step_started", {
2150
2119
  index,
@@ -2262,7 +2231,7 @@ async function invokeNodePropertyAwaitEntry(session, inputValue) {
2262
2231
  const input = toJsonRecord(inputValue);
2263
2232
  const nodePath = typeof input["nodePath"] === "string" ? input["nodePath"] : "";
2264
2233
  const property = typeof input["property"] === "string" ? input["property"] : "";
2265
- const hasExpected = Object.prototype.hasOwnProperty.call(input, "expected");
2234
+ const hasExpected = Object.hasOwn(input, "expected");
2266
2235
  const expected = hasExpected ? input["expected"] : null;
2267
2236
  const timeoutMs = clampNumber(input["timeoutMs"], 1500, 100, 5000);
2268
2237
  const pollIntervalMs = clampNumber(input["pollIntervalMs"], 50, 25, 250);
@@ -2800,8 +2769,7 @@ async function connectBridgeSocket(input) {
2800
2769
  await waitMs(100);
2801
2770
  }
2802
2771
  }
2803
- throw new Error(lastError?.message ??
2804
- "Timed out waiting for the runtime bridge WebSocket handshake.");
2772
+ throw new Error(lastError?.message ?? "Timed out waiting for the runtime bridge WebSocket handshake.");
2805
2773
  }
2806
2774
  async function attemptBridgeSocketConnection(input) {
2807
2775
  return new Promise((resolve, reject) => {
@@ -2827,8 +2795,7 @@ async function attemptBridgeSocketConnection(input) {
2827
2795
  if (parsed.kind === "hello_ok") {
2828
2796
  clearTimeout(timeout);
2829
2797
  socket.removeAllListeners("message");
2830
- socket.gdhEntries =
2831
- parsed.entries ?? [];
2798
+ socket.gdhEntries = parsed.entries ?? [];
2832
2799
  resolve(socket);
2833
2800
  return;
2834
2801
  }
@@ -2857,7 +2824,8 @@ async function listBridgeEntriesFromSocket(socket, sessionId) {
2857
2824
  request_id: `${sessionId}-list-${randomBytes(8).toString("hex")}`,
2858
2825
  });
2859
2826
  const entries = response.result ?? [];
2860
- socket.gdhEntries = entries;
2827
+ socket.gdhEntries =
2828
+ entries;
2861
2829
  return entries;
2862
2830
  }
2863
2831
  async function invokeBridgeEntryOverSocket(socket, sessionId, entryId, input) {
@@ -3032,9 +3000,7 @@ function readStringArray(value, fallback = []) {
3032
3000
  if (!Array.isArray(value)) {
3033
3001
  return fallback;
3034
3002
  }
3035
- return value
3036
- .filter((entry) => typeof entry === "string")
3037
- .map((entry) => entry);
3003
+ return value.filter((entry) => typeof entry === "string").map((entry) => entry);
3038
3004
  }
3039
3005
  function readObjectArray(value) {
3040
3006
  if (!Array.isArray(value)) {