@haystackeditor/cli 0.15.31 → 0.17.0
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 +141 -61
- package/dist/assets/hooks/scripts/commit-msg.sh +3 -0
- package/dist/assets/hooks/scripts/post-commit.sh +3 -0
- package/dist/assets/hooks/scripts/pre-commit.sh +11 -6
- package/dist/assets/hooks/scripts/pre-push.sh +3 -0
- package/dist/assets/hooks/scripts/prepare-commit-msg.sh +3 -0
- package/dist/commands/case-batch-contract.js +694 -0
- package/dist/commands/case-batch.js +1011 -0
- package/dist/commands/cloud-verifier-identity-census.js +5 -2
- package/dist/commands/combination-search-hook.js +139 -0
- package/dist/commands/dismiss.js +2 -1
- package/dist/commands/hooks.js +66 -7
- package/dist/commands/install-session-hooks.js +131 -44
- package/dist/commands/policy.js +32 -45
- package/dist/commands/precompute-delivery.js +6 -1
- package/dist/commands/scaffold-provisional-universe.js +8 -10
- package/dist/commands/setup.js +32 -10
- package/dist/commands/submit.js +39 -71
- package/dist/commands/telemetry.js +17 -2
- package/dist/commands/triage.js +2 -1
- package/dist/commands/verify-explore.js +1 -0
- package/dist/commands/verify-hosted-mcp.js +3 -12
- package/dist/commands/verify-hosted-reproducibility.js +49 -547
- package/dist/commands/verify-hosted.js +66 -168
- package/dist/commands/verify-precompute.js +64 -11
- package/dist/commands/verify.js +51 -139
- package/dist/index.js +290 -366
- package/dist/lazy.js +8 -0
- package/dist/schema.js +2 -1
- package/dist/tools/detect.js +3 -24
- package/dist/triage/astra.js +199 -0
- package/dist/triage/prompts.js +145 -179
- package/dist/triage/runner.js +104 -300
- package/dist/triage/types.js +2 -2
- package/dist/types.js +2 -6
- package/dist/utils/auth.js +14 -2
- package/dist/utils/git.js +60 -29
- package/dist/utils/github-api.js +14 -1
- package/dist/utils/haystack-api.js +38 -7
- package/dist/utils/hooks.js +43 -6
- package/dist/utils/prompter.js +25 -10
- package/dist/utils/safe-write.js +31 -0
- package/dist/utils/secret-paths.js +115 -0
- package/dist/utils/secrets.js +0 -1
- package/dist/utils/telemetry.js +34 -14
- package/dist/utils/update-check.js +151 -0
- package/package.json +19 -14
- package/schemas/case-batch.v1.json +235 -0
- package/schemas/cloud-verifier.v1.json +55 -100
- package/schemas/submit.v1.json +4 -2
- package/dist/commands/ask.d.ts +0 -14
- package/dist/commands/cloud-verifier-behaviors.d.ts +0 -27
- package/dist/commands/cloud-verifier-data-store-census.d.ts +0 -47
- package/dist/commands/cloud-verifier-data-store-drift.d.ts +0 -42
- package/dist/commands/cloud-verifier-identity-census.d.ts +0 -88
- package/dist/commands/cloud-verifier-materialization.d.ts +0 -16
- package/dist/commands/cloud-verifier-pascal-selector-census.d.ts +0 -29
- package/dist/commands/cloud-verifier-python-manifest-selector-census.d.ts +0 -27
- package/dist/commands/cloud-verifier-specialized-operational-census.d.ts +0 -51
- package/dist/commands/cloud-verifier-universe.d.ts +0 -31
- package/dist/commands/config.d.ts +0 -46
- package/dist/commands/design-verify.d.ts +0 -33
- package/dist/commands/dismiss.d.ts +0 -29
- package/dist/commands/hooks.d.ts +0 -13
- package/dist/commands/inbox.d.ts +0 -65
- package/dist/commands/init.d.ts +0 -10
- package/dist/commands/install-session-hooks.d.ts +0 -17
- package/dist/commands/login.d.ts +0 -8
- package/dist/commands/mcp.d.ts +0 -1
- package/dist/commands/policy.d.ts +0 -31
- package/dist/commands/pr-status.d.ts +0 -144
- package/dist/commands/pr.d.ts +0 -40
- package/dist/commands/precompute-delivery-contract.d.ts +0 -68
- package/dist/commands/precompute-delivery.d.ts +0 -20
- package/dist/commands/prepare-universe-review.d.ts +0 -115
- package/dist/commands/production-source-deny-policy.d.ts +0 -15
- package/dist/commands/request-review.d.ts +0 -26
- package/dist/commands/review.d.ts +0 -25
- package/dist/commands/rules.d.ts +0 -4
- package/dist/commands/scaffold-provisional-universe.d.ts +0 -468
- package/dist/commands/schema-cmd.d.ts +0 -2
- package/dist/commands/setup.d.ts +0 -28
- package/dist/commands/skills.d.ts +0 -8
- package/dist/commands/status.d.ts +0 -4
- package/dist/commands/submit.d.ts +0 -30
- package/dist/commands/system-map.d.ts +0 -42
- package/dist/commands/telemetry.d.ts +0 -53
- package/dist/commands/tokens.d.ts +0 -14
- package/dist/commands/triage.d.ts +0 -35
- package/dist/commands/verify-core.d.ts +0 -449
- package/dist/commands/verify-core.js +0 -789
- package/dist/commands/verify-explore.d.ts +0 -14
- package/dist/commands/verify-history.d.ts +0 -14
- package/dist/commands/verify-hosted-mcp.d.ts +0 -12
- package/dist/commands/verify-hosted-reproducibility.d.ts +0 -90
- package/dist/commands/verify-hosted.d.ts +0 -92
- package/dist/commands/verify-mcp.d.ts +0 -8
- package/dist/commands/verify-mcp.js +0 -517
- package/dist/commands/verify-ops.d.ts +0 -158
- package/dist/commands/verify-ops.js +0 -1148
- package/dist/commands/verify-precompute.d.ts +0 -30
- package/dist/commands/verify-reproducibility.d.ts +0 -85
- package/dist/commands/verify-reproducibility.js +0 -494
- package/dist/commands/verify-reseal.d.ts +0 -9
- package/dist/commands/verify-reseal.js +0 -148
- package/dist/commands/verify-sandboxes.d.ts +0 -95
- package/dist/commands/verify-sandboxes.js +0 -352
- package/dist/commands/verify.d.ts +0 -28
- package/dist/commands/webhooks.d.ts +0 -30
- package/dist/index.d.ts +0 -22
- package/dist/schema.d.ts +0 -28
- package/dist/states.d.ts +0 -29
- package/dist/tools/detect.d.ts +0 -50
- package/dist/triage/prompts.d.ts +0 -24
- package/dist/triage/runner.d.ts +0 -34
- package/dist/triage/types.d.ts +0 -42
- package/dist/types/verify-history.d.ts +0 -38
- package/dist/types.d.ts +0 -1684
- package/dist/utils/action-output.d.ts +0 -24
- package/dist/utils/analysis-api.d.ts +0 -187
- package/dist/utils/auth.d.ts +0 -79
- package/dist/utils/config.d.ts +0 -24
- package/dist/utils/design-verifier-api.d.ts +0 -208
- package/dist/utils/design-verifier-history.d.ts +0 -46
- package/dist/utils/design-verifier-result.d.ts +0 -74
- package/dist/utils/detect.d.ts +0 -43
- package/dist/utils/git.d.ts +0 -135
- package/dist/utils/github-api.d.ts +0 -104
- package/dist/utils/haystack-api.d.ts +0 -37
- package/dist/utils/hooks.d.ts +0 -12
- package/dist/utils/pending-state.d.ts +0 -40
- package/dist/utils/pr-ref.d.ts +0 -27
- package/dist/utils/prompter.d.ts +0 -85
- package/dist/utils/secrets.d.ts +0 -47
- package/dist/utils/telemetry.d.ts +0 -19
- /package/dist/commands/{precompute-delivery-worker.d.ts → combination-search-hook-contract.js} +0 -0
package/dist/schema.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stable machine-readable schema versions for each `--json` output.
|
|
3
|
-
*
|
|
4
|
-
* Bump semantics (per docs/SPEC-CLI-FIRST-CLASS.md):
|
|
5
|
-
* patch — additive fields only
|
|
6
|
-
* minor — field deprecated (kept emitting for one minor with _deprecated: true)
|
|
7
|
-
* major — removal / rename
|
|
8
|
-
*
|
|
9
|
-
* One schema, two transports: every webhook payload for the corresponding noun
|
|
10
|
-
* uses the same envelope as the `--json` output, byte-for-byte.
|
|
11
|
-
*/
|
|
12
|
-
export declare const SCHEMA_VERSIONS: {
|
|
13
|
-
readonly triage: "2.0.0";
|
|
14
|
-
readonly setup: "1.0.0";
|
|
15
|
-
readonly pr: "3.0.0";
|
|
16
|
-
readonly 'pr-status': "1.0.0";
|
|
17
|
-
readonly inbox: "1.0.0";
|
|
18
|
-
readonly ask: "1.0.0";
|
|
19
|
-
readonly submit: "1.0.0";
|
|
20
|
-
readonly action: "1.0.0";
|
|
21
|
-
readonly 'cloud-verifier': "1.0.0";
|
|
22
|
-
readonly error: "1.0.0";
|
|
23
|
-
};
|
|
24
|
-
export type SchemaName = keyof typeof SCHEMA_VERSIONS;
|
|
25
|
-
/** Wrap a payload with the `schema_version` envelope. */
|
|
26
|
-
export declare function withSchema<T extends Record<string, unknown>>(name: SchemaName, payload: T): T & {
|
|
27
|
-
schema_version: string;
|
|
28
|
-
};
|
package/dist/states.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Canonical machine-readable PR-state vocabulary for every CLI JSON surface.
|
|
3
|
-
*
|
|
4
|
-
* One concept, one spelling: all `--json` output uses snake_case state tokens.
|
|
5
|
-
* Before this module existed the same state appeared as `good_to_merge`
|
|
6
|
-
* (triage/pr get/inbox) and `good-to-merge` (pr-status, raw server buckets),
|
|
7
|
-
* so no single parser worked across commands. Server responses that use
|
|
8
|
-
* kebab-case are normalized at the edge via `normalizeFeedBucket`.
|
|
9
|
-
*/
|
|
10
|
-
/** Public triage verdict — emitted by `triage`, `pr get`, `submit`, `pr-status`. */
|
|
11
|
-
export declare const TRIAGE_VERDICTS: readonly ["good_to_merge", "needs_review", "needs_input"];
|
|
12
|
-
export type TriageVerdict = (typeof TRIAGE_VERDICTS)[number];
|
|
13
|
-
/**
|
|
14
|
-
* Map the server's internal analysis verdict ('clean' | 'has-issues' |
|
|
15
|
-
* 'needs-review', with a rating-based fallback for pre-verdict analyses) to
|
|
16
|
-
* the public triage verdict. This mapping used to be duplicated inline in
|
|
17
|
-
* triage.ts and pr.ts.
|
|
18
|
-
*/
|
|
19
|
-
export declare function toPublicVerdict(analysisVerdict: string | null | undefined, haystackRating?: number | null): TriageVerdict;
|
|
20
|
-
/**
|
|
21
|
-
* Known feed buckets in canonical snake_case form. The server may introduce
|
|
22
|
-
* new buckets; `normalizeFeedBucket` converts mechanically so unknown buckets
|
|
23
|
-
* pass through in the same convention instead of crashing or leaking kebab-case.
|
|
24
|
-
*/
|
|
25
|
-
export declare const FEED_BUCKETS: readonly ["analyzing", "auto_fixing", "good_to_merge", "failed_when_merging", "issues", "needs_assignment", "needs_shepherding", "needs_fixing", "awaiting_review", "review_requested", "snoozed"];
|
|
26
|
-
export type FeedBucket = (typeof FEED_BUCKETS)[number];
|
|
27
|
-
/** Normalize a server feed bucket (kebab-case) to the canonical snake_case form. */
|
|
28
|
-
export declare function normalizeFeedBucket(bucket: string): string;
|
|
29
|
-
export declare function normalizeFeedBucket(bucket: string | null | undefined): string | null;
|
package/dist/tools/detect.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-detection utilities for framework, monorepo, and service configuration.
|
|
3
|
-
* Used by the setup wizard to provide smart defaults.
|
|
4
|
-
*/
|
|
5
|
-
export interface DetectedFramework {
|
|
6
|
-
name: string;
|
|
7
|
-
devCommand: string;
|
|
8
|
-
port: number;
|
|
9
|
-
readyPattern: string;
|
|
10
|
-
configFile: string;
|
|
11
|
-
}
|
|
12
|
-
export interface DetectedService {
|
|
13
|
-
name: string;
|
|
14
|
-
root: string;
|
|
15
|
-
type: 'server' | 'batch';
|
|
16
|
-
framework?: DetectedFramework;
|
|
17
|
-
/** Services this service depends on (detected from proxy config) */
|
|
18
|
-
depends_on?: string[];
|
|
19
|
-
}
|
|
20
|
-
export interface ProxyTarget {
|
|
21
|
-
/** Path pattern being proxied (e.g., "/api") */
|
|
22
|
-
path: string;
|
|
23
|
-
/** Target URL (e.g., "http://localhost:8787") */
|
|
24
|
-
target: string;
|
|
25
|
-
/** Port extracted from target */
|
|
26
|
-
port: number;
|
|
27
|
-
}
|
|
28
|
-
export interface ProjectDetection {
|
|
29
|
-
isMonorepo: boolean;
|
|
30
|
-
packageManager: 'npm' | 'pnpm' | 'yarn' | 'bun';
|
|
31
|
-
frameworks: DetectedFramework[];
|
|
32
|
-
services: DetectedService[];
|
|
33
|
-
/** Proxy targets detected from config files */
|
|
34
|
-
proxyTargets: ProxyTarget[];
|
|
35
|
-
suggestions: {
|
|
36
|
-
projectName: string;
|
|
37
|
-
devCommand: string;
|
|
38
|
-
port: number;
|
|
39
|
-
readyPattern: string;
|
|
40
|
-
authBypassEnv?: string;
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Main detection function - analyzes a project directory
|
|
45
|
-
*/
|
|
46
|
-
export declare function detectProject(rootDir?: string): ProjectDetection;
|
|
47
|
-
/**
|
|
48
|
-
* Format detection results for display to user
|
|
49
|
-
*/
|
|
50
|
-
export declare function formatDetectionSummary(detection: ProjectDetection): string;
|
package/dist/triage/prompts.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Prompt builders for pre-PR triage sub-agents.
|
|
3
|
-
*
|
|
4
|
-
* Each function returns a prompt string that instructs the sub-agent to:
|
|
5
|
-
* 1. Analyze the git diff against the base branch
|
|
6
|
-
* 2. Write structured JSON results to a specific file path
|
|
7
|
-
*
|
|
8
|
-
* The sub-agent uses its own tools (Bash, Read, Grep, etc.) to explore the codebase.
|
|
9
|
-
*/
|
|
10
|
-
/**
|
|
11
|
-
* Build the code review prompt.
|
|
12
|
-
* Always runs — looks for objective bugs in the diff.
|
|
13
|
-
*/
|
|
14
|
-
export declare function buildCodeReviewPrompt(baseBranch: string, outputPath: string, maxTurns: number, timeoutMs: number, precomputedDiff?: string | null): string;
|
|
15
|
-
/**
|
|
16
|
-
* Build the rules validator prompt.
|
|
17
|
-
* Runs if .haystack/pr-rules.yml exists OR agent instruction files are found.
|
|
18
|
-
*
|
|
19
|
-
* @returns The prompt string, or null if no rules content or agent policies provided.
|
|
20
|
-
*/
|
|
21
|
-
export declare function buildRulesValidatorPrompt(baseBranch: string, rulesYaml: string, outputPath: string, maxTurns: number, timeoutMs: number, agentPolicies?: {
|
|
22
|
-
filename: string;
|
|
23
|
-
content: string;
|
|
24
|
-
}[], precomputedDiff?: string | null): string | null;
|
package/dist/triage/runner.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Triage runner — orchestrates parallel sub-agent execution for pre-PR checks.
|
|
3
|
-
*
|
|
4
|
-
* Detects the user's agentic CLI (Claude Code, Codex, Gemini), spawns
|
|
5
|
-
* parallel sub-processes for each checker, and collects structured JSON results.
|
|
6
|
-
*/
|
|
7
|
-
import type { AgenticCLI, TriageResult } from './types.js';
|
|
8
|
-
export interface RunTriageOptions {
|
|
9
|
-
/** Per-checker max-turn overrides (CLI flag > .haystack.json > defaults). */
|
|
10
|
-
maxTurns?: Partial<Record<string, number>>;
|
|
11
|
-
/** Per-checker wall-clock timeout override, in ms. */
|
|
12
|
-
timeoutMs?: number;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Detect which agentic CLI is installed.
|
|
16
|
-
* Returns the first one found, or null if none available.
|
|
17
|
-
*/
|
|
18
|
-
export declare function detectAgenticCLI(): AgenticCLI | null;
|
|
19
|
-
/**
|
|
20
|
-
* Build the CLI command + args for the detected agentic tool.
|
|
21
|
-
*/
|
|
22
|
-
export declare function buildCommand(cli: AgenticCLI, prompt: string, maxTurns: number): {
|
|
23
|
-
command: string;
|
|
24
|
-
args: string[];
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* Run pre-PR triage checks using parallel sub-agent processes.
|
|
28
|
-
*
|
|
29
|
-
* @param gitRoot - Absolute path to the git repository root
|
|
30
|
-
* @param baseBranch - The base branch to diff against (e.g., "main")
|
|
31
|
-
* @returns Aggregated triage results
|
|
32
|
-
* @throws If no agentic CLI is detected
|
|
33
|
-
*/
|
|
34
|
-
export declare function runTriage(gitRoot: string, baseBranch: string, options?: RunTriageOptions): Promise<TriageResult>;
|
package/dist/triage/types.d.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Types for the pre-PR triage system.
|
|
3
|
-
*
|
|
4
|
-
* Sub-agents write results as JSON files matching these schemas.
|
|
5
|
-
* The runner reads and aggregates them.
|
|
6
|
-
*/
|
|
7
|
-
export type TriageSeverity = 'error' | 'warning' | 'info';
|
|
8
|
-
export interface TriageIssue {
|
|
9
|
-
file: string;
|
|
10
|
-
line?: number;
|
|
11
|
-
severity: TriageSeverity;
|
|
12
|
-
message: string;
|
|
13
|
-
/** For rules validator: rule ID (e.g., PR001) */
|
|
14
|
-
rule?: string;
|
|
15
|
-
/** For intent drift: drift pattern */
|
|
16
|
-
pattern?: 'intent_drift' | 'incomplete_fulfillment' | 'scope_creep' | 'unspecified_decision' | 'ignored_correction' | 'weakened_posture' | 'claimed_but_not_done';
|
|
17
|
-
}
|
|
18
|
-
export interface CodeReviewResult {
|
|
19
|
-
checker: 'code-review';
|
|
20
|
-
issues: TriageIssue[];
|
|
21
|
-
summary: string;
|
|
22
|
-
passed: boolean;
|
|
23
|
-
}
|
|
24
|
-
export interface RulesValidatorResult {
|
|
25
|
-
checker: 'rules-validator';
|
|
26
|
-
issues: TriageIssue[];
|
|
27
|
-
summary: string;
|
|
28
|
-
passed: boolean;
|
|
29
|
-
rulesChecked: number;
|
|
30
|
-
}
|
|
31
|
-
export type CheckerResult = CodeReviewResult | RulesValidatorResult;
|
|
32
|
-
export interface TriageResult {
|
|
33
|
-
passed: boolean;
|
|
34
|
-
results: CheckerResult[];
|
|
35
|
-
/** Hard errors — auth failures, crashed sub-agents, unknown failures. Block submit. */
|
|
36
|
-
errors: string[];
|
|
37
|
-
/** Soft failures — sub-agent hit max turns or wall-clock timeout. Do NOT block submit. */
|
|
38
|
-
warnings: string[];
|
|
39
|
-
/** Total duration in ms */
|
|
40
|
-
duration: number;
|
|
41
|
-
}
|
|
42
|
-
export type AgenticCLI = 'claude' | 'codex' | 'gemini';
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/** Read-only history from the active hosted verifier, scoped to the caller's
|
|
2
|
-
* stable GitHub user and repository IDs. Counts describe the returned window,
|
|
3
|
-
* never bug correctness. Missing results remain unknown. */
|
|
4
|
-
export type VerifyHistoryHealth = 'healthy' | 'degraded' | 'infrastructure-error' | 'not-executed' | 'unknown';
|
|
5
|
-
export interface VerifyHistoryRun {
|
|
6
|
-
runId: string;
|
|
7
|
-
baseCommit: string;
|
|
8
|
-
headCommit: string;
|
|
9
|
-
createdAt: string;
|
|
10
|
-
completedAt: string;
|
|
11
|
-
status: 'complete' | 'errored';
|
|
12
|
-
lifecycle: 'complete' | 'failed' | 'cancelled' | 'budget-stopped' | 'account-action' | null;
|
|
13
|
-
health: VerifyHistoryHealth;
|
|
14
|
-
regressionCount: number | null;
|
|
15
|
-
executedCaseCount: number | null;
|
|
16
|
-
degradationCodes: string[];
|
|
17
|
-
supersededBy: string | null;
|
|
18
|
-
}
|
|
19
|
-
export interface VerifyHistoryReport {
|
|
20
|
-
version: 'dv-verify-history-v1';
|
|
21
|
-
provider: 'haystack';
|
|
22
|
-
scope: 'user';
|
|
23
|
-
repository: {
|
|
24
|
-
owner: string;
|
|
25
|
-
name: string;
|
|
26
|
-
repositoryId: string;
|
|
27
|
-
};
|
|
28
|
-
limit: number;
|
|
29
|
-
hasMore: boolean;
|
|
30
|
-
runs: VerifyHistoryRun[];
|
|
31
|
-
summary: {
|
|
32
|
-
total: number;
|
|
33
|
-
counts: Record<VerifyHistoryHealth, number>;
|
|
34
|
-
/** Healthy/degraded runs with executedCaseCount > 0, divided by total;
|
|
35
|
-
* null for an empty window. */
|
|
36
|
-
usableRate: number | null;
|
|
37
|
-
};
|
|
38
|
-
}
|