heyspex 0.2.5 → 0.2.7

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 (110) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/bin/hs.mjs +349 -38
  3. package/bin/spexcode.mjs +31 -0
  4. package/dev-factory/lib/dispatch-guard.mjs +75 -0
  5. package/dev-factory/lib/local-firecrawl.mjs +294 -0
  6. package/dev-factory/lib/runner-path.mjs +51 -0
  7. package/dev-factory/lib/seat-context.mjs +20 -4
  8. package/dev-factory/model-catalog.json +222 -222
  9. package/dev-factory/spexcrawl/firecrawl-cli.mjs +755 -0
  10. package/dev-factory/spexcrawl/spexcrawl-cli.mjs +734 -0
  11. package/dist/cli/hs-connect.mjs +40 -3
  12. package/dist/cli/hs-defer.mjs +3817 -3741
  13. package/dist/cli/hs-events.mjs +1296 -0
  14. package/dist/cli/hs-export-events.mjs +1252 -0
  15. package/dist/cli/hs-handoff.mjs +2576 -0
  16. package/dist/cli/hs-index-rebuild.mjs +228 -37
  17. package/dist/cli/hs-index-reconcile.mjs +231 -40
  18. package/dist/cli/hs-init.mjs +22 -3
  19. package/dist/cli/hs-install.mjs +22 -3
  20. package/dist/cli/hs-join.mjs +40 -3
  21. package/dist/cli/hs-next-launch.mjs +2777 -0
  22. package/dist/cli/hs-pin.mjs +1336 -0
  23. package/dist/cli/hs-prereq.mjs +1380 -0
  24. package/dist/cli/hs-revalidate.mjs +3257 -0
  25. package/dist/cli/hs-spawn.mjs +12403 -0
  26. package/dist/cli/hs-test.mjs +1046 -0
  27. package/dist/cli/hs-trash.mjs +362 -0
  28. package/dist/cli/hs-trust.mjs +197 -0
  29. package/dist/cli/hs-vault-pull.mjs +233 -42
  30. package/dist/cli/hs-vault-push.mjs +231 -40
  31. package/dist/cli/hs-vault.mjs +21 -7
  32. package/dist/cli/hs-workspace.mjs +19 -1
  33. package/dist/cli-templates/customer-vault/specs/entity-model.md +1728 -1728
  34. package/dist/cli-templates/customer-vault/specs/protocols/canonical-frontmatter-templates.md +464 -464
  35. package/dist/cli-templates/customer-vault/specs/protocols/destructive-action-checklist.md +122 -122
  36. package/dist/cli-templates/customer-vault/specs/protocols/memory-protocol.md +46 -46
  37. package/dist/cli-templates/customer-vault/specs/protocols/spec-hierarchy.md +530 -530
  38. package/dist/cli-templates/customer-vault/specs/protocols/spec-summary-authoring.md +83 -83
  39. package/dist/cli-templates/harness-commands/claude/hs-backfill.md +28 -28
  40. package/dist/cli-templates/harness-commands/claude/hs-capture.md +62 -62
  41. package/dist/cli-templates/harness-commands/claude/hs-defer.md +29 -29
  42. package/dist/cli-templates/harness-commands/claude/hs-ground.md +30 -30
  43. package/dist/cli-templates/harness-commands/claude/hs-next.md +29 -29
  44. package/dist/cli-templates/harness-commands/claude/hs-promote.md +70 -70
  45. package/dist/cli-templates/harness-commands/claude/hs-push.md +35 -35
  46. package/dist/cli-templates/harness-commands/claude/hs-qc.md +27 -27
  47. package/dist/cli-templates/harness-commands/claude/hs-res.md +83 -63
  48. package/dist/cli-templates/harness-commands/claude/hs-resolve.md +23 -23
  49. package/dist/cli-templates/harness-commands/claude/hs-view.md +28 -28
  50. package/dist/cli-templates/harness-commands/claude/kill-ports.md +32 -32
  51. package/dist/cli-templates/harness-commands/claude/prototype.md +91 -91
  52. package/dist/cli-templates/harness-commands/cursor/hs-backfill.md +22 -22
  53. package/dist/cli-templates/harness-commands/cursor/hs-capture.md +56 -56
  54. package/dist/cli-templates/harness-commands/cursor/hs-defer.md +23 -23
  55. package/dist/cli-templates/harness-commands/cursor/hs-ground.md +24 -24
  56. package/dist/cli-templates/harness-commands/cursor/hs-next.md +23 -23
  57. package/dist/cli-templates/harness-commands/cursor/hs-promote.md +64 -64
  58. package/dist/cli-templates/harness-commands/cursor/hs-push.md +29 -29
  59. package/dist/cli-templates/harness-commands/cursor/hs-qc.md +21 -21
  60. package/dist/cli-templates/harness-commands/cursor/hs-res.md +78 -58
  61. package/dist/cli-templates/harness-commands/cursor/hs-resolve.md +17 -17
  62. package/dist/cli-templates/harness-commands/cursor/hs-view.md +23 -23
  63. package/dist/cli-templates/harness-commands/cursor/kill-ports.md +26 -26
  64. package/dist/cli-templates/harness-commands/cursor/prototype.md +86 -86
  65. package/docs/copilot-plugin-install.md +9 -2
  66. package/docs/mcp-client-config.md +6 -0
  67. package/package.json +266 -257
  68. package/plugins/heyspex/.claude-plugin/plugin.json +1 -1
  69. package/plugins/heyspex/.cursor-plugin/plugin.json +1 -1
  70. package/plugins/heyspex/README.md +6 -0
  71. package/plugins/heyspex/bin/launch-mcp.mjs +17 -0
  72. package/plugins/heyspex/hooks/hooks.json +418 -418
  73. package/scripts/claude-hooks/_intent-classifier-semantic.mjs +2 -2
  74. package/scripts/claude-hooks/wip-checkpoint.mjs +17 -2
  75. package/scripts/claude-statusline/statusline-command.mjs +287 -27
  76. package/scripts/hs-companion.mjs +41 -3
  77. package/scripts/install-claude-code-hooks.mjs +104 -3
  78. package/scripts/install-copilot-hooks.mjs +21 -1
  79. package/scripts/install-cursor-hooks.mjs +4 -3
  80. package/scripts/lib/capture-execution-guard.mjs +221 -0
  81. package/scripts/lib/companion-install.mjs +768 -0
  82. package/scripts/lib/customer-kit.mjs +53 -3
  83. package/scripts/lib/hs-companion-settings.mjs +26 -0
  84. package/scripts/lib/hs-source-push.mjs +386 -386
  85. package/scripts/record-grounding.mjs +38 -0
  86. package/spexharness/doctrine/baseline/SPEXCODE-DOCTRINE.baseline.json +29 -29
  87. package/spexharness/src/adapters/copilot-models.mjs +179 -0
  88. package/spexharness/src/adapters/harness-detect.mjs +148 -0
  89. package/spexharness/src/gates/directive-obligation-gate.decide.mjs +132 -132
  90. package/spexharness/src/gates/vault-write-tier-guard.decide.mjs +153 -125
  91. package/spexharness/src/seat-context.mjs +10 -5
  92. package/spexharness/src/session-bootstrap.mjs +6 -3
  93. package/vendor/heyspex-mcp/cli.mjs +6 -1
  94. package/vendor/heyspex-mcp/config-seed.yaml +15 -15
  95. package/vendor/heyspex-mcp/dev-factory-overlay.mjs +142 -0
  96. package/vendor/heyspex-mcp/http-transport.mjs +1 -1
  97. package/vendor/heyspex-mcp/memory-tools.mjs +523 -523
  98. package/vendor/heyspex-mcp/on-deck-scheduler.mjs +1708 -1708
  99. package/vendor/heyspex-mcp/procedure-handlers.mjs +327 -327
  100. package/vendor/heyspex-mcp/procedure-tools.mjs +1209 -1181
  101. package/vendor/heyspex-mcp/research-tools.mjs +22 -2
  102. package/vendor/heyspex-mcp/seat-assign-cli.mjs +242 -0
  103. package/vendor/heyspex-mcp/seat-assignment-rules.mjs +96 -0
  104. package/vendor/heyspex-mcp/seat-assignments-client.mjs +265 -0
  105. package/vendor/heyspex-mcp/seat-defaults-cli.mjs +45 -0
  106. package/vendor/heyspex-mcp/seat-defaults.mjs +232 -0
  107. package/vendor/heyspex-mcp/seat-identity.mjs +171 -0
  108. package/vendor/heyspex-mcp/test-helpers.mjs +37 -23
  109. package/vendor/heyspex-mcp/vault-io.mjs +720 -720
  110. package/bin/postinstall.mjs +0 -88
@@ -1,88 +0,0 @@
1
- #!/usr/bin/env node
2
- // Root postinstall guard. The dev-machine setup steps (PM control-center deps,
3
- // Claude Code hooks, CommandCode update) live under scripts/, which
4
- // .vercelignore excludes from the Vercel upload — so on Vercel (or any CI, or
5
- // any environment where scripts/ is absent) this must exit 0 instead of
6
- // crashing `npm install` with MODULE_NOT_FOUND. Lives in bin/ (uploaded to
7
- // Vercel) precisely so the guard itself always resolves.
8
- import { existsSync } from "node:fs";
9
- import { spawnSync } from "node:child_process";
10
- import { dirname, join } from "node:path";
11
- import { fileURLToPath, pathToFileURL } from "node:url";
12
-
13
- const repoRoot = dirname(dirname(fileURLToPath(import.meta.url)));
14
-
15
- // Installed as somebody else's dependency (HS-ZJSP): the published `heyspex`
16
- // package ships this file because npm runs the `postinstall` script for every
17
- // consumer, but NONE of the dev-machine setup below belongs in a customer's
18
- // install — and printing a "skipping" line at them is noise, not information.
19
- // A package installed from the registry always lands under a node_modules/
20
- // directory; a clone of this repo never does. Exit silently in the former case.
21
- if (repoRoot.replace(/\\/g, "/").includes("/node_modules/")) {
22
- process.exit(0);
23
- }
24
-
25
- const steps = [
26
- ["scripts/ensure-pm-cc-deps.mjs"],
27
- ["scripts/install-claude-code-hooks.mjs"],
28
- // Cursor's two install surfaces. `.cursor/mcp.json` is gitignored (it is
29
- // machine-local), so without this step a fresh clone opens in Cursor with no
30
- // heyspex MCP server at all; `.cursor/hooks.json` is tracked but merges
31
- // idempotently, and the installer also retires superseded registrations.
32
- ["scripts/install-cursor-mcp.mjs"],
33
- ["scripts/install-cursor-hooks.mjs"],
34
- ["scripts/install-commandcode.mjs", "--update"],
35
- ["scripts/sync-skills.mjs"],
36
- // Git hooks (.git/hooks/ is never cloned) — installs pre-commit + pre-push so a
37
- // single `npm install` on a fresh clone is enough, with no second `npm run setup`.
38
- // No --force: an idempotent re-run no-ops on the HeySpex hook and refuses to
39
- // clobber a foreign pre-commit (exit 1 surfaces that rather than silently replacing).
40
- ["scripts/install-git-hooks.mjs"],
41
- ];
42
-
43
- if (process.env.VERCEL || process.env.CI) {
44
- console.log("[postinstall] VERCEL/CI detected — skipping dev-machine setup.");
45
- process.exit(0);
46
- }
47
-
48
- for (const [script, ...args] of steps) {
49
- const abs = join(repoRoot, script);
50
- if (!existsSync(abs)) {
51
- console.log(`[postinstall] ${script} not present — skipping dev-machine setup.`);
52
- process.exit(0);
53
- }
54
- const { status } = spawnSync(process.execPath, [abs, ...args], {
55
- cwd: repoRoot,
56
- stdio: "inherit",
57
- });
58
- if (status !== 0) process.exit(status ?? 1);
59
- }
60
-
61
- // Advisory only, never fatal, and deliberately NOT `npm link` itself: a
62
- // postinstall that mutates the machine's global npm prefix would repoint `hs`
63
- // away from whatever clone owned it, silently, on every install. `npm install`
64
- // completing clean while `hs` resolves nowhere is exactly the fresh-machine
65
- // failure in [[HS-BFXF-WBJU-DIAG-hs-never-resolves-on-a-fresh-machine]] — so
66
- // say so here, where a new operator is already looking, and let `npm run
67
- // doctor` carry the full check. Imported dynamically so the published package
68
- // (which ships this file but not scripts/) can never fail to resolve it.
69
- const hsLinkLib = join(repoRoot, "scripts/lib/hs-link.mjs");
70
- if (existsSync(hsLinkLib)) {
71
- try {
72
- const { describeHsLink } = await import(pathToFileURL(hsLinkLib).href);
73
- const link = describeHsLink(repoRoot);
74
- if (link.status !== "linked") {
75
- const what = {
76
- missing: "does not resolve on PATH",
77
- foreign: `resolves to an unrelated tool (${link.target})`,
78
- "other-checkout": `resolves to a DIFFERENT checkout (${link.target})`,
79
- unreadable: `resolves to ${link.shim}, whose target could not be read`,
80
- }[link.status];
81
- console.log(`[postinstall] heads up: \`hs\` ${what}.`);
82
- console.log("[postinstall] Run `npm link` once from this repo root to put hs/heyspex/heyspex-mcp on PATH.");
83
- console.log("[postinstall] Until then use `node bin/hs.mjs …` — never `npx hs` (unrelated package). Details: `npm run doctor`.");
84
- }
85
- } catch {
86
- // An advisory that crashes the install would be worse than no advisory.
87
- }
88
- }