heyspex 0.2.6 → 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 (85) hide show
  1. package/bin/hs.mjs +85 -25
  2. package/bin/spexcode.mjs +31 -0
  3. package/dev-factory/lib/local-firecrawl.mjs +294 -0
  4. package/dev-factory/lib/seat-context.mjs +20 -4
  5. package/dev-factory/model-catalog.json +222 -222
  6. package/dev-factory/spexcrawl/firecrawl-cli.mjs +755 -0
  7. package/dist/cli/hs-connect.mjs +20 -2
  8. package/dist/cli/hs-defer.mjs +19 -1
  9. package/dist/cli/hs-index-rebuild.mjs +19 -1
  10. package/dist/cli/hs-index-reconcile.mjs +19 -1
  11. package/dist/cli/hs-init.mjs +2 -2
  12. package/dist/cli/hs-install.mjs +2 -2
  13. package/dist/cli/hs-join.mjs +20 -2
  14. package/dist/cli/hs-next-launch.mjs +89 -10
  15. package/dist/cli/hs-spawn.mjs +27 -1
  16. package/dist/cli/hs-vault-pull.mjs +19 -1
  17. package/dist/cli/hs-vault-push.mjs +19 -1
  18. package/dist/cli/hs-vault.mjs +21 -7
  19. package/dist/cli/hs-workspace.mjs +19 -1
  20. package/dist/cli-templates/customer-vault/specs/entity-model.md +1728 -1728
  21. package/dist/cli-templates/customer-vault/specs/protocols/canonical-frontmatter-templates.md +464 -464
  22. package/dist/cli-templates/customer-vault/specs/protocols/destructive-action-checklist.md +122 -122
  23. package/dist/cli-templates/customer-vault/specs/protocols/memory-protocol.md +46 -46
  24. package/dist/cli-templates/customer-vault/specs/protocols/spec-hierarchy.md +530 -530
  25. package/dist/cli-templates/customer-vault/specs/protocols/spec-summary-authoring.md +83 -83
  26. package/dist/cli-templates/harness-commands/claude/hs-backfill.md +28 -28
  27. package/dist/cli-templates/harness-commands/claude/hs-capture.md +62 -62
  28. package/dist/cli-templates/harness-commands/claude/hs-defer.md +29 -29
  29. package/dist/cli-templates/harness-commands/claude/hs-ground.md +30 -30
  30. package/dist/cli-templates/harness-commands/claude/hs-next.md +29 -29
  31. package/dist/cli-templates/harness-commands/claude/hs-promote.md +70 -70
  32. package/dist/cli-templates/harness-commands/claude/hs-push.md +35 -35
  33. package/dist/cli-templates/harness-commands/claude/hs-qc.md +27 -27
  34. package/dist/cli-templates/harness-commands/claude/hs-res.md +20 -8
  35. package/dist/cli-templates/harness-commands/claude/hs-resolve.md +23 -23
  36. package/dist/cli-templates/harness-commands/claude/hs-view.md +28 -28
  37. package/dist/cli-templates/harness-commands/claude/kill-ports.md +32 -32
  38. package/dist/cli-templates/harness-commands/claude/prototype.md +91 -91
  39. package/dist/cli-templates/harness-commands/cursor/hs-backfill.md +22 -22
  40. package/dist/cli-templates/harness-commands/cursor/hs-capture.md +56 -56
  41. package/dist/cli-templates/harness-commands/cursor/hs-defer.md +23 -23
  42. package/dist/cli-templates/harness-commands/cursor/hs-ground.md +24 -24
  43. package/dist/cli-templates/harness-commands/cursor/hs-next.md +23 -23
  44. package/dist/cli-templates/harness-commands/cursor/hs-promote.md +64 -64
  45. package/dist/cli-templates/harness-commands/cursor/hs-push.md +29 -29
  46. package/dist/cli-templates/harness-commands/cursor/hs-qc.md +21 -21
  47. package/dist/cli-templates/harness-commands/cursor/hs-res.md +20 -8
  48. package/dist/cli-templates/harness-commands/cursor/hs-resolve.md +17 -17
  49. package/dist/cli-templates/harness-commands/cursor/hs-view.md +23 -23
  50. package/dist/cli-templates/harness-commands/cursor/kill-ports.md +26 -26
  51. package/dist/cli-templates/harness-commands/cursor/prototype.md +86 -86
  52. package/docs/copilot-plugin-install.md +7 -0
  53. package/docs/mcp-client-config.md +6 -0
  54. package/package.json +7 -2
  55. package/plugins/heyspex/README.md +6 -0
  56. package/plugins/heyspex/bin/launch-mcp.mjs +17 -0
  57. package/plugins/heyspex/hooks/hooks.json +418 -418
  58. package/scripts/claude-hooks/_intent-classifier-semantic.mjs +2 -2
  59. package/scripts/hs-companion.mjs +38 -8
  60. package/scripts/lib/companion-install.mjs +768 -0
  61. package/scripts/lib/customer-kit.mjs +5 -3
  62. package/scripts/lib/hs-companion-settings.mjs +1 -0
  63. package/scripts/lib/hs-source-push.mjs +386 -386
  64. package/spexharness/doctrine/baseline/SPEXCODE-DOCTRINE.baseline.json +29 -29
  65. package/spexharness/src/adapters/copilot-models.mjs +179 -0
  66. package/spexharness/src/adapters/harness-detect.mjs +148 -0
  67. package/spexharness/src/gates/directive-obligation-gate.decide.mjs +132 -132
  68. package/spexharness/src/gates/vault-write-tier-guard.decide.mjs +153 -125
  69. package/spexharness/src/seat-context.mjs +10 -5
  70. package/spexharness/src/session-bootstrap.mjs +6 -3
  71. package/vendor/heyspex-mcp/cli.mjs +6 -1
  72. package/vendor/heyspex-mcp/config-seed.yaml +15 -15
  73. package/vendor/heyspex-mcp/dev-factory-overlay.mjs +142 -0
  74. package/vendor/heyspex-mcp/memory-tools.mjs +523 -523
  75. package/vendor/heyspex-mcp/on-deck-scheduler.mjs +1708 -1708
  76. package/vendor/heyspex-mcp/procedure-handlers.mjs +327 -327
  77. package/vendor/heyspex-mcp/procedure-tools.mjs +1209 -1181
  78. package/vendor/heyspex-mcp/research-tools.mjs +22 -2
  79. package/vendor/heyspex-mcp/seat-assign-cli.mjs +242 -0
  80. package/vendor/heyspex-mcp/seat-assignment-rules.mjs +96 -0
  81. package/vendor/heyspex-mcp/seat-assignments-client.mjs +265 -0
  82. package/vendor/heyspex-mcp/seat-defaults-cli.mjs +45 -0
  83. package/vendor/heyspex-mcp/seat-defaults.mjs +232 -0
  84. package/vendor/heyspex-mcp/seat-identity.mjs +171 -0
  85. package/vendor/heyspex-mcp/vault-io.mjs +720 -720
