@skillcap/gdh 0.16.0 → 0.17.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 (53) hide show
  1. package/INSTALL-BUNDLE.json +1 -1
  2. package/RELEASE-SPAN-UPDATE-CONTRACTS.json +87 -0
  3. package/node_modules/@gdh/adapters/dist/index.d.ts +2 -2
  4. package/node_modules/@gdh/adapters/dist/index.d.ts.map +1 -1
  5. package/node_modules/@gdh/adapters/dist/index.js +143 -110
  6. package/node_modules/@gdh/adapters/dist/index.js.map +1 -1
  7. package/node_modules/@gdh/adapters/package.json +8 -8
  8. package/node_modules/@gdh/authoring/dist/index.d.ts +4 -3
  9. package/node_modules/@gdh/authoring/dist/index.d.ts.map +1 -1
  10. package/node_modules/@gdh/authoring/dist/index.js +80 -9
  11. package/node_modules/@gdh/authoring/dist/index.js.map +1 -1
  12. package/node_modules/@gdh/authoring/dist/lsp-client.d.ts +47 -0
  13. package/node_modules/@gdh/authoring/dist/lsp-client.d.ts.map +1 -0
  14. package/node_modules/@gdh/authoring/dist/lsp-client.js +371 -0
  15. package/node_modules/@gdh/authoring/dist/lsp-client.js.map +1 -0
  16. package/node_modules/@gdh/authoring/dist/lsp-test-server.test-utils.d.ts +35 -0
  17. package/node_modules/@gdh/authoring/dist/lsp-test-server.test-utils.d.ts.map +1 -0
  18. package/node_modules/@gdh/authoring/dist/lsp-test-server.test-utils.js +194 -0
  19. package/node_modules/@gdh/authoring/dist/lsp-test-server.test-utils.js.map +1 -0
  20. package/node_modules/@gdh/authoring/dist/lsp.d.ts +62 -1
  21. package/node_modules/@gdh/authoring/dist/lsp.d.ts.map +1 -1
  22. package/node_modules/@gdh/authoring/dist/lsp.js +1207 -109
  23. package/node_modules/@gdh/authoring/dist/lsp.js.map +1 -1
  24. package/node_modules/@gdh/authoring/dist/scene-resource.d.ts +39 -0
  25. package/node_modules/@gdh/authoring/dist/scene-resource.d.ts.map +1 -0
  26. package/node_modules/@gdh/authoring/dist/scene-resource.js +544 -0
  27. package/node_modules/@gdh/authoring/dist/scene-resource.js.map +1 -0
  28. package/node_modules/@gdh/authoring/package.json +2 -2
  29. package/node_modules/@gdh/cli/dist/index.d.ts.map +1 -1
  30. package/node_modules/@gdh/cli/dist/index.js +116 -18
  31. package/node_modules/@gdh/cli/dist/index.js.map +1 -1
  32. package/node_modules/@gdh/cli/package.json +10 -10
  33. package/node_modules/@gdh/core/dist/index.d.ts +48 -13
  34. package/node_modules/@gdh/core/dist/index.d.ts.map +1 -1
  35. package/node_modules/@gdh/core/dist/index.js +14 -17
  36. package/node_modules/@gdh/core/dist/index.js.map +1 -1
  37. package/node_modules/@gdh/core/package.json +1 -1
  38. package/node_modules/@gdh/docs/dist/guidance.d.ts.map +1 -1
  39. package/node_modules/@gdh/docs/dist/guidance.js +12 -2
  40. package/node_modules/@gdh/docs/dist/guidance.js.map +1 -1
  41. package/node_modules/@gdh/docs/dist/rules.d.ts.map +1 -1
  42. package/node_modules/@gdh/docs/dist/rules.js +2 -2
  43. package/node_modules/@gdh/docs/dist/rules.js.map +1 -1
  44. package/node_modules/@gdh/docs/package.json +2 -2
  45. package/node_modules/@gdh/mcp/package.json +8 -8
  46. package/node_modules/@gdh/observability/package.json +2 -2
  47. package/node_modules/@gdh/runtime/package.json +2 -2
  48. package/node_modules/@gdh/scan/package.json +3 -3
  49. package/node_modules/@gdh/verify/dist/policy.d.ts.map +1 -1
  50. package/node_modules/@gdh/verify/dist/policy.js +157 -29
  51. package/node_modules/@gdh/verify/dist/policy.js.map +1 -1
  52. package/node_modules/@gdh/verify/package.json +7 -7
  53. package/package.json +11 -11
@@ -1,11 +1,11 @@
1
1
  import { spawnSync } from "node:child_process";
2
- import fs from "node:fs/promises";
3
2
  import fsSync from "node:fs";
3
+ import fs from "node:fs/promises";
4
4
  import os from "node:os";
5
5
  import path from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
- import { buildGdhStatusResult, CLAUDE_CHECK_COMMAND_RELATIVE_PATH, CLAUDE_CHECK_UPDATE_HOOK_RELATIVE_PATH, CLAUDE_MIGRATE_COMMAND_RELATIVE_PATH, CLAUDE_ONBOARD_COMMAND_RELATIVE_PATH, CLAUDE_PREPARE_COMMAND_RELATIVE_PATH, CLAUDE_STATUS_COMMAND_RELATIVE_PATH, CLAUDE_VERIFY_COMMAND_RELATIVE_PATH, CODEX_CHECK_SKILL_RELATIVE_PATH, CODEX_MIGRATE_SKILL_RELATIVE_PATH, CODEX_ONBOARD_SKILL_RELATIVE_PATH, CODEX_PREPARE_SKILL_RELATIVE_PATH, CODEX_STATUS_SKILL_RELATIVE_PATH, CODEX_VERIFY_SKILL_RELATIVE_PATH, createGsdSnapshot, CURSOR_CHECK_SKILL_RELATIVE_PATH, CURSOR_MIGRATE_SKILL_RELATIVE_PATH, CURSOR_ONBOARD_SKILL_RELATIVE_PATH, CURSOR_PREPARE_SKILL_RELATIVE_PATH, CURSOR_STATUS_SKILL_RELATIVE_PATH, CURSOR_VERIFY_SKILL_RELATIVE_PATH, getSupportedAgentAdaptersStatus, installSupportedAgentAdapters, } from "@gdh/adapters";
8
- import { getManagedLspStatus, hasCompleteOnboardingSurface, inspectCacheState, pruneCacheState, readProjectConfig, resolvePinnedVersion, resolveProjectRoot, readWorktreeState, resolveAuthoringStatus, resolveTargetGodotDocsVersion, runAuthoringCheck, runImportRefresh, runTargetPrepare, runWarmup, } from "@gdh/authoring";
7
+ import { buildGdhStatusResult, CLAUDE_CHECK_COMMAND_RELATIVE_PATH, CLAUDE_CHECK_UPDATE_HOOK_RELATIVE_PATH, CLAUDE_MIGRATE_COMMAND_RELATIVE_PATH, CLAUDE_ONBOARD_COMMAND_RELATIVE_PATH, CLAUDE_PREPARE_COMMAND_RELATIVE_PATH, CLAUDE_STATUS_COMMAND_RELATIVE_PATH, CLAUDE_VERIFY_COMMAND_RELATIVE_PATH, CODEX_CHECK_SKILL_RELATIVE_PATH, CODEX_MIGRATE_SKILL_RELATIVE_PATH, CODEX_ONBOARD_SKILL_RELATIVE_PATH, CODEX_PREPARE_SKILL_RELATIVE_PATH, CODEX_STATUS_SKILL_RELATIVE_PATH, CODEX_VERIFY_SKILL_RELATIVE_PATH, CURSOR_CHECK_SKILL_RELATIVE_PATH, CURSOR_MIGRATE_SKILL_RELATIVE_PATH, CURSOR_ONBOARD_SKILL_RELATIVE_PATH, CURSOR_PREPARE_SKILL_RELATIVE_PATH, CURSOR_STATUS_SKILL_RELATIVE_PATH, CURSOR_VERIFY_SKILL_RELATIVE_PATH, createGsdSnapshot, getSupportedAgentAdaptersStatus, installSupportedAgentAdapters, } from "@gdh/adapters";
8
+ import { checkManagedLsp, doctorManagedLsp, getManagedLspStatus, hasCompleteOnboardingSurface, inspectCacheState, pruneCacheState, pruneManagedLsp, readProjectConfig, readWorktreeState, resolveAuthoringStatus, resolvePinnedVersion, resolveProjectRoot, resolveTargetGodotDocsVersion, restartManagedLsp, runAuthoringCheck, runImportRefresh, runTargetPrepare, runWarmup, stopManagedLsp, } from "@gdh/authoring";
9
9
  import { definePackageBoundary, GDH_AUTHORING_DOGFOOD_VERSION, GDH_AUTHORING_SLICE_REPORT_VERSION, GDH_PRODUCT_NAME, resolveCurrentGdhInstall, resolveGdhProductMetadata, } from "@gdh/core";
