@opengsd/gsd-core 1.7.0-rc.5 → 1.7.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 (112) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/agents/gsd-executor.md +2 -1
  4. package/agents/gsd-security-auditor.md +13 -15
  5. package/agents/gsd-ui-checker.md +2 -0
  6. package/agents/gsd-ui-researcher.md +1 -0
  7. package/bin/install.js +975 -196
  8. package/commands/gsd/mempalace-capture.md +27 -1
  9. package/commands/gsd/surface.md +6 -6
  10. package/gsd-core/bin/gsd-tools.cjs +63 -2
  11. package/gsd-core/bin/lib/api-coverage.cjs +3 -4
  12. package/gsd-core/bin/lib/audit.cjs +7 -6
  13. package/gsd-core/bin/lib/capability-registry.cjs +503 -87
  14. package/gsd-core/bin/lib/capability-validator.cjs +56 -18
  15. package/gsd-core/bin/lib/check-command-router.cjs +1 -1
  16. package/gsd-core/bin/lib/clock.cjs +19 -0
  17. package/gsd-core/bin/lib/commands.cjs +48 -9
  18. package/gsd-core/bin/lib/config-loader.cjs +6 -2
  19. package/gsd-core/bin/lib/config.cjs +12 -0
  20. package/gsd-core/bin/lib/core-utils.cjs +8 -2
  21. package/gsd-core/bin/lib/drift.cjs +4 -4
  22. package/gsd-core/bin/lib/frontmatter.cjs +22 -0
  23. package/gsd-core/bin/lib/gsd2-import.cjs +2 -1
  24. package/gsd-core/bin/lib/host-integration.cjs +33 -8
  25. package/gsd-core/bin/lib/init.cjs +60 -53
  26. package/gsd-core/bin/lib/install-engine.cjs +93 -22
  27. package/gsd-core/bin/lib/installer-migration-authoring.cjs +2 -1
  28. package/gsd-core/bin/lib/installer-migration-report.cjs +3 -0
  29. package/gsd-core/bin/lib/installer-migrations.cjs +1 -1
  30. package/gsd-core/bin/lib/markdown-sectionizer.cjs +342 -0
  31. package/gsd-core/bin/lib/markdown-table.cjs +698 -0
  32. package/gsd-core/bin/lib/mcp-server.cjs +18 -7
  33. package/gsd-core/bin/lib/milestone.cjs +217 -31
  34. package/gsd-core/bin/lib/phase-command-router.cjs +50 -2
  35. package/gsd-core/bin/lib/phase-lifecycle.cjs +62 -36
  36. package/gsd-core/bin/lib/phase-locator.cjs +23 -2
  37. package/gsd-core/bin/lib/phase.cjs +436 -61
  38. package/gsd-core/bin/lib/plan-scan.cjs +3 -0
  39. package/gsd-core/bin/lib/review-reviewer-selection.cjs +24 -7
  40. package/gsd-core/bin/lib/roadmap-parser.cjs +218 -13
  41. package/gsd-core/bin/lib/roadmap.cjs +100 -49
  42. package/gsd-core/bin/lib/runtime-artifact-conversion.cjs +242 -44
  43. package/gsd-core/bin/lib/runtime-artifact-install-plan.cjs +3 -2
  44. package/gsd-core/bin/lib/runtime-artifact-layout.cjs +24 -14
  45. package/gsd-core/bin/lib/runtime-config-adapter-registry.cjs +19 -5
  46. package/gsd-core/bin/lib/runtime-homes.cjs +22 -0
  47. package/gsd-core/bin/lib/runtime-hooks-surface.cjs +526 -29
  48. package/gsd-core/bin/lib/runtime-name-policy.cjs +63 -5
  49. package/gsd-core/bin/lib/schema-detect.cjs +2 -1
  50. package/gsd-core/bin/lib/security.cjs +7 -37
  51. package/gsd-core/bin/lib/shell-command-projection.cjs +176 -27
  52. package/gsd-core/bin/lib/smart-entry.cjs +4 -3
  53. package/gsd-core/bin/lib/stale-bake-guard.cjs +30 -10
  54. package/gsd-core/bin/lib/state-transition.cjs +100 -45
  55. package/gsd-core/bin/lib/state.cjs +391 -126
  56. package/gsd-core/bin/lib/surface.cjs +12 -8
  57. package/gsd-core/bin/lib/template.cjs +2 -1
  58. package/gsd-core/bin/lib/uat.cjs +54 -8
  59. package/gsd-core/bin/lib/ui-consideration-probe.cjs +249 -0
  60. package/gsd-core/bin/lib/ui-safety-gate.cjs +23 -1
  61. package/gsd-core/bin/lib/verify.cjs +4 -3
  62. package/gsd-core/bin/lib/workstream.cjs +3 -2
  63. package/gsd-core/bin/lib/worktree-safety.cjs +1 -1
  64. package/gsd-core/bin/lib/write-set.cjs +38 -0
  65. package/gsd-core/bin/shared/config-schema.manifest.json +2 -0
  66. package/gsd-core/bin/shared/model-catalog.json +8 -3
  67. package/gsd-core/references/checkpoints.md +12 -0
  68. package/gsd-core/references/ui-consideration-probe.md +73 -0
  69. package/gsd-core/templates/UI-SPEC.md +25 -0
  70. package/gsd-core/templates/VALIDATION.md +2 -0
  71. package/gsd-core/workflows/add-tests.md +1 -1
  72. package/gsd-core/workflows/audit-milestone.md +7 -4
  73. package/gsd-core/workflows/debug.md +2 -0
  74. package/gsd-core/workflows/execute-phase.md +5 -3
  75. package/gsd-core/workflows/fast.md +8 -22
  76. package/gsd-core/workflows/plan-phase.md +6 -0
  77. package/gsd-core/workflows/progress.md +2 -2
  78. package/gsd-core/workflows/quick.md +2 -0
  79. package/gsd-core/workflows/review.md +42 -3
  80. package/gsd-core/workflows/secure-phase.md +1 -1
  81. package/gsd-core/workflows/settings-advanced.md +7 -4
  82. package/gsd-core/workflows/ship.md +8 -2
  83. package/gsd-core/workflows/spec-phase.md +1 -1
  84. package/gsd-core/workflows/transition.md +1 -1
  85. package/gsd-core/workflows/ui-phase.md +146 -1
  86. package/gsd-core/workflows/validate-phase.md +2 -2
  87. package/hooks/dist/gsd-statusline.js +164 -14
  88. package/hooks/dist/gsd-windsurf-pre-command.js +275 -0
  89. package/hooks/dist/gsd-windsurf-pre-write.js +132 -0
  90. package/hooks/dist/managed-hooks-registry.cjs +2 -0
  91. package/hooks/gsd-statusline.js +164 -14
  92. package/hooks/gsd-windsurf-pre-command.js +275 -0
  93. package/hooks/gsd-windsurf-pre-write.js +132 -0
  94. package/hooks/managed-hooks-registry.cjs +2 -0
  95. package/package.json +10 -4
  96. package/pi/gsd.cjs +354 -0
  97. package/scripts/build-hooks.js +3 -0
  98. package/scripts/ci-test-scope.cjs +39 -1
  99. package/scripts/gen-golden-install-parity-zcode.cjs +35 -35
  100. package/scripts/gen-install-tree-fixtures.cjs +75 -0
  101. package/scripts/gen-registry.cjs +128 -0
  102. package/scripts/lint-allow-test-rule-refs.allowlist.json +0 -1
  103. package/scripts/lint-table-schema-drift.cjs +157 -0
  104. package/scripts/lint-test-file-count.allowlist.json +2 -1
  105. package/scripts/registry-schema.cjs +565 -0
  106. package/scripts/validate-registry.cjs +117 -0
  107. package/skills/gsd-mempalace-capture/SKILL.md +27 -1
  108. package/skills/gsd-surface/SKILL.md +6 -6
  109. package/vscode/browser.js +197 -0
  110. package/vscode/extension.js +383 -0
  111. package/vscode/host-binding.js +113 -0
  112. package/vscode/package.json +96 -0
