heyspex 0.2.5 → 0.2.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 (44) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/bin/hs.mjs +281 -30
  3. package/dev-factory/lib/dispatch-guard.mjs +75 -0
  4. package/dev-factory/lib/runner-path.mjs +51 -0
  5. package/dev-factory/spexcrawl/spexcrawl-cli.mjs +734 -0
  6. package/dist/cli/hs-connect.mjs +20 -1
  7. package/dist/cli/hs-defer.mjs +3802 -3744
  8. package/dist/cli/hs-events.mjs +1296 -0
  9. package/dist/cli/hs-export-events.mjs +1252 -0
  10. package/dist/cli/hs-handoff.mjs +2576 -0
  11. package/dist/cli/hs-index-rebuild.mjs +209 -36
  12. package/dist/cli/hs-index-reconcile.mjs +212 -39
  13. package/dist/cli/hs-init.mjs +20 -1
  14. package/dist/cli/hs-install.mjs +20 -1
  15. package/dist/cli/hs-join.mjs +20 -1
  16. package/dist/cli/hs-next-launch.mjs +2698 -0
  17. package/dist/cli/hs-pin.mjs +1336 -0
  18. package/dist/cli/hs-prereq.mjs +1380 -0
  19. package/dist/cli/hs-revalidate.mjs +3257 -0
  20. package/dist/cli/hs-spawn.mjs +12377 -0
  21. package/dist/cli/hs-test.mjs +1046 -0
  22. package/dist/cli/hs-trash.mjs +362 -0
  23. package/dist/cli/hs-trust.mjs +197 -0
  24. package/dist/cli/hs-vault-pull.mjs +214 -41
  25. package/dist/cli/hs-vault-push.mjs +212 -39
  26. package/dist/cli-templates/harness-commands/claude/hs-res.md +71 -63
  27. package/dist/cli-templates/harness-commands/cursor/hs-res.md +66 -58
  28. package/docs/copilot-plugin-install.md +2 -2
  29. package/package.json +261 -257
  30. package/plugins/heyspex/.claude-plugin/plugin.json +1 -1
  31. package/plugins/heyspex/.cursor-plugin/plugin.json +1 -1
  32. package/scripts/claude-hooks/wip-checkpoint.mjs +17 -2
  33. package/scripts/claude-statusline/statusline-command.mjs +287 -27
  34. package/scripts/hs-companion.mjs +8 -0
  35. package/scripts/install-claude-code-hooks.mjs +104 -3
  36. package/scripts/install-copilot-hooks.mjs +21 -1
  37. package/scripts/install-cursor-hooks.mjs +4 -3
  38. package/scripts/lib/capture-execution-guard.mjs +221 -0
  39. package/scripts/lib/customer-kit.mjs +48 -0
  40. package/scripts/lib/hs-companion-settings.mjs +25 -0
  41. package/scripts/record-grounding.mjs +38 -0
  42. package/vendor/heyspex-mcp/http-transport.mjs +1 -1
  43. package/vendor/heyspex-mcp/test-helpers.mjs +37 -23
  44. package/bin/postinstall.mjs +0 -88
@@ -7,61 +7,69 @@ description: Confidence-ladder research method's entrypoint — SpexCrawl via th
7
7
 
8
8
  **Usage:** `/hs-res [research question/topic]`
9
9
 