10
10
  import { fetchOfficialGodotDoc, getGuidanceStatus, resolveGuidanceQuery, searchOfficialGodotDocs, } from "@gdh/docs";
11
11
  import { createMcpManifest, invokeMcpTool, serveMcpOverStdio } from "@gdh/mcp";
@@ -354,7 +354,12 @@ async function runOnboardCommand(args, io) {
354
354
  const dryRun = args.includes("--dry-run");
355
355
  const { targetPath, error: targetPathError } = parseOptionalPositionalTargetPath(args, {
356
356
  usage: "Usage: gdh onboard [target] [--dry-run]\n",
357
- additionalOptionsWithValues: new Set(["--task-type", "--capability", "--repo-state", "--keyword"]),
357
+ additionalOptionsWithValues: new Set([
358
+ "--task-type",
359
+ "--capability",
360
+ "--repo-state",
361
+ "--keyword",
362
+ ]),
358
363
  });
359
364
  if (targetPathError !== null) {
360
365
  io.stderr.write(targetPathError);
@@ -481,14 +486,26 @@ async function runLspCommand(args, io) {
481
486
  "Usage: gdh lsp <command> [target]",
482
487
  "",
483
488
  "Commands:",
484
- " status [target] Resolve the managed authoring.lsp lifecycle state and print it as JSON.",
489
+ " status [target] Resolve the managed authoring.lsp lifecycle state and print it as JSON.",
490
+ " check [target] Check the persisted managed LSP instance without launching a new one.",
491
+ " stop [target] Stop the persisted GDH-managed LSP instance for this worktree.",
492
+ " restart [target] Stop and relaunch the managed LSP instance for this worktree.",
493
+ " prune [target] Remove stale managed LSP state without killing live unrelated processes.",
494
+ " doctor [target] Report lifecycle, transport, diagnostics, and cleanup guidance.",
485
495
  ].join("\n") + "\n");
486
496
  return 0;
487
497
  }
488
498
  if (subcommand === "status") {
489
499
  return runLspStatusCommand(rest, io);
490
500
  }
491
- io.stderr.write(`Unknown lsp command: ${subcommand}\n\nUsage: gdh lsp status [target]\n`);
501
+ if (subcommand === "check" ||
502
+ subcommand === "stop" ||
503
+ subcommand === "restart" ||
504
+ subcommand === "prune" ||
505
+ subcommand === "doctor") {
506
+ return runLspLifecycleCommand(subcommand, rest, io);
507
+ }
508
+ io.stderr.write(`Unknown lsp command: ${subcommand}\n\nUsage: gdh lsp <status|check|stop|restart|prune|doctor> [target]\n`);
492
509
  return 1;
493
510
  }
494
511
  async function runDocsCommand(args, io) {
@@ -771,6 +788,63 @@ async function runLspStatusCommand(args, io) {
771
788
  return 1;
772
789
  }
773
790
  }
