@skillcap/gdh 0.26.4 → 0.26.6

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 (33) hide show
  1. package/INSTALL-BUNDLE.json +1 -1
  2. package/RELEASE-SPAN-UPDATE-CONTRACTS.json +117 -0
  3. package/node_modules/@gdh/adapters/dist/skill-rendering.js +2 -2
  4. package/node_modules/@gdh/adapters/dist/skill-rendering.js.map +1 -1
  5. package/node_modules/@gdh/adapters/dist/templates/authoring-hook.js.tpl +167 -45
  6. package/node_modules/@gdh/adapters/package.json +8 -8
  7. package/node_modules/@gdh/authoring/dist/index.d.ts +1 -1
  8. package/node_modules/@gdh/authoring/dist/index.d.ts.map +1 -1
  9. package/node_modules/@gdh/authoring/dist/index.js +86 -18
  10. package/node_modules/@gdh/authoring/dist/index.js.map +1 -1
  11. package/node_modules/@gdh/authoring/dist/scene-resource.d.ts.map +1 -1
  12. package/node_modules/@gdh/authoring/dist/scene-resource.js +15 -9
  13. package/node_modules/@gdh/authoring/dist/scene-resource.js.map +1 -1
  14. package/node_modules/@gdh/authoring/package.json +2 -2
  15. package/node_modules/@gdh/cli/dist/index.d.ts +3 -1
  16. package/node_modules/@gdh/cli/dist/index.d.ts.map +1 -1
  17. package/node_modules/@gdh/cli/dist/index.js +119 -36
  18. package/node_modules/@gdh/cli/dist/index.js.map +1 -1
  19. package/node_modules/@gdh/cli/package.json +10 -10
  20. package/node_modules/@gdh/core/dist/index.d.ts +3 -3
  21. package/node_modules/@gdh/core/dist/index.js +3 -3
  22. package/node_modules/@gdh/core/package.json +1 -1
  23. package/node_modules/@gdh/docs/dist/templates/guidance/authoring-and-validation.md.tpl +5 -4
  24. package/node_modules/@gdh/docs/package.json +2 -2
  25. package/node_modules/@gdh/mcp/package.json +8 -8
  26. package/node_modules/@gdh/observability/dist/guidance-audit.d.ts.map +1 -1
  27. package/node_modules/@gdh/observability/dist/guidance-audit.js +15 -2
  28. package/node_modules/@gdh/observability/dist/guidance-audit.js.map +1 -1
  29. package/node_modules/@gdh/observability/package.json +2 -2
  30. package/node_modules/@gdh/runtime/package.json +2 -2
  31. package/node_modules/@gdh/scan/package.json +3 -3
  32. package/node_modules/@gdh/verify/package.json +7 -7
  33. package/package.json +11 -11
@@ -5,17 +5,17 @@ import os from "node:os";
5
5
  import path from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
7
  import { buildGdhStatusResult, CLAUDE_CHECK_UPDATE_HOOK_RELATIVE_PATH, CLAUDE_MIGRATE_SKILL_RELATIVE_PATH, CLAUDE_ONBOARD_SKILL_RELATIVE_PATH, CLAUDE_PREPARE_SKILL_RELATIVE_PATH, CLAUDE_SCAN_SKILL_RELATIVE_PATH, CLAUDE_STATUS_SKILL_RELATIVE_PATH, CODEX_MIGRATE_SKILL_RELATIVE_PATH, CODEX_ONBOARD_SKILL_RELATIVE_PATH, CODEX_PREPARE_SKILL_RELATIVE_PATH, CODEX_SCAN_SKILL_RELATIVE_PATH, CODEX_STATUS_SKILL_RELATIVE_PATH, CURSOR_MIGRATE_COMMAND_RELATIVE_PATH, CURSOR_ONBOARD_COMMAND_RELATIVE_PATH, CURSOR_PREPARE_COMMAND_RELATIVE_PATH, CURSOR_SCAN_COMMAND_RELATIVE_PATH, CURSOR_STATUS_COMMAND_RELATIVE_PATH, createGsdSnapshot, getSupportedAgentAdaptersStatus, installSupportedAgentAdapters, } from "@gdh/adapters";