@@ -0,0 +1,113 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * VS Code IDE host binding for GSD (ADR-1239 Phase D / #1933, shipped #2103).
5
+ *
6
+ * VS Code is the IDE-profile reference host. This module composes the Phase-3
7
+ * engine seams for the negotiated `ide` profile (host-integration.cts
8
+ * PROFILE_BASELINES):
9
+ *
10
+ * - modelMode: 'active' → createModelAdapter({modelMode:'active'}, {sendRequest})
11
+ * backed by `vscode.lm` (LanguageModelChat). There is NO
12
+ * `vscode.lm.sendRequest` — the real API is
13
+ * `const [model] = await vscode.lm.selectChatModels(selector?);
14
+ * const response = await model.sendRequest(messages, options?, token?);`
15
+ * (Context7-verified #2103). The injected `sendRequest` wrapper
16
+ * below selects a model on every call and delegates to IT. VS Code
17
+ * rejects system-role messages, so the request mapper uses User
18
+ * role only.
19
+ * - hookBus: 'engine' → createHookBus({bus:'engine'}) — VS Code has NO host event bus,
20
+ * so GSD owns the bus in-process (full subscribe + emit).
21
+ * - stateIO: 'sandboxed-storage' → createStateIO({io:'sandboxed-storage'}, {backend}) bound to a
22
+ * host-supplied storage (no arbitrary FS — web/no-child_process safe
23
+ * AT THE STATE-IO SEAM ITSELF; see the DESKTOP-ONLY note below for
24
+ * why the module as a WHOLE is not safe to require from browser.js).
25
+ * - embeddingMode: 'imperative' → createImperativeAdapter({runtime:'vscode'}) — engine-as-library.
26
+ *
27
+ * Distribution: VS Code is shipped as an EXTENSION (Marketplace), NOT file-projected onto a
28
+ * config dir, so it intentionally has NO runtime descriptor / `--vscode` installer entry — the
29
+ * extension IS the host. This module is the binding `vscode/extension.js` (the Node/desktop
30
+ * `main` entry) runs in activate().
31
+ *
32
+ * DESKTOP-ONLY (#2103 finding — do NOT require this from vscode/browser.js):
33
+ * despite the per-seam design above being conceptually host-agnostic, the CONCRETE engine-lib
34
+ * modules this file requires are NOT web-safe today — each pulls in Node's `fs`/`os`/`path`
35
+ * at module-load time (eagerly, regardless of which code path actually runs):
36
+ * - gsd-core/bin/lib/state-io.cjs → requires 'node:fs' directly.
37
+ * - gsd-core/bin/lib/adapter-imperative.cjs → requires install-engine.cjs (fs/os/path) and
38
+ * capability-loader.cjs (fs/os/path).
39
+ * - gsd-core/bin/lib/model-adapter.cjs → requires model-resolver.cjs → config-loader.cjs
40
+ * (fs/os/path) and configuration.cjs (fs/path).
41
+ * - gsd-core/bin/lib/hook-bus.cjs → no requires; this one alone is web-safe.
42
+ * In a real VS Code Web Extension host (webworker context) `require('node:fs')` does not
43
+ * resolve — activation would throw immediately. This is why `vscode/browser.js` does NOT
44
+ * require this module (or any of the engine-lib adapters) and instead implements its own
45
+ * minimal, genuinely-zero-Node-API composition directly against `vscode.lm`. See browser.js's
46
+ * header comment for the full rationale. Fixing the engine-lib modules to be fs-free is a
47
+ * separate, much larger engine-wide refactor (config-loader/capability-loader/install-engine
48
+ * all read real files from disk) — out of scope for the extension-surface stage; flagged here
49
+ * for visibility rather than silently routed around.
50
+ *
51
+ * Mock-friendly: takes `vscode` (with `vscode.lm`) + `hostStorage` ({read,write}) so it is
52
+ * behaviorally testable without a live VS Code host.
53
+ *
54
+ * @param {{ lm: { selectChatModels: (selector?: unknown) => Promise<Array<{ sendRequest: (messages: unknown, options?: unknown, token?: unknown) => unknown }>> } }} vscode
55
+ * VS Code namespace (vscode.lm.selectChatModels — NOT vscode.lm.sendRequest, which does not exist).
56
+ * @param {{ read: (path: string) => string, write: (path: string, content: string) => void }} hostStorage
57
+ * sandboxed-storage backend (e.g. globalState/workspaceState/secrets).
58
+ * @returns {object} the composed IDE host surface: { runtime, model, hookBus, stateIO, adapter, commands }
59
+ */
60
+ module.exports = function bindGsdToVscode(vscode, hostStorage) {
61
+ if (!vscode || !vscode.lm || typeof vscode.lm.selectChatModels !== 'function') {
62
+ throw new TypeError('bindGsdToVscode: vscode.lm.selectChatModels is required (active model provider — VS Code exposes no vscode.lm.sendRequest; a model is selected via selectChatModels() and ITS sendRequest is called)');
63
+ }
64
+ if (!hostStorage || typeof hostStorage.read !== 'function' || typeof hostStorage.write !== 'function') {
65
+ throw new TypeError('bindGsdToVscode: hostStorage {read,write} is required (sandboxed-storage backend)');
66
+ }
67
+
68
+ const { createImperativeAdapter } = require('../gsd-core/bin/lib/adapter-imperative.cjs');
69
+ const { createModelAdapter } = require('../gsd-core/bin/lib/model-adapter.cjs');
70
+ const { createHookBus } = require('../gsd-core/bin/lib/hook-bus.cjs');
71
+ const { createStateIO } = require('../gsd-core/bin/lib/state-io.cjs');
72
+
73
+ // Active model: GSD model calls route through vscode.lm. There is no
74
+ // `vscode.lm.sendRequest` — a model must be selected first
75
+ // (`vscode.lm.selectChatModels()`, async → LanguageModelChat[]), then THAT
76
+ // model's own `.sendRequest(messages, options?, token?)` is called. Selects
77
+ // fresh on every call (no cross-call caching) so a model becoming available/
78
+ // unavailable between calls is always reflected; gsd-core/bin/lib/model-adapter.cjs's
79
+ // ActiveModelAdapter.sendRequest is a plain (non-async) pass-through that
80
+ // returns whatever the injected function returns, so an async injected
81
+ // function composes transparently — no adapter-side change needed (verified
82
+ // by reading model-adapter.cjs: `sendRequest(req) { return sendRequest(req); }`).
83
+ // No system-role messages — VS Code rejects them; a full extension builds
84
+ // LanguageModelChatMessages with User role only.
85
+ const model = createModelAdapter({ modelMode: 'active' }, {
86
+ async sendRequest(req) {
87
+ const models = await vscode.lm.selectChatModels();
88
+ const [chatModel] = models || [];
89
+ if (!chatModel || typeof chatModel.sendRequest !== 'function') {
90
+ throw new Error('bindGsdToVscode: vscode.lm.selectChatModels() returned no usable model (no active model available)');
91
+ }
92
+ return chatModel.sendRequest(req);
93
+ },
94
+ });
95
+
96
+ // Engine-owned hook bus: VS Code has no host bus, so GSD owns it in-process.
97
+ const hookBus = createHookBus({ bus: 'engine' });
98
+
99
+ // Sandboxed-storage stateIO bound to the host storage backend (no fs / no child_process).
100
+ const stateIO = createStateIO({ io: 'sandboxed-storage' }, { backend: hostStorage });
101
+
102
+ // Imperative adapter: the engine-as-library for the VS Code runtime.
103
+ const adapter = createImperativeAdapter({ runtime: 'vscode' });
104
+
105
+ // Command surface: Command Palette + Chat participant entries bound to the
106
+ // GSD command-routing hub via the imperative adapter (interface point 1).
107
+ const commands = Object.freeze({
108
+ 'gsd.invoke': Object.freeze({ description: 'Invoke a GSD command via the embedded engine (palette/chat).' }),
109
+ 'gsd.help': Object.freeze({ description: 'List GSD commands available in the IDE host.' }),
110
+ });
111
+
112
+ return Object.freeze({ runtime: 'vscode', model, hookBus, stateIO, adapter, commands });
113
+ };
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "gsd-core-vscode",
3
+ "displayName": "GSD Core",
4
+ "description": "GSD orchestration engine embedded in VS Code (ADR-1239 IDE profile).",
5
+ "version": "1.7.0",
6
+ "publisher": "opengsd",
7
+ "engines": {
8
+ "vscode": "^1.105.0"
9
+ },
10
+ "categories": [
11
+ "Other"
12
+ ],
13
+ "activationEvents": [
14
+ "onCommand:gsd.invoke"
15
+ ],
16
+ "main": "./extension.js",
17
+ "browser": "./browser.js",
18
+ "contributes": {
19
+ "commands": [
20
+ {
21
+ "command": "gsd.invoke",
22
+ "title": "GSD: Invoke Command"
23
+ }
24
+ ],
25
+ "chatParticipants": [
26
+ {
27
+ "id": "gsd",
28
+ "name": "gsd",
29
+ "fullName": "GSD Core",
30
+ "description": "Invoke GSD orchestration commands from chat.",
31
+ "isSticky": true
32
+ }
33
+ ],
34
+ "languageModelTools": [
35
+ {
36
+ "name": "gsd_progress",
37
+ "tags": [
38
+ "gsd",
39
+ "status"
40
+ ],
41
+ "toolReferenceName": "gsd-progress",
42
+ "displayName": "GSD Progress",
43
+ "modelDescription": "Reports GSD milestone/phase progress (percent complete, plan and summary counts) for the current project.",
44
+ "userDescription": "Check GSD project progress.",
45
+ "canBeReferencedInPrompt": true,
46
+ "inputSchema": {
47
+ "type": "object",
48
+ "properties": {},
49
+ "additionalProperties": false
50
+ }
51
+ },
52
+ {
53
+ "name": "gsd_workstreams",
54
+ "tags": [
55
+ "gsd",
56
+ "status"
57
+ ],
58
+ "toolReferenceName": "gsd-workstreams",
59
+ "displayName": "GSD Workstreams",
60
+ "modelDescription": "Lists the GSD parallel workstreams for the current project (or reports flat/single-workstream mode).",
61
+ "userDescription": "List GSD workstreams.",
62
+ "canBeReferencedInPrompt": true,
63
+ "inputSchema": {
64
+ "type": "object",
65
+ "properties": {},
66
+ "additionalProperties": false
67
+ }
68
+ },
69
+ {
70
+ "name": "gsd_plan_phase",
71
+ "tags": [
72
+ "gsd",
73
+ "plan"
74
+ ],
75
+ "toolReferenceName": "gsd-plan-phase",
76
+ "displayName": "GSD Plan Phase",
77
+ "modelDescription": "Looks up the plan index (plans, waves, checkpoints) for a named GSD phase. Read-only — does not create or modify a phase plan; use the /gsd-plan-phase chat workflow for full phase planning.",
78
+ "userDescription": "Look up a GSD phase's plan index.",
79
+ "canBeReferencedInPrompt": true,
80
+ "inputSchema": {
81
+ "type": "object",
82
+ "properties": {
83
+ "phase": {
84
+ "type": "string",
85
+ "description": "The GSD phase name to look up (e.g. \"01-core\")."
86
+ }
87
+ },
88
+ "required": [
89
+ "phase"
90
+ ],
91
+ "additionalProperties": false
92
+ }
93
+ }
94
+ ]
95
+ }
96
+ }