@haystackeditor/cli 0.15.27 → 0.15.29

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 (55) hide show
  1. package/README.md +13 -20
  2. package/dist/assets/hooks/agent-context/detect.ts +7 -7
  3. package/dist/assets/hooks/agent-context/parsers/claude.ts +1 -1
  4. package/dist/assets/hooks/scripts/commit-msg.sh +1 -3
  5. package/dist/assets/hooks/scripts/post-commit.sh +1 -3
  6. package/dist/assets/hooks/scripts/pre-push.sh +1 -4
  7. package/dist/assets/hooks/scripts/prepare-commit-msg.sh +1 -2
  8. package/dist/assets/telemetry/browser-runtime.js +668 -43
  9. package/dist/assets/telemetry/runtime.cjs +62 -68
  10. package/dist/commands/design-verify.d.ts +11 -3
  11. package/dist/commands/design-verify.js +147 -4
  12. package/dist/commands/hooks.d.ts +1 -5
  13. package/dist/commands/hooks.js +10 -112
  14. package/dist/commands/install-session-hooks.d.ts +2 -2
  15. package/dist/commands/install-session-hooks.js +71 -21
  16. package/dist/commands/mcp.js +1 -34
  17. package/dist/commands/pr.js +2 -7
  18. package/dist/commands/setup.d.ts +1 -2
  19. package/dist/commands/setup.js +18 -272
  20. package/dist/commands/submit.js +1 -2
  21. package/dist/commands/verify-hosted-mcp.js +12 -2
  22. package/dist/commands/verify-hosted-reproducibility.d.ts +1 -0
  23. package/dist/commands/verify-hosted-reproducibility.js +4 -1
  24. package/dist/commands/verify-hosted.d.ts +20 -0
  25. package/dist/commands/verify-hosted.js +119 -11
  26. package/dist/commands/verify-precompute.d.ts +19 -0
  27. package/dist/commands/verify-precompute.js +328 -0
  28. package/dist/index.js +45 -44
  29. package/dist/schema.d.ts +1 -2
  30. package/dist/schema.js +1 -2
  31. package/dist/triage/prompts.d.ts +0 -7
  32. package/dist/triage/prompts.js +0 -145
  33. package/dist/triage/runner.js +3 -22
  34. package/dist/triage/types.d.ts +1 -8
  35. package/dist/types.d.ts +8 -8
  36. package/dist/types.js +1 -1
  37. package/dist/utils/design-verifier-api.d.ts +71 -0
  38. package/dist/utils/design-verifier-api.js +96 -0
  39. package/dist/utils/design-verifier-result.d.ts +7 -2
  40. package/dist/utils/design-verifier-result.js +67 -21
  41. package/dist/utils/git.d.ts +5 -1
  42. package/dist/utils/git.js +19 -9
  43. package/dist/utils/github-api.js +11 -14
  44. package/dist/utils/hooks.d.ts +1 -15
  45. package/dist/utils/hooks.js +1 -127
  46. package/dist/utils/telemetry.d.ts +2 -0
  47. package/dist/utils/telemetry.js +81 -8
  48. package/package.json +2 -1
  49. package/schemas/cloud-verifier.v1.json +69 -3
  50. package/schemas/{pr.v2.json → pr.v3.json} +3 -12
  51. package/dist/commands/traces.d.ts +0 -48
  52. package/dist/commands/traces.js +0 -92
  53. package/dist/triage/traces.d.ts +0 -20
  54. package/dist/triage/traces.js +0 -311
  55. package/schemas/traces.v1.json +0 -53
package/README.md CHANGED
@@ -19,6 +19,13 @@ The `setup` command walks you through an interactive wizard:
19
19
  5. **Review and toggle** discovered items
20
20
  6. **Write `.haystack.json`** to your repos
21
21
 
22
+ The CLI sends limited operational events to PostHog by default so Haystack can
23
+ measure setup reliability. Events contain a pseudonymous machine identifier,
24
+ CLI/version/platform fields, command-step and error categories, and numeric
25
+ outcomes. They exclude source code, repository names, local paths, usernames,
26
+ hostnames, and raw error text. IP enrichment is disabled. Set `DO_NOT_TRACK=1`
27
+ or `HAYSTACK_TELEMETRY_DISABLED=1` to turn this telemetry off.
28
+
22
29
  ---