8
- import { checkManagedLsp, doctorAuthoringDiagnostics, doctorManagedLsp, getAuthoringDiagnosticsStatus, getCurrentAuthoringDiagnostics, getManagedLspStatus, hasCompleteOnboardingSurface, inspectCacheState, pruneCacheState, pruneAuthoringDiagnostics, pruneManagedLsp, readProjectConfig, readWorktreeState, refreshAuthoringDiagnostics, resolveAuthoringStatus, resolveEffectiveTargetPath, resolvePinnedVersion, resolveProjectRoot, resolveTargetGodotDocsVersion, restartManagedLsp, runAuthoringCheck, runImportRefresh, runTargetPrepare, runWarmup, stopManagedLsp, warmupManagedLsp, } from "@gdh/authoring";
8
+ import { checkManagedLsp, doctorAuthoringDiagnostics, doctorManagedLsp, getAuthoringDiagnosticsStatus, getCurrentAuthoringDiagnostics, getManagedLspStatus, hasCompleteOnboardingSurface, inspectCacheState, pruneAuthoringDiagnostics, pruneCacheState, pruneManagedLsp, readProjectConfig, readWorktreeState, refreshAuthoringDiagnostics, resolveAuthoringStatus, resolveEffectiveTargetPath, resolvePinnedVersion, resolveProjectRoot, resolveTargetGodotDocsVersion, restartManagedLsp, runAuthoringCheck, runImportRefresh, runTargetPrepare, runWarmup, stopManagedLsp, warmupManagedLsp, } 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";
12
12
  import { inspectAuthoringEffectiveness, inspectAuthoringSessions, inspectGuidanceAudit, recordAuthoringSessionEvent, } from "@gdh/observability";
13
- import { checkRuntimeRecipe, createRuntimeBridgeManager, serveRuntimeBridgeBroker, inspectRuntimeBridgeSurface, installRuntimeBridgeSurface, listRuntimeRecipes, removeRuntimeBridgeSurface, repairRuntimeBridgeSurface, runRuntimeRecipe, showRuntimeRecipe, } from "@gdh/runtime";
13
+ import { checkRuntimeRecipe, createRuntimeBridgeManager, inspectRuntimeBridgeSurface, installRuntimeBridgeSurface, listRuntimeRecipes, removeRuntimeBridgeSurface, repairRuntimeBridgeSurface, runRuntimeRecipe, serveRuntimeBridgeBroker, showRuntimeRecipe, } from "@gdh/runtime";
14
14
  import { applyRepairableOnboardingWrites, onboardGodotProject, persistInventoryForTarget, readInventoryCacheOrScan, scanGodotProjectInventory, } from "@gdh/scan";
15
15
  import { exerciseRuntimeCorpusEntry, inspectRuntimeCorpusStatus, inspectRuntimeVerificationBundleState, inspectRuntimeVerificationReadiness, listRuntimeScenarios, materializeRuntimeCorpusEntry, recordRuntimeCorpusValidation, runRuntimeVerificationScenario, showRuntimeScenario, } from "@gdh/verify";
16
- import { clearEnvelope, clearMigrationBackups, migrateProjectLifecycleSurface, recordEnvelopeResult, } from "./migrate.js";
17
16
  import { runBridgeSessionCommand } from "./bridge-session.js";
18
17
  import { cleanupGdhMcpProcesses } from "./mcp-cleanup.js";
18
+ import { clearEnvelope, clearMigrationBackups, migrateProjectLifecycleSurface, recordEnvelopeResult, } from "./migrate.js";
19
19
  import { presentPublicRuntimeTerms } from "./public-terms.js";
20
20
  import { runSelfUpdateCommand as runSelfUpdateCommandImpl } from "./self-update.js";