10
- # Research (`/hs-res`)
11
-
12
- > Parity: `.commandcode/skills/hs-res/SKILL.md` · `.cursor/skills/hs-res/SKILL.md` · `.agents/skills/hs-res/SKILL.md`
13
-
14
- ## What to do
15
-
16
- 1. **Take the question.** `$ARGUMENTS` is the research question/topic. If empty, load the
17
- console doc-toolbar Promote pin via `heyspex_active_research`
18
- (`.heyspex/research-focus.yaml` → `source_idea_id`, `scope`, `spec_path`) and read the source
19
- capture body as the question. Either way, restate the scope and confirm with the user.
20
-
21
- 2. **Gather via SpexCrawl (the Companion) — the PRIMARY method** (owner ruling 2026-08-14,
22
- [[spexcrawl-through-the-companion-is-the]]: "Companion > SpexCrawl is now default method
23
- for research"). Decompose into a few independent search angles, then per angle:
24
- `node dev-factory/spexcrawl/spexcrawl-cli.mjs search "<query>" --json` — one call
25
- searches AND returns the cleaned pages of the top results. Specific extra URLs:
26
- `node dev-factory/spexcrawl/spexcrawl-cli.mjs scrape "<url>" --json`.
27
- Prerequisites: the Companion running and paired to the console. LAN mode
28
- (`npm run console:log:lan`) is needed ONLY when the Companion runs on a DIFFERENT
29
- machine than the console — since HS-V9WH the Companion polls loopback consoles too
30
- ([[a-queue-is-dead-if-its-only-consumer]]: the LAN line was a bug workaround
31
- misdocumented as a requirement). When missing, the CLI exits 3 with
32
- `SPEXCRAWL_UNAVAILABLE` naming the fix; a silent hang means the Companion is not
33
- running or not polling this console.
34
-
35
- **Fallback — self-hosted Firecrawl, AUTOMATIC, no permission needed (owner ruling
36
- 2026-08-22).** When the SpexCrawl path malfunctions, times out, hits a gate, or is otherwise
37
- unavailable, fall back immediately: `node dev-factory/spexcrawl/firecrawl-cli.mjs
38
- search "<query>" --json` and `node dev-factory/spexcrawl/firecrawl-cli.mjs scrape
39
- "<url>" --json`. May run on any fleet machine (coffee-geek, basement-geek, spec-ops) —
40
- prefer other reachable machines over the one the orchestrating session runs on; check
41
- `docker info`, start Docker/the stack if needed, poll the real endpoint for readiness before
42
- use. If this task's changed/claimed files are SpexCrawl-related, skip SpexCrawl entirely and
43
- go straight to Firecrawl. Hosted `api.firecrawl.dev` credits are unchanged — still
44
- ask-before-spend every time. Full contract: `.commandcode/skills/hs-res/SKILL.md`.
45
-
46
- 3. **Assemble a numbered sources block** (`[S1]`, `[S2]`, …) from the gathered
47
- `{title, url, snippet, markdown}` results, write it plus the question and cite-only
48
- instructions to a temp prompt file.
49
-
50
- 4. **Synthesize via DeepSeek** —
51
- `node dev-factory/spexcrawl/synthesize-cli.mjs --prompt-file <path> --json`
52
- (defaults `--max-tokens` to 32000 and auto-escalates ×3 up to a 96000 ceiling if DeepSeek's
53
- default-on "thinking" mode burns the whole budget on reasoning — never pass a lower
54
- `--max-tokens` yourself; the CLI self-heals this failure mode. Exhausted escalation exits 3
55
- with `SYNTHESIZE_UNAVAILABLE`).
56
-
57
- 5. **Save** via `heyspex_save_research` (or `heyspex_complete_research` under the console pin
58
- pipeline), with `sources` populated from the gathered URLs.
59
-
60
- **Never fall back** to `deep-research`/`deep-research-quick|medium|thorough`, the
61
- `Workflow({ scriptPath: '.claude/workflows/deep-research-*.js' })` launch, or native
62
- `WebSearch`/`WebFetch` for this method. Self-hosted Firecrawl fallback is automatic (no
63
- permission needed, 2026-08-22 ruling); hosted `api.firecrawl.dev` credits still need the
64
- user's explicit per-run permission, every time. If a CLI reports unavailable
65
- (`SPEXCRAWL_UNAVAILABLE` / `FIRECRAWL_UNAVAILABLE` / `SYNTHESIZE_UNAVAILABLE`, exit 3),
66
- **stop** and tell the user — never silently substitute another backend. Full method,
67
- escalation rule, and hard prohibitions: `.commandcode/skills/hs-res/SKILL.md`.
10
+ # Research (`/hs-res`)
11
+
12
+ > Parity: `.commandcode/skills/hs-res/SKILL.md` · `.cursor/skills/hs-res/SKILL.md` · `.agents/skills/hs-res/SKILL.md`
13
+
14
+ ## What to do
15
+
16
+ 1. **Take the question.** `$ARGUMENTS` is the research question/topic. If empty, load the
17
+ console doc-toolbar Promote pin via `heyspex_active_research`
18
+ (`.heyspex/research-focus.yaml` → `source_idea_id`, `scope`, `spec_path`) and read the source
19
+ capture body as the question. Either way, restate the scope and confirm with the user.
20
+
21
+ 2. **Gather via SpexCrawl (the Companion) — the PRIMARY method** (owner ruling 2026-08-14,
22
+ [[spexcrawl-through-the-companion-is-the]]: "Companion > SpexCrawl is now default method
23
+ for research"). Decompose into a few independent search angles, then per angle:
24
+ `node dev-factory/spexcrawl/spexcrawl-cli.mjs search "<query>" --json` — one call
25
+ searches AND returns the cleaned pages of the top results. Specific extra URLs:
26
+ `node dev-factory/spexcrawl/spexcrawl-cli.mjs scrape "<url>" --json`.
27
+ Prerequisites: the Companion running and paired to the console. LAN mode
28
+ (`npm run console:log:lan`) is needed ONLY when the Companion runs on a DIFFERENT
29
+ machine than the console — since HS-V9WH the Companion polls loopback consoles too
30
+ ([[a-queue-is-dead-if-its-only-consumer]]: the LAN line was a bug workaround
31
+ misdocumented as a requirement). When missing, the CLI exits 3 with
32
+ `SPEXCRAWL_UNAVAILABLE` naming the fix; a silent hang means the Companion is not
33
+ running or not polling this console.
34
+
35
+ **Fallback — self-hosted Firecrawl, AUTOMATIC, no permission needed (owner ruling
36
+ 2026-08-22).** When the SpexCrawl path malfunctions, times out, hits a gate, or is otherwise
37
+ unavailable, fall back immediately: `node dev-factory/spexcrawl/firecrawl-cli.mjs
38
+ search "<query>" --json` and `node dev-factory/spexcrawl/firecrawl-cli.mjs scrape
39
+ "<url>" --json`. May run on any fleet machine (coffee-geek, basement-geek, spec-ops) —
40
+ prefer other reachable machines over the one the orchestrating session runs on; check
41
+ `docker info`, start Docker/the stack if needed, poll the real endpoint for readiness before
42
+ use. If this task's changed/claimed files are SpexCrawl-related, skip SpexCrawl entirely and
43
+ go straight to Firecrawl. Hosted `api.firecrawl.dev` credits are unchanged — still
44
+ ask-before-spend every time. Full contract: `.commandcode/skills/hs-res/SKILL.md`.
45
+
46
+ **In a repo that uses the `heyspex` npm package** (not a HeySpex platform checkout): the
47
+ package ships only the SpexCrawl client (`dev-factory/spexcrawl/spexcrawl-cli.mjs` under
48
+ `node_modules/heyspex/`). It needs the HeySpex Companion, which the npm package does not
49
+ distribute yet, so it usually exits 3 `SPEXCRAWL_UNAVAILABLE`. The Firecrawl fallback and
50
+ the DeepSeek synthesis CLI (`firecrawl-cli.mjs`, `synthesize-cli.mjs`) are HeySpex-platform
51
+ only and are not in the package. When a CLI named in steps 2 or 4 is missing or reports
52
+ unavailable, stop and tell the user this research method is not available in their install.
53
+
54
+ 3. **Assemble a numbered sources block** (`[S1]`, `[S2]`, …) from the gathered
55
+ `{title, url, snippet, markdown}` results, write it plus the question and cite-only
56
+ instructions to a temp prompt file.
57
+
58
+ 4. **Synthesize via DeepSeek** —
59
+ `node dev-factory/spexcrawl/synthesize-cli.mjs --prompt-file <path> --json`
60
+ (defaults `--max-tokens` to 32000 and auto-escalates ×3 up to a 96000 ceiling if DeepSeek's
61
+ default-on "thinking" mode burns the whole budget on reasoning — never pass a lower
62
+ `--max-tokens` yourself; the CLI self-heals this failure mode. Exhausted escalation exits 3
63
+ with `SYNTHESIZE_UNAVAILABLE`).
64
+
65
+ 5. **Save** via `heyspex_save_research` (or `heyspex_complete_research` under the console pin
66
+ pipeline), with `sources` populated from the gathered URLs.
67
+
68
+ **Never fall back** to `deep-research`/`deep-research-quick|medium|thorough`, the
69
+ `Workflow({ scriptPath: '.claude/workflows/deep-research-*.js' })` launch, or native
70
+ `WebSearch`/`WebFetch` for this method. Self-hosted Firecrawl fallback is automatic (no
71
+ permission needed, 2026-08-22 ruling); hosted `api.firecrawl.dev` credits still need the
72
+ user's explicit per-run permission, every time. If a CLI reports unavailable
73
+ (`SPEXCRAWL_UNAVAILABLE` / `FIRECRAWL_UNAVAILABLE` / `SYNTHESIZE_UNAVAILABLE`, exit 3),
74
+ **stop** and tell the user — never silently substitute another backend. Full method,
75
+ escalation rule, and hard prohibitions: `.commandcode/skills/hs-res/SKILL.md`.
@@ -32,7 +32,7 @@ The heyspex-app repository is not required and is not available to customers. Ev
32
32
  works from the published npm package `heyspex` (or a tarball your HeySpex contact hands you), which
33
33
  carries the plugin, the marketplace manifest, the hooks and the MCP server.
34
34
 
35
- - Node.js 20 or newer on PATH (`node --version`).
35
+ - Node.js 20–24 on PATH (`node --version`; the package requires `>=20 <25`).
36
36
  - GitHub Copilot CLI installed and signed in. Any one of: the GitHub Copilot app (its bundled
37
37
  `%LOCALAPPDATA%\github-copilot-sdk\cli\<version>\copilot.exe` is auto-detected, newest version
38
38
  wins, no PATH entry needed), `npm install -g @github/copilot`, or `winget install GitHub.Copilot`.
@@ -43,7 +43,7 @@ carries the plugin, the marketplace manifest, the hooks and the MCP server.
43
43
  ```bash
44
44
  npm install heyspex
45
45
  # or, from a tarball you were given:
46
- npm install ./heyspex-0.2.0.tgz
46
+ npm install ./heyspex-<version>.tgz
47
47
  ```
48
48
 
49
49
  - Sign the machine in to the HeySpex console so hooks and MCP tools can reach the vault: