heyspex 0.2.1 → 0.2.3
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.
- package/README.md +10 -0
- package/bin/hs-vault-binding.mjs +157 -0
- package/bin/hs.mjs +99 -81
- package/bin/spexcode.mjs +91 -0
- package/dev-factory/engine/worktree.mjs +36 -7
- package/dev-factory/lib/epic-detect.mjs +2 -2
- package/dev-factory/lib/fleet-readiness.mjs +3 -5
- package/dev-factory/lib/fleet-state.mjs +2 -2
- package/dev-factory/lib/sufficiency-score.mjs +3 -5
- package/dist/cli/hs-check.mjs +76 -46
- package/dist/cli/hs-claim.mjs +63 -33
- package/dist/cli/hs-connect.mjs +520 -214
- package/dist/cli/hs-defer.mjs +161 -19
- package/dist/cli/hs-dev.mjs +11 -5
- package/dist/cli/hs-env.mjs +187 -161
- package/dist/cli/hs-index-rebuild.mjs +123 -78
- package/dist/cli/hs-index-reconcile.mjs +203 -107
- package/dist/cli/hs-init.mjs +426 -179
- package/dist/cli/hs-install.mjs +759 -437
- package/dist/cli/hs-join.mjs +590 -383
- package/dist/cli/hs-vault-pull.mjs +359 -254
- package/dist/cli/hs-vault-push.mjs +151 -113
- package/dist/cli/hs-vault.mjs +271 -104
- package/dist/cli/hs-workspace.mjs +90 -57
- package/dist/cli-templates/customer-vault/specs/protocols/session-close-protocol.md +178 -91
- package/docs/copilot-plugin-install.md +189 -162
- package/docs/driving-heyspex-from-copilot.md +174 -165
- package/docs/mcp-client-config.md +93 -25
- package/package.json +255 -249
- package/plugins/heyspex/.mcp.json +3 -4
- package/plugins/heyspex/README.md +323 -309
- package/plugins/heyspex/bin/launch-mcp.mjs +21 -7
- package/plugins/heyspex/mcp.json +12 -13
- package/scripts/check-mcp-freshness.mjs +6 -4
- package/scripts/claude-hooks/_intent-classifier-router.mjs +518 -456
- package/scripts/claude-hooks/intent-classifier-trigger.mjs +305 -279
- package/scripts/claude-hooks/research-method-guard.mjs +2 -2
- package/scripts/claude-hooks/wip-checkpoint.mjs +33 -9
- package/scripts/claude-statusline/fonts/HeySpexIcons.ttf +0 -0
- package/scripts/claude-statusline/statusline-command.mjs +1058 -0
- package/scripts/dev-server-status.mjs +3 -2
- package/scripts/dev-server-stop.mjs +3 -2
- package/scripts/hs-capture-cli.mjs +2 -2
- package/scripts/hs-settings.mjs +2 -2
- package/scripts/hs-view.mjs +3 -2
- package/scripts/install-copilot-hooks.mjs +318 -0
- package/scripts/lib/copilot-cli.mjs +108 -0
- package/scripts/lib/customer-kit.mjs +223 -30
- package/scripts/lib/dev-mode.mjs +28 -2
- package/scripts/lib/shared-path-helpers.mjs +32 -0
- package/scripts/lib/standalone-doctor.mjs +131 -32
- package/scripts/wip-ledger-health.mjs +3 -2
- package/spexharness/src/gates/vault-mirror-catchup.mjs +113 -24
- package/spexharness/src/gates/vault-mirror-catchup.runner.mjs +52 -0
- package/spexharness/src/intent-directive.mjs +839 -626
- package/spexharness/src/rule-table.mjs +1 -1
- package/vendor/heyspex-mcp/cli-verbs.mjs +16 -2
- package/vendor/heyspex-mcp/cli.mjs +20 -4
- package/vendor/heyspex-mcp/console-fetch.mjs +15 -3
- package/vendor/heyspex-mcp/dev-tools.mjs +11 -4
- package/vendor/heyspex-mcp/events-tools.mjs +1 -1
- package/vendor/heyspex-mcp/factory-run-status.mjs +42 -0
- package/vendor/heyspex-mcp/mcp-config.mjs +4 -2
- package/vendor/heyspex-mcp/spec-edit-tools.mjs +26 -1
- package/vendor/heyspex-mcp/test-helpers.mjs +5 -2
- package/vendor/heyspex-mcp/tool-catalog.mjs +12 -0
- package/vendor/heyspex-mcp/tool-dispatch.mjs +59 -23
- package/vendor/heyspex-mcp/usable-dir-env.mjs +82 -0
- package/vendor/heyspex-mcp/vault-binding.mjs +839 -0
- package/vendor/heyspex-mcp/vault-resolve.mjs +353 -245
|
@@ -1,162 +1,189 @@
|
|
|
1
|
-
# Installing the HeySpex (SpexCode) plugin in GitHub Copilot CLI
|
|
2
|
-
|
|
3
|
-
Instructions written to be handed verbatim to a GitHub Copilot CLI agent. Follow the steps in
|
|
4
|
-
order and stop at any step that fails, reporting the exact output.
|
|
5
|
-
|
|
6
|
-
This guide is for a team that installs only the `heyspex` npm package. The heyspex-app repository
|
|
7
|
-
is not needed and is not available to customers.
|
|
8
|
-
|
|
9
|
-
Source of truth for the Copilot commands and file layout:
|
|
10
|
-
<https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-plugin-reference>.
|
|
11
|
-
Hook behaviour under Copilot: <https://docs.github.com/en/copilot/reference/hooks-configuration>.
|
|
12
|
-
Both pages were read on 2026-10-16. The plugin itself is documented in `node_modules/heyspex/plugins/heyspex/README.md`.
|
|
13
|
-
|
|
14
|
-
##
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
`.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
copilot
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
the
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
capture
|
|
1
|
+
# Installing the HeySpex (SpexCode) plugin in GitHub Copilot CLI
|
|
2
|
+
|
|
3
|
+
Instructions written to be handed verbatim to a GitHub Copilot CLI agent. Follow the steps in
|
|
4
|
+
order and stop at any step that fails, reporting the exact output.
|
|
5
|
+
|
|
6
|
+
This guide is for a team that installs only the `heyspex` npm package. The heyspex-app repository
|
|
7
|
+
is not needed and is not available to customers.
|
|
8
|
+
|
|
9
|
+
Source of truth for the Copilot commands and file layout:
|
|
10
|
+
<https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-plugin-reference>.
|
|
11
|
+
Hook behaviour under Copilot: <https://docs.github.com/en/copilot/reference/hooks-configuration>.
|
|
12
|
+
Both pages were read on 2026-10-16. The plugin itself is documented in `node_modules/heyspex/plugins/heyspex/README.md`.
|
|
13
|
+
|
|
14
|
+
## 0. The short version
|
|
15
|
+
|
|
16
|
+
From the root of your repo, after `npm install heyspex`:
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npx heyspex setup copilot # plugin route (Copilot CLI): registers the marketplace and installs the plugin
|
|
20
|
+
npx heyspex setup copilot --hooks # hooks route (Copilot cloud agent / no plugin): writes .github/hooks/heyspex.json
|
|
21
|
+
npx heyspex setup copilot --check # which route is active; warns if both are
|
|
22
|
+
npx heyspex setup copilot --uninstall
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
To have an agent do it, paste it the output of `npx heyspex setup copilot --print` (this document,
|
|
26
|
+
preceded by the exact next command). If no Copilot CLI can be found (PATH, then the Copilot app's bundled copy), the plugin route
|
|
27
|
+
installs nothing, prints the prerequisite and the two commands, and exits 1. Pick ONE route, never both. The manual commands below remain the fallback.
|
|
28
|
+
|
|
29
|
+
## 1. Prerequisites
|
|
30
|
+
|
|
31
|
+
The heyspex-app repository is not required and is not available to customers. Everything below
|
|
32
|
+
works from the published npm package `heyspex` (or a tarball your HeySpex contact hands you), which
|
|
33
|
+
carries the plugin, the marketplace manifest, the hooks and the MCP server.
|
|
34
|
+
|
|
35
|
+
- Node.js 20 or newer on PATH (`node --version`).
|
|
36
|
+
- GitHub Copilot CLI installed and signed in. Any one of: the GitHub Copilot app (its bundled
|
|
37
|
+
`%LOCALAPPDATA%\github-copilot-sdk\cli\<version>\copilot.exe` is auto-detected, newest version
|
|
38
|
+
wins, no PATH entry needed), `npm install -g @github/copilot`, or `winget install GitHub.Copilot`.
|
|
39
|
+
`npx heyspex setup copilot` looks on PATH first, then for the app copy; if neither exists it
|
|
40
|
+
installs nothing and exits non-zero. `COPILOT_HOME` (Copilot's settings-dir override) is honoured.
|
|
41
|
+
- A git repo of your own (the one you want governed). From its root, install the package:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
npm install heyspex
|
|
45
|
+
# or, from a tarball you were given:
|
|
46
|
+
npm install ./heyspex-0.2.0.tgz
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
- Sign the machine in to the HeySpex console so hooks and MCP tools can reach the vault:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
npx hs login
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
## 2. Pick ONE: the plugin or the repo hooks (never both)
|
|
56
|
+
|
|
57
|
+
Copilot reads hooks from an installed plugin and from `.github/hooks/` in the repo. With both,
|
|
58
|
+
every hook runs twice. Choose one.
|
|
59
|
+
|
|
60
|
+
The `.claude/settings.json` rows `hs install` commits are the exception that needs no choice: they
|
|
61
|
+
route through the committed launcher `.claude/heyspex/run-hook.mjs` (marker `// yields-to-plugin: v1`),
|
|
62
|
+
which exits 0 silently when a heyspex plugin is enabled on the machine running it, so the plugin's
|
|
63
|
+
copy of the hook is the only one that fires. The launcher reads the same plugin evidence `hs doctor`'s
|
|
64
|
+
`hook-double-fire` check does; `enabledPlugins["heyspex@..."] === false` keeps the repo rows running,
|
|
65
|
+
and `HEYSPEX_REPO_HOOKS=1` forces them. `.github/hooks/*.json` rows do not use the launcher, so for
|
|
66
|
+
those the plugin-or-hooks choice below stands.
|
|
67
|
+
|
|
68
|
+
**Option A: the plugin (recommended).** One command registers the marketplace shipped inside the
|
|
69
|
+
package and installs the plugin:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npx heyspex setup copilot
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
(`npx hs install --target . --copilot-plugin-apply` does the same.) By hand, the equivalent Copilot commands are:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
copilot plugin marketplace add ./node_modules/heyspex
|
|
79
|
+
copilot plugin install heyspex@heyspex-marketplace
|
|
80
|
+
copilot plugin list
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`./node_modules/heyspex/.claude-plugin/marketplace.json` is a Claude-format marketplace named
|
|
84
|
+
`heyspex-marketplace`; its plugin `source` (`./plugins/heyspex`) resolves inside the package.
|
|
85
|
+
`npx hs install --target . --copilot-plugin` (no `-apply`) only prints these commands.
|
|
86
|
+
|
|
87
|
+
**Option B: repo hooks, for teammates and the Copilot cloud agent.** Writes
|
|
88
|
+
`.github/hooks/heyspex.json` into your repo; commit it. Each command runs
|
|
89
|
+
`node_modules/heyspex/scripts/claude-hooks/_run.mjs` and exits 0 if the package is not installed,
|
|
90
|
+
so a checkout without `npm install` is never blocked.
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npx heyspex setup copilot --hooks
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
(`npx hs install --target . --copilot-hooks` does the same.) `setup copilot --hooks` refuses when the plugin is already installed. If you pass `--copilot-hooks` together with `--copilot-plugin[-apply]`, the installer warns and
|
|
97
|
+
skips the hooks file.
|
|
98
|
+
|
|
99
|
+
Then restart the Copilot session (`/restart`) so hooks load, and verify:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
copilot plugin list # Option A: heyspex is enabled
|
|
103
|
+
npx hs doctor # MCP, hooks and account surfaces healthy
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## 3. What the plugin loads
|
|
107
|
+
|
|
108
|
+
| Component | Source | Behaviour under Copilot |
|
|
109
|
+
| --- | --- | --- |
|
|
110
|
+
| Hooks | `node_modules/heyspex/plugins/heyspex/hooks/hooks.json` | PreToolUse, PostToolUse, Stop, UserPromptSubmit and SessionStart gates. Every command locates the runtime itself and exits 0 if it cannot, so a missing variable never denies a tool call. A real deny arrives as a top-level `permissionDecision` with a reason. |
|
|
111
|
+
| MCP server | `node_modules/heyspex/plugins/heyspex/.mcp.json` | The `heyspex_*` vault tools and `hs-*` prompts. |
|
|
112
|
+
| Slash commands | not loaded | Claude Code commands are not a Copilot component. Use MCP prompts or the `hs` CLI. |
|
|
113
|
+
|
|
114
|
+
## 4. Verify the install
|
|
115
|
+
|
|
116
|
+
1. In a Copilot session inside any repo, run a harmless tool call, for example read a file. It
|
|
117
|
+
must succeed. A message containing "Denied by preToolUse hook" means a hook failed; go to
|
|
118
|
+
section 7.
|
|
119
|
+
2. Confirm the MCP server is up by listing MCP servers in Copilot (`/mcp`) and calling
|
|
120
|
+
`heyspex_recall_memories` with `{ "limit": 3 }`. If the server is missing, go to section 7.
|
|
121
|
+
3. Confirm the gates work: send a prompt that contains a new product idea of more than 60
|
|
122
|
+
characters, then try to edit a source file without capturing. The edit should be refused with a
|
|
123
|
+
reason that names `directive-obligation-gate`. Call `heyspex_update_capture` with the prompt
|
|
124
|
+
text, then retry the edit. It should pass.
|
|
125
|
+
|
|
126
|
+
## 5. Turning HeySpex off and on
|
|
127
|
+
|
|
128
|
+
Run from the repo you are working in:
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
hs mode status # on | off, and why
|
|
132
|
+
hs mode off # every hook exits 0 immediately, no restart needed
|
|
133
|
+
hs mode on
|
|
134
|
+
hs mode toggle
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Use `npx hs mode off` when `hs` is not on PATH. The switch writes
|
|
138
|
+
`.heyspex/mode.json` in the project and is git-ignored.
|
|
139
|
+
|
|
140
|
+
Per-shell variants that touch no files:
|
|
141
|
+
|
|
142
|
+
| Variable | Effect |
|
|
143
|
+
| --- | --- |
|
|
144
|
+
| `HEYSPEX_MODE=off` | Silences hooks for every harness in that shell |
|
|
145
|
+
| `HEYSPEX_COPILOT_HOOKS_OFF=1` | Silences hooks only when the caller is Copilot; Claude Code and Cursor keep theirs |
|
|
146
|
+
|
|
147
|
+
The config twin of the Copilot switch is `agent_behaviors.harness_hooks.copilot.enabled: false` in
|
|
148
|
+
the vault's `.heyspex/config.yaml`.
|
|
149
|
+
|
|
150
|
+
Four security gates ignore all of these by design: `env-vault-guard`, `research-method-guard`,
|
|
151
|
+
`research-protocol-gate` and `git-identity-guard`. They only act on secret writes, built-in
|
|
152
|
+
deep-research skills, unprotocolled web research and git identity changes.
|
|
153
|
+
|
|
154
|
+
## 6. Everyday loop
|
|
155
|
+
|
|
156
|
+
With MCP available: `heyspex_next_on_deck`, `heyspex_claim_spec`, `heyspex_report_progress`,
|
|
157
|
+
`heyspex_submit_for_review`. Without MCP, the `hs` CLI (`npx hs`) covers the same loop; see
|
|
158
|
+
`docs/driving-heyspex-from-copilot.md`.
|
|
159
|
+
|
|
160
|
+
## 7. Troubleshooting
|
|
161
|
+
|
|
162
|
+
- **Every tool call is denied.** Run `hs mode off` to unblock immediately, then capture the exact
|
|
163
|
+
deny text and the hook command it names. If the command still starts with
|
|
164
|
+
`node "$CLAUDE_PROJECT_DIR/...`, the package is old; run `npm install heyspex@latest` and reinstall the plugin.
|
|
165
|
+
- **MCP server does not start.** Copilot documents `${PLUGIN_ROOT}` for its own plugin format, and
|
|
166
|
+
whether it expands `${CLAUDE_PLUGIN_ROOT}` in a Claude-format plugin is unverified. Register the
|
|
167
|
+
server explicitly:
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
copilot mcp add heyspex -- node ./node_modules/heyspex/plugins/heyspex/bin/launch-mcp.mjs
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
- **A hook denies with no reason shown.** That is a hook exiting 2 the old way. Report the hook
|
|
174
|
+
name; it should be answering in Copilot's JSON format.
|
|
175
|
+
- **Hooks run twice.** The repo you are in also carries HeySpex rows in its own
|
|
176
|
+
`.claude/settings.json` from `hs install`. Use either the plugin or the install kit (or `.github/hooks`) in one repo,
|
|
177
|
+
not both.
|
|
178
|
+
|
|
179
|
+
## 8. Report back
|
|
180
|
+
|
|
181
|
+
State the Copilot CLI version, the output of `copilot plugin list`, the result of the three checks
|
|
182
|
+
in section 4, and the exact text of any deny or MCP error.
|
|
183
|
+
|
|
184
|
+
## Status of this document
|
|
185
|
+
|
|
186
|
+
The install commands come from GitHub's plugin reference, and the hook behaviour was verified by
|
|
187
|
+
replaying Copilot-shaped payloads through the registered commands, not by a live Copilot session.
|
|
188
|
+
The first agent that completes section 4 is the real test. Fix history: diagnose HS-20SW and
|
|
189
|
+
capture HS-HNO1 (2026-10-16).
|