23
30
 
24
31
  ## For AI agents: the machine-readable contract
@@ -62,8 +69,8 @@ haystack triage <ref> --json # poll findings later / after --no-wait
62
69
 
63
70
  **`haystack mcp`** runs a stdio MCP server exposing the same payloads as tools:
64
71
  `inbox_list`, `pr_get`, `pr_status`, `triage_get`, `ask_haystack`,
65
- `traces_list`, `traces_get`, `dismiss`, `mark_reviewed`, `undismiss`,
66
- `request_review`, `trigger_review`, and `schema`.
72
+ `dismiss`, `mark_reviewed`, `undismiss`, `request_review`, `trigger_review`,
73
+ and `schema`.
67
74
 
68
75
  **`haystack verify mcp`** runs the cloud-verifier MCP server. Retained
69
76
  application state is available through `verify_reopen`, `verify_refork`, and
@@ -259,7 +266,7 @@ haystack inbox list --json
259
266
 
260
267
  ### `haystack pr get`
261
268
 
262
- Get the useful state of one PR: triage, minimal merge blockers, and customer-trace availability:
269
+ Get the useful state of one PR: triage and minimal merge blockers:
263
270
 
264
271
  ```bash
265
272
  haystack pr get 42
@@ -278,18 +285,6 @@ haystack ask owner/repo#42 "What about its callers?" --session <session-id> --js
278
285
 
279
286
  Chat may search the complete authorized repository when the changed files are insufficient. Search results and fetched source are included in `evidence`.
280
287
 
281
- ### `haystack traces`
282
-
283
- Inspect retained customer-owned Entire checkpoints and transcript chunks:
284
-
285
- ```bash
286
- haystack traces list owner/repo#42 --json
287
- haystack traces get owner/repo#42 <checkpoint-id> --json
288
- haystack traces get owner/repo#42 <checkpoint-id> --cursor 20 --limit 20 --json
289
- ```
290
-
291
- These commands expose customer coding-session data, not Haystack's internal analysis-agent execution.
292
-
293
288
  ### `haystack review`
294
289
 
295
290
  Trigger a fresh *machine* analysis of a PR's current head (Haystack analyzes once at PR open; later pushes only get a resolution check). For requesting *human* review, use `haystack request-review`.
@@ -431,14 +426,12 @@ reviewer runs on ordinary verification requests or routine golden refreshes.
431
426
  Manage git hooks for AI agent quality checks:
432
427
 
433
428
  ```bash
434
- # Install hooks + Entire CLI
435
- haystack hooks install # Install with pinned Entire version
429
+ # Install hooks
430
+ haystack hooks install
436
431
  haystack hooks install --force # Overwrite existing hooks
437
- haystack hooks install --skip-entire # Only install Haystack hooks
438
432
 
439
- # Status and updates
433
+ # Status
440
434
  haystack hooks status # Check installation status
441
- haystack hooks update # Update Entire CLI to latest
442
435
 
443
436
  # Session hooks (triage on CLI start)
444
437
  haystack hooks install-session # Auto-detect CLIs
@@ -153,11 +153,11 @@ function codexSessionMatchesRepo(
153
153
  }
154
154
 