@@ -33,7 +33,7 @@
33
33
  // semantic_enabled: true|false (default true — turns Layer 2 on/off entirely)
34
34
  // mode: self_check|model (default self_check — deterministic injection;
35
35
  // `model` opts into the Ollama fallback below)
36
- // endpoint: Ollama base URL (default http://192.168.1.252:11434 — mode:model only)
36
+ // endpoint: Ollama base URL (default http://localhost:11434 — mode:model only; HS-J3NY: never the owner's LAN box)
37
37
  // model: model name (default qwen3:8b — mode:model only)
38
38
  // timeout_ms: request budget (default 2500 — the hook's overall budget is 5s)
39
39
  // min_confidence: fire threshold (default 0.7 — consumed by the calling hook)
@@ -74,7 +74,7 @@ export const SEMANTIC_MODES = Object.freeze(['self_check', 'model']);
74
74
  export const DEFAULTS = Object.freeze({
75
75
  semanticEnabled: true,
76
76
  semanticMode: 'self_check',
77
- endpoint: 'http://192.168.1.252:11434',
77
+ endpoint: 'http://localhost:11434',
78
78
  model: 'qwen3:8b',
79
79
  timeoutMs: 2500,
80
80
  minConfidence: 0.7,
@@ -5,6 +5,11 @@
5
5
  * start|stop|status|build tray-host lifecycle → companion/start.ps1 (PowerShell 7),
6
6
  * which launches companion/src/HeySpex.Companion.Host directly
7
7
  * (the versioned-folder indirection was retired 2026-08-12).
8
+ * From an installed npm package (no companion/ source) they
9
+ * drive the SpexCompanion the Windows setup installed, or offer
10
+ * the install ([[HS-056P-EH9T-EPIC-npx-heyspex-companion-install-front-door]]).
11
+ * install [--quiet|--dry-run] download + SHA-256 + Authenticode check + run the signed
12
+ * SpexCompanionSetup.exe (scripts/lib/companion-install.mjs).
8
13
  * settings list|get|set every Companion setting, via the console's
9
14
  * GET/PUT /api/companion/settings ([[HS-UDH1]]); plus the
10
15
  * short aliases (mute, volume, orb, wake, ...).
@@ -22,10 +27,10 @@ import { fileURLToPath } from "node:url";
22
27
  import {
23
28
  makeCompanionConsoleFetch,
24
29
  parseCompanionArgs,
25
- renderCompanionNotDistributed,
26
30
  renderHelp,
27
31
  runCompanionSettings,
28
32
  } from "./lib/hs-companion-settings.mjs";
33
+ import { runCompanionInstall, runInstalledCompanionHost } from "./lib/companion-install.mjs";
29
34
 
30
35
  const PKG_ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
31
36
  const START_PS1 = path.join(PKG_ROOT, "companion", "start.ps1");
@@ -37,11 +42,10 @@ function resolvePwsh() {
37
42
  function runHost(sub, rest) {
38
43
  if (!existsSync(START_PS1)) {
39
44
  // No companion/ source beside this script: an installed npm package, not a
40
- // repo checkout (the tarball never ships companion/). Say so instead of
41
- // naming a path the customer can do nothing about.
45
+ // repo checkout (the tarball never ships companion/). Drive the Companion
46
+ // the Windows setup installed, or offer `npx heyspex companion install`.
42
47
  if (!existsSync(path.join(PKG_ROOT, "companion"))) {
43
- process.stderr.write(`${renderCompanionNotDistributed(sub)}\n`);
44
- process.exit(1);
48
+ process.exit(runInstalledCompanionHost(sub));
45
49
  }
46
50
  process.stderr.write(`hs companion: start script not found at ${START_PS1}\n`);
47
51
  process.exit(1);
@@ -63,7 +67,32 @@ function runHost(sub, rest) {
63
67
  });
64
68
  }
65
69
 
70
+ /** A one-line download progress meter, on an interactive stderr only. */
71
+ function progressMeter() {
72
+ if (!process.stderr.isTTY) return null;
73
+ let last = -2;
74
+ return ({ received, total }) => {
75
+ const pct = total ? Math.floor((received / total) * 100) : -1;
76
+ if (pct === last && pct !== -1) return;
77
+ last = pct;
78
+ const mb = (received / 1048576).toFixed(1);
79
+ process.stderr.write(`\r ${pct < 0 ? `${mb} MB` : `${pct}% (${mb} MB)`}${pct === 100 ? "\n" : ""}`);
80
+ };
81
+ }
82
+
83
+ // The async paths below (install, settings) make TLS requests, so they set
84
+ // process.exitCode and return instead of calling process.exit(): on Windows with
85
+ // Node 24, process.exit() while undici's pooled socket is still closing aborts
86
+ // with `Assertion failed: !(handle->flags & UV_HANDLE_CLOSING)` (exit
87
+ // 0xC0000409/127) after the right output was printed
88
+ // ([[HS-5HM6-EH9T-DIAG-companion-install-dry-run-native]], same root cause as
89
+ // [[HS-94QX-ZZKK-DIAG-cli-entrypoints-exit-with-process-exit]]).
66
90
  async function main(argv) {
91
+ if (argv[0] === "install") {
92
+ process.exitCode = await runCompanionInstall(argv.slice(1), { progress: progressMeter() });
93
+ return;
94
+ }
95
+
67
96
  const parsed = parseCompanionArgs(argv);
68
97
 
69
98
  if (parsed.error) {
@@ -84,13 +113,14 @@ async function main(argv) {
84
113
  const result = await runCompanionSettings(parsed, { consoleFetch });
85
114
  if (result.ok) {
86
115
  process.stdout.write(`${result.stdout}\n`);
87
- process.exit(0);
116
+ process.exitCode = 0;
117
+ return;
88
118
  }
89
119
  process.stderr.write(`hs companion: ${result.stderr}\n`);
90
- process.exit(result.exitCode);
120
+ process.exitCode = result.exitCode;
91
121
  }
92
122
 
93
123
  main(process.argv.slice(2)).catch((err) => {
94
124
  process.stderr.write(`hs companion: ${err.message}\n`);
95
- process.exit(1);
125
+ process.exitCode = 1;
96
126
  });