@opengsd/gsd-core 1.4.0-rc.1 → 1.4.0-rc.2

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 (54) hide show
  1. package/.claude-plugin/plugin.json +23 -0
  2. package/GEMINI.md +53 -0
  3. package/agents/gsd-ai-researcher.md +1 -1
  4. package/agents/gsd-code-fixer.md +1 -1
  5. package/agents/gsd-code-reviewer.md +1 -1
  6. package/agents/gsd-domain-researcher.md +1 -1
  7. package/agents/gsd-eval-auditor.md +1 -1
  8. package/agents/gsd-eval-planner.md +1 -1
  9. package/agents/gsd-framework-selector.md +1 -1
  10. package/agents/gsd-nyquist-auditor.md +1 -1
  11. package/agents/gsd-pattern-mapper.md +1 -1
  12. package/agents/gsd-security-auditor.md +1 -1
  13. package/agents/gsd-ui-auditor.md +1 -1
  14. package/agents/gsd-ui-checker.md +1 -1
  15. package/agents/gsd-ui-researcher.md +1 -1
  16. package/agents/gsd-user-profiler.md +1 -1
  17. package/bin/install.js +1911 -354
  18. package/commands/gsd/autonomous.md +2 -0
  19. package/commands/gsd/execute-phase.md +2 -0
  20. package/commands/gsd/plan-phase.md +2 -0
  21. package/commands/gsd/progress.md +1 -0
  22. package/commands/gsd/stats.md +1 -0
  23. package/commands/gsd/update.md +3 -2
  24. package/gemini-extension.json +6 -0
  25. package/gsd-core/bin/check-latest-version.cjs +58 -4
  26. package/gsd-core/bin/lib/install-profiles.cjs +58 -0
  27. package/gsd-core/bin/lib/installer-migration-report.cjs +3 -0
  28. package/gsd-core/bin/lib/installer-migrations/000-first-time-baseline.cjs +1 -1
  29. package/gsd-core/bin/lib/runtime-artifact-layout.cjs +67 -9
  30. package/gsd-core/bin/lib/runtime-config-adapter-registry.cjs +56 -0
  31. package/gsd-core/bin/lib/runtime-homes.cjs +32 -11
  32. package/gsd-core/bin/lib/shell-command-projection.cjs +6 -0
  33. package/gsd-core/bin/lib/surface.cjs +54 -11
  34. package/gsd-core/workflows/help/modes/full.md +2 -1
  35. package/gsd-core/workflows/review.md +2 -2
  36. package/gsd-core/workflows/update.md +32 -5
  37. package/hooks/dist/gsd-config-reload.js +133 -0
  38. package/hooks/dist/gsd-cursor-post-tool.js +75 -0
  39. package/hooks/dist/gsd-cursor-session-start.js +52 -0
  40. package/hooks/dist/managed-hooks-registry.cjs +3 -0
  41. package/hooks/gsd-config-reload.js +133 -0
  42. package/hooks/gsd-cursor-post-tool.js +75 -0
  43. package/hooks/gsd-cursor-session-start.js +52 -0
  44. package/hooks/hooks.json +69 -0
  45. package/hooks/managed-hooks-registry.cjs +3 -0
  46. package/package.json +5 -1
  47. package/scripts/build-hooks.js +7 -0
  48. package/scripts/changeset/cli.cjs +53 -10
  49. package/scripts/ci-test-scope.cjs +120 -18
  50. package/scripts/issue-dedupe.cjs +278 -0
  51. package/scripts/lint-test-file-count.allowlist.json +1 -0
  52. package/scripts/release-notes/discord-release-summary.cjs +373 -0
  53. package/scripts/research-profiles.cjs +3 -3
  54. package/scripts/sync-manifest-versions.cjs +119 -0