791
+ async function runLspLifecycleCommand(command, args, io) {
792
+ if (args.includes("--help")) {
793
+ io.stdout.write([
794
+ `Usage: gdh lsp ${command} [target]`,
795
+ `Usage: gdh lsp ${command} --target <path>`,
796
+ "",
797
+ describeLspLifecycleCommand(command),
798
+ ].join("\n") + "\n");
799
+ return 0;
800
+ }
801
+ const parsedTarget = parseSingleTargetPathArg(args, {
802
+ usage: `Usage: gdh lsp ${command} [target]\nUsage: gdh lsp ${command} --target <path>\n`,
803
+ allowTargetOption: true,
804
+ });
805
+ if (parsedTarget.error !== null) {
806
+ io.stderr.write(parsedTarget.error);
807
+ return 1;
808
+ }
809
+ const targetPath = parsedTarget.targetPath;
810
+ try {
811
+ const context = await buildAuthoringContext(targetPath);
812
+ const input = {
813
+ targetPath,
814
+ status: context.status,
815
+ projectConfig: context.projectConfig,
816
+ };
817
+ const result = command === "check"
818
+ ? await checkManagedLsp(input)
819
+ : command === "stop"
820
+ ? await stopManagedLsp(input)
821
+ : command === "restart"
822
+ ? await restartManagedLsp({ ...input, owner: "gdh lsp restart" })
823
+ : command === "prune"
824
+ ? await pruneManagedLsp(input)
825
+ : await doctorManagedLsp(input);
826
+ io.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
827
+ return 0;
828
+ }
829
+ catch (error) {
830
+ io.stderr.write(`Failed to run lsp ${command} for "${targetPath}": ${formatCliError(error)}\n`);
831
+ return 1;
832
+ }
833
+ }
834
+ function describeLspLifecycleCommand(command) {
835
+ switch (command) {
836
+ case "check":
837
+ return "Check the persisted managed LSP instance without launching a new one.";
838
+ case "stop":
839
+ return "Stop the persisted GDH-managed LSP instance for this worktree.";
840
+ case "restart":
841
+ return "Stop and relaunch the managed LSP instance for this worktree.";
842
+ case "prune":
843
+ return "Remove stale managed LSP state without killing live unrelated processes.";
844
+ case "doctor":
845
+ return "Report lifecycle, transport, diagnostics, and cleanup guidance.";
846
+ }
847
+ }
774
848
  async function runWarmupCommand(args, io) {
775
849
  if (args.includes("--help")) {
776
850
  io.stdout.write([
@@ -791,7 +865,12 @@ async function runWarmupCommand(args, io) {
791
865
  const dryRun = args.includes("--dry-run");
792
866
  const { targetPath, error: targetPathError } = parseOptionalPositionalTargetPath(args, {
793
867
  usage: "Usage: gdh warmup [target] [--dry-run]\n",
794
- additionalOptionsWithValues: new Set(["--task-type", "--capability", "--repo-state", "--keyword"]),
868
+ additionalOptionsWithValues: new Set([
869
+ "--task-type",
870
+ "--capability",
871
+ "--repo-state",
872
+ "--keyword",
873
+ ]),
795
874
  });
796
875
  if (targetPathError !== null) {
797
876
  io.stderr.write(targetPathError);
@@ -1676,7 +1755,13 @@ async function runRecipeListCommand(args, io) {
1676
1755
  }
1677
1756
  const { targetPath, error: targetPathError } = parseOptionalPositionalTargetPath(args, {
1678
1757
  usage: "Usage: gdh run-config list [target]\n",
1679
- additionalOptionsWithValues: new Set(["--provider", "--param", "--feature", "--no-feature", "--env"]),
1758
+ additionalOptionsWithValues: new Set([
1759
+ "--provider",
1760
+ "--param",
1761
+ "--feature",
1762
+ "--no-feature",
1763
+ "--env",
1764
+ ]),
1680
1765
  });
1681
1766
  if (targetPathError !== null) {
1682
1767
  io.stderr.write(targetPathError);
@@ -1913,7 +1998,13 @@ async function runScenarioListCommand(args, io) {
1913
1998
  }
1914
1999
  const { targetPath, error: targetPathError } = parseOptionalPositionalTargetPath(args, {
1915
2000
  usage: "Usage: gdh verification-scenario list [target]\n",
1916
- additionalOptionsWithValues: new Set(["--provider", "--param", "--feature", "--no-feature", "--env"]),
2001
+ additionalOptionsWithValues: new Set([
2002
+ "--provider",
2003
+ "--param",
2004
+ "--feature",
2005
+ "--no-feature",
2006
+ "--env",
2007
+ ]),
1917
2008
  });
1918
2009
  if (targetPathError !== null) {
1919
2010
  io.stderr.write(targetPathError);
@@ -2490,7 +2581,8 @@ async function runVerifyRunCommand(args, io) {
2490
2581
  disabledFeatures: collectOptionValues(args, "--no-feature"),
2491
2582
  environment: collectAssignmentOptionValues(args, "--env"),
2492
2583
  workspaceMode: args.includes("--live-workspace") ? "live_workspace" : "isolated_copy",
2493
- screenshotCapture: args.includes("--rendered-screenshot") || readSingleOptionValue(args, "--provider") === "docker"
2584
+ screenshotCapture: args.includes("--rendered-screenshot") ||
2585
+ readSingleOptionValue(args, "--provider") === "docker"
2494
2586
  ? "rendered"
2495
2587
  : "never",
2496
2588
  });
@@ -2763,11 +2855,7 @@ async function runVerifyDriftCommand(args, io) {
2763
2855
  }
2764
2856
  const match = content.match(file.versionRegex ?? VERIFY_DRIFT_BAKED_VERSION_REGEX);
2765
2857
  const baked = match?.[1] ?? null;
2766
- const reason = baked === null
2767
- ? "no_baked_version"
2768
- : baked !== pinnedVersion
2769
- ? "version_mismatch"
2770
- : "ok";
2858
+ const reason = baked === null ? "no_baked_version" : baked !== pinnedVersion ? "version_mismatch" : "ok";
2771
2859
  return {
2772
2860
  relativePath: file.relativePath,
2773
2861
  description: file.description,
@@ -2997,7 +3085,12 @@ async function runCacheInspectCommand(args, io) {
2997
3085
  }
2998
3086
  const { targetPath, error: targetPathError } = parseOptionalPositionalTargetPath(args, {
2999
3087
  usage: "Usage: gdh cache inspect [target]\n",
3000
- additionalOptionsWithValues: new Set(["--task-type", "--capability", "--repo-state", "--keyword"]),
3088
+ additionalOptionsWithValues: new Set([
3089
+ "--task-type",
3090
+ "--capability",
3091
+ "--repo-state",
3092
+ "--keyword",
3093
+ ]),
3001
3094
  });
3002
3095
  if (targetPathError !== null) {
3003
3096
  io.stderr.write(targetPathError);
@@ -3104,7 +3197,12 @@ async function runGuidanceResolveCommand(args, io) {
3104
3197
  }
3105
3198
  const { targetPath, error: targetPathError } = parseOptionalPositionalTargetPath(args, {
3106
3199
  usage: "Usage: gdh guidance resolve [target] [--task-type <type>] [--capability <id>] [--repo-state <state>] [--keyword <term>]\n",
3107
- additionalOptionsWithValues: new Set(["--task-type", "--capability", "--repo-state", "--keyword"]),
3200
+ additionalOptionsWithValues: new Set([
3201
+ "--task-type",
3202
+ "--capability",
3203
+ "--repo-state",
3204
+ "--keyword",
3205
+ ]),
3108
3206
  });
3109
3207
  if (targetPathError !== null) {
3110
3208
  io.stderr.write(targetPathError);
@@ -3856,7 +3954,7 @@ function renderHelp() {
3856
3954
  " adapters install [target] [--dry-run] [--agent <name>] [--user] [--dev-repo <path>] [--integration-root <path>] Install or repair supported-agent reinforcement.",
3857
3955
  " adapters gsd snapshot [target] [--files <path>] [--performed <kind>] Export a read-only GSD projection.",
3858
3956
  " authoring check [target] Run the current authoring-check entrypoint.",
3859
- " lsp status [target] Resolve the managed authoring.lsp lifecycle state.",
3957
+ " lsp <status|check|stop|restart|prune|doctor> [target] Manage authoring.lsp lifecycle state.",
3860
3958
  " warmup [target] [--dry-run] Inspect or apply authoring worktree warmup.",
3861
3959
  " target prepare [target] [--source-target <path>] [--dry-run] Prepare target-local generated/import state.",
3862
3960
  " imports refresh [target] [--dry-run] Run or plan a headless Godot import refresh.",