21
21
  /**
@@ -183,9 +183,26 @@ async function runInternalBrokerServeCommand(args, io) {
183
183
  }
184
184
  }
185
185
  export function writeJsonResult(io, value, options = {}) {
186
- const output = options.presentRuntimeTerms ? presentPublicRuntimeTerms(value) : value;
186
+ const runtimeOutput = options.presentRuntimeTerms ? presentPublicRuntimeTerms(value) : value;
187
+ const output = options.omitRawPayloads ? omitRawPayloads(runtimeOutput) : runtimeOutput;
187
188
  io.stdout.write(`${JSON.stringify(output, null, 2)}\n`);
188
189
  }
190
+ function omitRawPayloads(value) {
191
+ if (Array.isArray(value)) {
192
+ return value.map((entry) => omitRawPayloads(entry));
193
+ }
194
+ if (value === null || typeof value !== "object") {
195
+ return value;
196
+ }
197
+ const output = {};
198
+ for (const [key, child] of Object.entries(value)) {
199
+ if (key === "rawPayload") {
200
+ continue;
201
+ }
202
+ output[key] = omitRawPayloads(child);
203
+ }
204
+ return output;
205
+ }
189
206
  async function runScanCommand(args, io) {
190
207
  if (args.includes("--help")) {
191
208
  io.stdout.write([
@@ -466,16 +483,17 @@ async function runOnboardCommand(args, io) {
466
483
  async function runStatusCommand(args, io) {
467
484
  if (args.includes("--help")) {
468
485
  io.stdout.write([
469
- "Usage: gdh status [target]",
470
- "Usage: gdh status --target <path>",
486
+ "Usage: gdh status [target] [--json]",
487
+ "Usage: gdh status --target <path> [--json]",
471
488
  "",
472
489
  "Report explicit GDH readiness and capability availability for a target as JSON.",
473
490
  ].join("\n") + "\n");
474
491
  return 0;
475
492
  }
476
493
  const parsedTarget = parseSingleTargetPathArg(args, {
477
- usage: "Usage: gdh status [target]\nUsage: gdh status --target <path>\n",
494
+ usage: "Usage: gdh status [target] [--json]\nUsage: gdh status --target <path> [--json]\n",
478
495
  allowTargetOption: true,
496
+ booleanOptions: ["--json"],
479
497
  });
480
498
  if (parsedTarget.error !== null) {
481
499
  io.stderr.write(parsedTarget.error);
@@ -666,20 +684,8 @@ async function runAuthoringDiagnosticsRefreshCommand(args, io) {
666
684
  io.stdout.write(`${usage}\n`);
667
685
  return 0;
668
686
  }
669
- // Collect --changed values (may be repeated)
670
- const changedFiles = [];
671
- const filteredArgs = [];
672
- let i = 0;
673
- while (i < args.length) {
674
- if (args[i] === "--changed" && i + 1 < args.length) {
675
- changedFiles.push(args[i + 1]);
676
- i += 2;
677
- }
678
- else {
679
- filteredArgs.push(args[i]);
680
- i += 1;
681
- }
682
- }
687
+ const changedFiles = collectVariadicOptionValues(args, "--changed");
688
+ const filteredArgs = stripVariadicOptions(args, new Set(["--changed"]));
683
689
  const parsedTarget = parseSingleTargetPathArg(filteredArgs, {
684
690
  usage: `${usage}\n`,
685
691
  allowTargetOption: true,
@@ -926,12 +932,12 @@ async function runDocsFetchCommand(args, io) {
926
932
  }
927
933
  async function runAuthoringCheckCommand(args, io) {
928
934
  const usage = [
929
- "Usage: gdh authoring check [target] [--mode final|post-edit] [--changed <path>...] [--severity-policy errors|all] [--format json|compact]",
930
- "Usage: gdh authoring check --target <path> [--mode final|post-edit] [--changed <path>...] [--severity-policy errors|all] [--format json|compact]",
935
+ "Usage: gdh authoring check [target] [--mode final|post-edit] [--changed <path>...] [--severity-policy errors|all] [--format json|compact] [--json]",
936
+ "Usage: gdh authoring check --target <path> [--mode final|post-edit] [--changed <path>...] [--severity-policy errors|all] [--format json|compact] [--json]",
931
937
  "",
932
938
  "Run GDH authoring validation and print structured JSON by default.",
933
939
  "Use --mode post-edit with --changed for fast scoped feedback after edits.",
934
- "Use --mode final before claiming code-validity for task completion.",
940
+ "Use --mode final without --changed before claiming code-validity for task completion.",
935
941
  ].join("\n");
936
942
  if (args.includes("--help")) {
937
943
  io.stdout.write(`${usage}\n`);
@@ -974,7 +980,7 @@ async function runAuthoringCheckCommand(args, io) {
974
980
  io.stdout.write(formatCompactAuthoringCheckResult(result));
975
981
  }
976
982
  else {
977
- writeJsonResult(io, result, { presentRuntimeTerms: true });
983
+ writeJsonResult(io, result, { presentRuntimeTerms: true, omitRawPayloads: true });
978
984
  }
979
985
  return 0;
980
986
  }
@@ -993,9 +999,11 @@ async function runAuthoringCheckCommand(args, io) {
993
999
  }
994
1000
  function parseAuthoringCheckArgs(args, usage) {
995
1001
  const optionNames = new Set(["--target", "--mode", "--changed", "--severity-policy", "--format"]);
1002
+ const variadicOptionNames = new Set(["--changed"]);
996
1003
  const unsupportedOptionsError = findUnsupportedOptionsError(args, {
997
1004
  usage,
998
1005
  optionsWithValues: [...optionNames],
1006
+ booleanOptions: ["--json"],
999
1007
  });
1000
1008
  if (unsupportedOptionsError !== null) {
1001
1009
  return {
@@ -1020,7 +1028,7 @@ function parseAuthoringCheckArgs(args, usage) {
1020
1028
  }
1021
1029
  }
1022
1030
  const targetOptionValue = readSingleOptionValue(args, "--target");
1023
- const positionalArgs = extractPositionalArgs(args, optionNames);
1031
+ const positionalArgs = extractPositionalArgs(args, optionNames, variadicOptionNames);
1024
1032
  if (positionalArgs.length > 1) {
1025
1033
  return {
1026
1034
  targetPath: path.resolve("."),
@@ -1053,6 +1061,20 @@ function parseAuthoringCheckArgs(args, usage) {
1053
1061
  error: `Usage error: --mode must be final or post-edit.\n${usage}`,
1054
1062
  };
1055
1063
  }
1064
+ const changedFiles = collectVariadicOptionValues(args, "--changed");
1065
+ if (mode === "final" && changedFiles.length > 0) {
1066
+ return {
1067
+ targetPath: path.resolve("."),
1068
+ mode: "final",
1069
+ changedFiles: [],
1070
+ severityPolicy: "errors",
1071
+ outputFormat: "json",
1072
+ error: "Usage error: --changed is only scoped in --mode post-edit. " +
1073
+ "Run `gdh authoring check --mode final` without --changed for full handoff evidence, " +
1074
+ "or `gdh authoring check --mode post-edit --changed <path>...` for changed-file feedback.\n" +
1075
+ usage,
1076
+ };
1077
+ }
1056
1078
  const severityPolicyValue = readSingleOptionValue(args, "--severity-policy") ?? "errors";
1057
1079
  const severityPolicy = severityPolicyValue === "errors" || severityPolicyValue === "all" ? severityPolicyValue : null;
1058
1080
  if (severityPolicy === null) {
@@ -1065,7 +1087,19 @@ function parseAuthoringCheckArgs(args, usage) {
1065
1087
  error: `Usage error: --severity-policy must be errors or all.\n${usage}`,
1066
1088
  };
1067
1089
  }
1068
- const outputFormatValue = readSingleOptionValue(args, "--format") ?? "json";
1090
+ if (args.includes("--json") && readSingleOptionValue(args, "--format") === "compact") {
1091
+ return {
1092
+ targetPath: path.resolve("."),
1093
+ mode: "final",
1094
+ changedFiles: [],
1095
+ severityPolicy: "errors",
1096
+ outputFormat: "json",
1097
+ error: `Usage error: choose either --json or --format compact.\n${usage}`,
1098
+ };
1099
+ }
1100
+ const outputFormatValue = args.includes("--json")
1101
+ ? "json"
1102
+ : (readSingleOptionValue(args, "--format") ?? "json");
1069
1103
  const outputFormat = outputFormatValue === "json" || outputFormatValue === "compact" ? outputFormatValue : null;
1070
1104
  if (outputFormat === null) {
1071
1105
  return {
@@ -1080,7 +1114,7 @@ function parseAuthoringCheckArgs(args, usage) {
1080
1114
  return {
1081
1115
  targetPath: path.resolve(targetOptionValue ?? positionalArgs[0] ?? "."),
1082
1116
  mode,
1083
- changedFiles: collectOptionValues(args, "--changed"),
1117
+ changedFiles,
1084
1118
  severityPolicy,
1085
1119
  outputFormat,
1086
1120
  error: null,
@@ -1134,11 +1168,7 @@ function formatCompactAuthoringCheckResult(result) {
1134
1168
  // via the hook template (timedOut branch) and via upstream broker paths
1135
1169
  // that produce non-GdhAuthoringCompletionState results — not via this
1136
1170
  // compact formatter, which only sees allowed | blocked | unconfirmed.
1137
- const statusToken = summary.state === "blocked"
1138
- ? "failed"
1139
- : summary.state === "unconfirmed"
1140
- ? "pending"
1141
- : "fresh";
1171
+ const statusToken = summary.state === "blocked" ? "failed" : summary.state === "unconfirmed" ? "pending" : "fresh";
1142
1172
  lines.push(`[${statusToken}] ${summary.errorCount} errors, ${summary.warningCount} warnings, ${summary.infoCount} info.`);
1143
1173
  if (summary.reasons.length > 0) {
1144
1174
  lines.push(`Reasons: ${summary.reasons.join(", ")}`);
@@ -1267,7 +1297,7 @@ async function runLspLifecycleCommand(command, args, io) {
1267
1297
  : command === "prune"
1268
1298
  ? await pruneManagedLsp(input)
1269
1299
  : await doctorManagedLsp(input);
1270
- io.stdout.write(`${JSON.stringify(result, null, 2)}\n`);
1300
+ writeJsonResult(io, result, { omitRawPayloads: command === "stop" });
1271
1301
  return 0;
1272
1302
  }
1273
1303
  catch (error) {
@@ -2128,7 +2158,7 @@ async function runMigrationRecordEnvelopeResultCommand(args, io) {
2128
2158
  "Record a Phase 73 envelope output_contract block. Validates against the",
2129
2159
  "GdhMigrationEnvelopeOutput typed union (apply / abort / needs_clarification);",
2130
2160
  "appends to migration.json.envelopes[<slug>] and migration.json.envelopes[<slug>].attempts[].",
2131
- 'Does NOT advance the chain — re-run `gdh self-update` after recording.',
2161
+ "Does NOT advance the chain — re-run `gdh self-update` after recording.",
2132
2162
  "",
2133
2163
  'Exits 0 on { state: "recorded" }, 1 on { state: "blocked" }.',
2134
2164
  ].join("\n") + "\n");
@@ -4540,6 +4570,48 @@ function collectOptionValues(args, optionName) {
4540
4570
  }
4541
4571
  return values;
4542
4572
  }
4573
+ function collectVariadicOptionValues(args, optionName) {
4574
+ const values = [];
4575
+ for (let index = 0; index < args.length; index += 1) {
4576
+ if (args[index] !== optionName) {
4577
+ continue;
4578
+ }
4579
+ index += 1;
4580
+ while (index < args.length) {
4581
+ const value = args[index];
4582
+ if (!value || value.startsWith("--")) {
4583
+ index -= 1;
4584
+ break;
4585
+ }
4586
+ values.push(value);
4587
+ index += 1;
4588
+ }
4589
+ }
4590
+ return values;
4591
+ }
4592
+ function stripVariadicOptions(args, variadicOptions) {
4593
+ const filteredArgs = [];
4594
+ for (let index = 0; index < args.length; index += 1) {
4595
+ const arg = args[index];
4596
+ if (!arg) {
4597
+ continue;
4598
+ }
4599
+ if (!variadicOptions.has(arg)) {
4600
+ filteredArgs.push(arg);
4601
+ continue;
4602
+ }
4603
+ index += 1;
4604
+ while (index < args.length) {
4605
+ const value = args[index];
4606
+ if (!value || value.startsWith("--")) {
4607
+ index -= 1;
4608
+ break;
4609
+ }
4610
+ index += 1;
4611
+ }
4612
+ }
4613
+ return filteredArgs;
4614
+ }
4543
4615
  function collectAssignmentOptionValues(args, optionName) {
4544
4616
  const assignments = {};
4545
4617
  for (const value of collectOptionValues(args, optionName)) {
@@ -4585,6 +4657,7 @@ export function parseSingleTargetPathArg(args, options) {
4585
4657
  const unsupportedOptionsError = findUnsupportedOptionsError(args, {
4586
4658
  usage: options.usage,
4587
4659
  optionsWithValues: allowTargetOption ? ["--target"] : [],
4660
+ booleanOptions: options.booleanOptions ?? [],
4588
4661
  });
4589
4662
  if (unsupportedOptionsError !== null) {
4590
4663
  return {
@@ -4719,7 +4792,7 @@ function deriveGuidanceRepoState(context) {
4719
4792
  function extractRecipePositionalArgs(args) {
4720
4793
  return extractPositionalArgs(args, new Set(["--provider", "--param", "--feature", "--no-feature", "--env"]));
4721
4794
  }
4722
- export function extractPositionalArgs(args, optionsWithValues) {
4795
+ export function extractPositionalArgs(args, optionsWithValues, variadicOptionsWithValues = new Set()) {
4723
4796
  const positionalArgs = [];
4724
4797
  for (let index = 0; index < args.length; index += 1) {
4725
4798
  const arg = args[index];
@@ -4727,6 +4800,16 @@ export function extractPositionalArgs(args, optionsWithValues) {
4727
4800
  continue;
4728
4801
  }
4729
4802
  if (optionsWithValues.has(arg)) {
4803
+ if (variadicOptionsWithValues.has(arg)) {
4804
+ while (index + 1 < args.length) {
4805
+ const value = args[index + 1];
4806
+ if (!value || value.startsWith("--")) {
4807
+ break;
4808
+ }
4809
+ index += 1;
4810
+ }
4811
+ continue;
4812
+ }
4730
4813
  index += 1;
4731
4814
  continue;
4732
4815
  }