@@ -0,0 +1,119 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ /**
5
+ * sync-manifest-versions.cjs
6
+ *
7
+ * Stamps the package.json version into every runtime-integration manifest whose
8
+ * top-level `version` field MUST track the package version. Called automatically
9
+ * by the `version` npm lifecycle script so that `npm version X.Y.Z` keeps all
10
+ * registered manifests in sync.
11
+ *
12
+ * Usage:
13
+ * node scripts/sync-manifest-versions.cjs # stamp + report
14
+ * node scripts/sync-manifest-versions.cjs --stage # stamp + git-stage manifests
15
+ * node scripts/sync-manifest-versions.cjs --check # report drift, exit 1 if any
16
+ */
17
+
18
+ const fs = require('fs');
19
+ const path = require('path');
20
+ const { execFileSync } = require('child_process');
21
+
22
+ const ROOT = path.resolve(__dirname, '..');
23
+
24
+ // Single source of truth: runtime-integration manifests whose top-level `version`
25
+ // MUST track package.json. Add a new manifest here so `npm version` keeps it in
26
+ // sync — the regression guard test (issue 844) fails if you forget.
27
+ const VERSIONED_MANIFESTS = [
28
+ '.claude-plugin/plugin.json',
29
+ 'gemini-extension.json',
30
+ ];
31
+
32
+ function readJson(p) {
33
+ return JSON.parse(fs.readFileSync(p, 'utf8'));
34
+ }
35
+
36
+ function getPackageVersion(root) {
37
+ const r = root || ROOT;
38
+ return readJson(path.join(r, 'package.json')).version;
39
+ }
40
+
41
+ // Stamp `version` into each registered manifest, preserving field order and
42
+ // 2-space + trailing-newline formatting. Returns the list of changed rel paths.
43
+ function syncManifestVersions(opts) {
44
+ const root = (opts && opts.root) || ROOT;
45
+ const v = (opts && opts.version) != null ? opts.version : getPackageVersion(root);
46
+ const changed = [];
47
+ for (const rel of VERSIONED_MANIFESTS) {
48
+ const abs = path.join(root, rel);
49
+ const manifest = readJson(abs);
50
+ if (manifest.version !== v) {
51
+ manifest.version = v;
52
+ fs.writeFileSync(abs, JSON.stringify(manifest, null, 2) + '\n');
53
+ changed.push(rel);
54
+ }
55
+ }
56
+ return changed;
57
+ }
58
+
59
+ // Registered manifests whose version != package version.
60
+ function findDrift(opts) {
61
+ const root = (opts && opts.root) || ROOT;
62
+ const v = (opts && opts.version) != null ? opts.version : getPackageVersion(root);
63
+ const drift = [];
64
+ for (const rel of VERSIONED_MANIFESTS) {
65
+ const found = readJson(path.join(root, rel)).version;
66
+ if (found !== v) drift.push({ manifest: rel, found, expected: v });
67
+ }
68
+ return drift;
69
+ }
70
+
71
+ // Best-effort outside git; fail-closed inside a work tree so a release never
72
+ // ships a stale manifest that the working-tree test already accepted.
73
+ function stageManifests(opts) {
74
+ const root = (opts && opts.root) || ROOT;
75
+ let insideWorkTree = false;
76
+ try {
77
+ insideWorkTree = execFileSync('git', ['rev-parse', '--is-inside-work-tree'], {
78
+ cwd: root,
79
+ stdio: ['ignore', 'pipe', 'ignore'],
80
+ }).toString().trim() === 'true';
81
+ } catch {}
82
+ if (!insideWorkTree) {
83
+ console.warn('sync-manifest-versions: not a git work tree; skipping staging.');
84
+ return;
85
+ }
86
+ try {
87
+ execFileSync('git', ['add', '--', ...VERSIONED_MANIFESTS], { cwd: root, stdio: ['ignore', 'ignore', 'pipe'] });
88
+ } catch (err) {
89
+ const detail = err && err.stderr ? err.stderr.toString().trim() : (err && err.message) || 'unknown error';
90
+ throw new Error(`sync-manifest-versions: failed to git-add manifests inside a work tree: ${detail}`);
91
+ }
92
+ }
93
+
94
+ module.exports = { VERSIONED_MANIFESTS, syncManifestVersions, findDrift, getPackageVersion, stageManifests };
95
+
96
+ if (require.main === module) {
97
+ const args = process.argv.slice(2);
98
+ const version = getPackageVersion();
99
+ if (args.includes('--check')) {
100
+ const drift = findDrift({ version });
101
+ if (drift.length) {
102
+ for (const d of drift) {
103
+ console.error('Manifest ' + d.manifest + ' version ' + d.found + ' != package.json ' + d.expected);
104
+ }
105
+ console.error('Run `node scripts/sync-manifest-versions.cjs` to fix.');
106
+ process.exitCode = 1;
107
+ } else {
108
+ console.log('All ' + VERSIONED_MANIFESTS.length + ' versioned manifests in sync at ' + version + '.');
109
+ }
110
+ } else {
111
+ const changed = syncManifestVersions({ version });
112
+ if (changed.length) {
113
+ console.log('Stamped ' + version + ' into: ' + changed.join(', '));
114
+ } else {
115
+ console.log('Versioned manifests already at ' + version + '.');
116
+ }
117
+ if (args.includes('--stage')) stageManifests();
118
+ }
119
+ }