155
155
  function getCodexSessionRoots(): string[] {
156
- const overrideDir = process.env.ENTIRE_TEST_CODEX_SESSION_DIR;
156
+ const overrideDir = process.env.HAYSTACK_TEST_CODEX_SESSION_DIR;
157
157
  if (overrideDir) return [overrideDir];
158
158
 
159
159
  const codexHome =
160
- process.env.ENTIRE_TEST_CODEX_HOME ||
160
+ process.env.HAYSTACK_TEST_CODEX_HOME ||
161
161
  process.env.CODEX_HOME ||
162
162
  path.join(os.homedir(), '.codex');
163
163
 
@@ -176,7 +176,7 @@ function extractCodexSessionId(filePath: string): string {
176
176
  }
177
177
 
178
178
  function detectClaude(repoPath: string): DetectionResult {
179
- const overrideDir = process.env.ENTIRE_TEST_CLAUDE_PROJECT_DIR;
179
+ const overrideDir = process.env.HAYSTACK_TEST_CLAUDE_PROJECT_DIR;
180
180
  const sessionDir =
181
181
  overrideDir ||
182
182
  path.join(os.homedir(), '.claude', 'projects', sanitizePath(repoPath));
@@ -195,7 +195,7 @@ function detectClaude(repoPath: string): DetectionResult {
195
195
  }
196
196
 
197
197
  function detectGemini(repoPath: string): DetectionResult {
198
- const overrideDir = process.env.ENTIRE_TEST_GEMINI_PROJECT_DIR;
198
+ const overrideDir = process.env.HAYSTACK_TEST_GEMINI_PROJECT_DIR;
199
199
  const projectHash = sha256(repoPath);
200
200
  const sessionDir =
201
201
  overrideDir ||
@@ -215,10 +215,10 @@ function detectGemini(repoPath: string): DetectionResult {
215
215
  }
216
216
 
217
217
  function detectOpenCode(repoPath: string): DetectionResult {
218
- const overrideDir = process.env.ENTIRE_TEST_OPENCODE_PROJECT_DIR;
218
+ const overrideDir = process.env.HAYSTACK_TEST_OPENCODE_PROJECT_DIR;
219
219
  const sessionDir =
220
220
  overrideDir ||
221
- path.join(os.tmpdir(), 'entire-opencode', sanitizePath(repoPath));
221
+ path.join(os.tmpdir(), 'haystack-opencode', sanitizePath(repoPath));
222
222
 
223
223
  const sessionFile = findMostRecentFile(sessionDir, /\.json$/);
224
224
  if (!sessionFile || !isRecent(sessionFile)) {
@@ -234,7 +234,7 @@ function detectOpenCode(repoPath: string): DetectionResult {
234
234
  }
235
235
 
236
236
  function detectCodex(repoPath: string): DetectionResult {
237
- const overrideFile = process.env.ENTIRE_TEST_CODEX_SESSION_FILE;
237
+ const overrideFile = process.env.HAYSTACK_TEST_CODEX_SESSION_FILE;
238
238
  if (
239
239
  overrideFile &&
240
240
  isRecent(overrideFile) &&
@@ -38,7 +38,7 @@ interface ClaudeLine {
38
38
  cache_read_input_tokens?: number;
39
39
  };
40
40
  };
41
- // New Entire CLI format: id/content at top level (type is the role)
41
+ // Alternate format: id/content at top level (type is the role)
42
42
  id?: string;
43
43
  content?: unknown;
44
44
  }
@@ -1,4 +1,2 @@
1
1
  #!/bin/sh
2
- # Haystack hooks (powered by Entire)
3
- # Commit-msg hook: strip trailer if no user content (allows aborting empty commits)
4
- "$HOME/.haystack/bin/entire" hooks git commit-msg "$1" || exit 1
2
+ # Haystack commit-msg hook
@@ -1,4 +1,2 @@
1
1
  #!/bin/sh
2
- # Haystack hooks (powered by Entire)
3
- # Post-commit hook: condense session data if commit has Entire-Checkpoint trailer
4
- "$HOME/.haystack/bin/entire" hooks git post-commit 2>/dev/null || true
2
+ # Haystack post-commit hook
@@ -1,6 +1,5 @@
1
1
  #!/bin/sh
2
- # Haystack hooks (powered by Entire)
3
- # Pre-push hook: push session logs alongside user's push
2
+ # Haystack pre-push hook
4
3
  # $1 is the remote name (e.g., "origin")
5
4
 
6
5
  # Check if pushing a non-haystack branch and remind about haystack submit
@@ -21,5 +20,3 @@ if [ -n "$current_branch" ] && [ "$current_branch" != "main" ] && [ "$current_br
21
20
  ;;
22
21
  esac
23
22
  fi
24
-
25
- "$HOME/.haystack/bin/entire" hooks git pre-push "$1" || true
@@ -1,3 +1,2 @@
1
1
  #!/bin/sh
2
- # Haystack hooks (powered by Entire)
3
- "$HOME/.haystack/bin/entire" hooks git prepare-commit-msg "$1" "$2" 2>/dev/null || true
2
+ # Haystack prepare-commit-msg hook