@gethmy/agent 1.7.1 → 1.7.3
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/dist/cli.js +6386 -141
- package/dist/index.js +6216 -333
- package/package.json +2 -2
- package/dist/board-helpers.d.ts +0 -31
- package/dist/board-helpers.js +0 -150
- package/dist/budget.d.ts +0 -39
- package/dist/budget.js +0 -73
- package/dist/cli.d.ts +0 -14
- package/dist/completion.d.ts +0 -36
- package/dist/completion.js +0 -322
- package/dist/config-validation.d.ts +0 -23
- package/dist/config-validation.js +0 -77
- package/dist/config.d.ts +0 -23
- package/dist/config.js +0 -103
- package/dist/episode-writer.d.ts +0 -116
- package/dist/episode-writer.js +0 -349
- package/dist/git-diff-stat.d.ts +0 -24
- package/dist/git-diff-stat.js +0 -56
- package/dist/git-pr.d.ts +0 -38
- package/dist/git-pr.js +0 -399
- package/dist/http-server.d.ts +0 -66
- package/dist/http-server.js +0 -96
- package/dist/index.d.ts +0 -5
- package/dist/log.d.ts +0 -34
- package/dist/log.js +0 -100
- package/dist/merge-monitor.d.ts +0 -23
- package/dist/merge-monitor.js +0 -169
- package/dist/pm.d.ts +0 -14
- package/dist/pm.js +0 -63
- package/dist/pool.d.ts +0 -71
- package/dist/pool.js +0 -259
- package/dist/process-group.d.ts +0 -26
- package/dist/process-group.js +0 -72
- package/dist/progress-tracker.d.ts +0 -82
- package/dist/progress-tracker.js +0 -457
- package/dist/prompt.d.ts +0 -23
- package/dist/prompt.js +0 -160
- package/dist/queue.d.ts +0 -39
- package/dist/queue.js +0 -100
- package/dist/reconcile.d.ts +0 -35
- package/dist/reconcile.js +0 -174
- package/dist/recovery.d.ts +0 -30
- package/dist/recovery.js +0 -141
- package/dist/review-completion.d.ts +0 -35
- package/dist/review-completion.js +0 -475
- package/dist/review-knowledge.d.ts +0 -14
- package/dist/review-knowledge.js +0 -89
- package/dist/review-prompt.d.ts +0 -12
- package/dist/review-prompt.js +0 -103
- package/dist/review-worker.d.ts +0 -56
- package/dist/review-worker.js +0 -638
- package/dist/review-worktree.d.ts +0 -12
- package/dist/review-worktree.js +0 -95
- package/dist/run-log.d.ts +0 -6
- package/dist/run-log.js +0 -19
- package/dist/startup-banner.d.ts +0 -29
- package/dist/startup-banner.js +0 -143
- package/dist/state-store.d.ts +0 -89
- package/dist/state-store.js +0 -230
- package/dist/stream-parser-selftest.d.ts +0 -9
- package/dist/stream-parser-selftest.js +0 -97
- package/dist/stream-parser.d.ts +0 -43
- package/dist/stream-parser.js +0 -174
- package/dist/transitions.d.ts +0 -57
- package/dist/transitions.js +0 -131
- package/dist/types.d.ts +0 -167
- package/dist/types.js +0 -76
- package/dist/verification.d.ts +0 -39
- package/dist/verification.js +0 -317
- package/dist/watcher.d.ts +0 -53
- package/dist/watcher.js +0 -153
- package/dist/worker.d.ts +0 -54
- package/dist/worker.js +0 -507
- package/dist/worktree-gc.d.ts +0 -67
- package/dist/worktree-gc.js +0 -245
- package/dist/worktree.d.ts +0 -18
- package/dist/worktree.js +0 -177
package/dist/review-prompt.js
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import { QA_VISUAL_CHECKLIST, REVIEW_SYSTEM_PROMPT, } from "./review-knowledge.js";
|
|
2
|
-
/**
|
|
3
|
-
* Build the static system prompt for the review agent.
|
|
4
|
-
* Contains review methodology, checklist, and QA guidance.
|
|
5
|
-
* Passed via --append-system-prompt to Claude CLI.
|
|
6
|
-
*/
|
|
7
|
-
export function buildReviewSystemPrompt() {
|
|
8
|
-
return `You are a code review agent. You review changes made by an implementation agent.
|
|
9
|
-
You are thorough, specific, and cite file:line locations for every finding.
|
|
10
|
-
|
|
11
|
-
${REVIEW_SYSTEM_PROMPT}
|
|
12
|
-
|
|
13
|
-
${QA_VISUAL_CHECKLIST}`;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Build the card-specific user prompt for the review agent.
|
|
17
|
-
* Contains the diff, requirements, and structured review steps.
|
|
18
|
-
*/
|
|
19
|
-
export function buildReviewUserPrompt(enriched, branchName, worktreePath, previewUrl, diff, baseBranch) {
|
|
20
|
-
const { card, labels, subtasks } = enriched;
|
|
21
|
-
const labelStr = labels.length > 0 ? labels.map((l) => l.name).join(", ") : "none";
|
|
22
|
-
const subtaskStr = subtasks.length > 0
|
|
23
|
-
? subtasks
|
|
24
|
-
.map((s) => `- [${s.completed ? "x" : " "}] ${s.title}`)
|
|
25
|
-
.join("\n")
|
|
26
|
-
: "No subtasks defined.";
|
|
27
|
-
const description = card.description?.trim() || "No description provided.";
|
|
28
|
-
const truncatedDiff = diff.length > 80_000
|
|
29
|
-
? `${diff.slice(0, 80_000)}\n\n... (diff truncated at 80K characters)`
|
|
30
|
-
: diff;
|
|
31
|
-
const branchLine = branchName
|
|
32
|
-
? `**Branch**: ${branchName}`
|
|
33
|
-
: `**Mode**: Local review (no branch — reviewing working tree changes)`;
|
|
34
|
-
return `## Card: #${card.short_id} - ${card.title}
|
|
35
|
-
**Labels**: ${labelStr}
|
|
36
|
-
${branchLine}
|
|
37
|
-
|
|
38
|
-
## Original Requirements
|
|
39
|
-
${description}
|
|
40
|
-
|
|
41
|
-
## Subtasks (Acceptance Criteria)
|
|
42
|
-
${subtaskStr}
|
|
43
|
-
|
|
44
|
-
## Diff ${branchName ? `(origin/${baseBranch}..HEAD)` : "(local changes)"}
|
|
45
|
-
\`\`\`diff
|
|
46
|
-
${truncatedDiff}
|
|
47
|
-
\`\`\`
|
|
48
|
-
|
|
49
|
-
## Review Steps
|
|
50
|
-
|
|
51
|
-
Follow these steps in order:
|
|
52
|
-
|
|
53
|
-
### Step 1: Scope Check
|
|
54
|
-
Compare the diff against the card description and subtasks above.
|
|
55
|
-
- Are all requirements from the description addressed?
|
|
56
|
-
- Are all subtasks implemented?
|
|
57
|
-
- Is there scope creep — changes unrelated to the card requirements?
|
|
58
|
-
Flag any missing requirements or scope drift.
|
|
59
|
-
|
|
60
|
-
### Step 2: Code Review (Two-Pass)
|
|
61
|
-
Apply the two-pass review from your system instructions:
|
|
62
|
-
- **Pass 1 (CRITICAL)**: SQL safety, race conditions, LLM trust boundary, enum completeness.
|
|
63
|
-
- **Pass 2 (INFORMATIONAL)**: Conditional side effects, dead code, test gaps, completeness gaps, view issues.
|
|
64
|
-
|
|
65
|
-
For enum completeness checks, use Grep and Read to trace new values through consumers OUTSIDE the diff.
|
|
66
|
-
|
|
67
|
-
### Step 3: Visual QA
|
|
68
|
-
Use the \`/browse\` skill to navigate to ${previewUrl} and apply the visual QA checklist:
|
|
69
|
-
- Verify the UI changes match the requirements
|
|
70
|
-
- Check interactive elements, forms, navigation
|
|
71
|
-
- Check console for JS errors and failed network requests
|
|
72
|
-
- Test on mobile viewport if the change is visual
|
|
73
|
-
|
|
74
|
-
### Step 4: Output
|
|
75
|
-
After completing all steps, output EXACTLY one JSON block (and nothing else after it):
|
|
76
|
-
|
|
77
|
-
\`\`\`json
|
|
78
|
-
{
|
|
79
|
-
"verdict": "approved" | "rejected",
|
|
80
|
-
"summary": "Brief overall assessment",
|
|
81
|
-
"scopeCheck": {
|
|
82
|
-
"status": "clean" | "drift" | "missing",
|
|
83
|
-
"notes": "Optional explanation of scope issues"
|
|
84
|
-
},
|
|
85
|
-
"findings": [
|
|
86
|
-
{
|
|
87
|
-
"severity": "critical" | "major" | "minor",
|
|
88
|
-
"category": "sql-safety | race-condition | llm-trust | enum-completeness | visual | functional | ux | console | scope | other",
|
|
89
|
-
"title": "Short title",
|
|
90
|
-
"description": "Detailed description of the issue",
|
|
91
|
-
"location": "file:line (if applicable)"
|
|
92
|
-
}
|
|
93
|
-
]
|
|
94
|
-
}
|
|
95
|
-
\`\`\`
|
|
96
|
-
|
|
97
|
-
**Decision rules:**
|
|
98
|
-
- **rejected**: Any \`critical\` finding, unaddressed requirements, or 2+ \`major\` findings.
|
|
99
|
-
- **approved**: No critical findings, at most 1 major finding with minor findings OK.
|
|
100
|
-
|
|
101
|
-
**Do NOT modify any code.** This is a read-only review.
|
|
102
|
-
${branchName ? `You are reviewing code in a git worktree at \`${worktreePath}\` on branch \`${branchName}\`.` : `You are reviewing local changes in the repository at \`${worktreePath}\`.`}`;
|
|
103
|
-
}
|
package/dist/review-worker.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import type { HarmonyApiClient } from "@gethmy/mcp/src/api-client.js";
|
|
2
|
-
import type { Card, Column, Label, Subtask } from "@harmony/shared";
|
|
3
|
-
import { type StateStore } from "./state-store.js";
|
|
4
|
-
import { type AgentConfig, type WorkerState } from "./types.js";
|
|
5
|
-
export declare class ReviewWorker {
|
|
6
|
-
private config;
|
|
7
|
-
private client;
|
|
8
|
-
private onDone;
|
|
9
|
-
private stateStore;
|
|
10
|
-
private workspaceId?;
|
|
11
|
-
id: number;
|
|
12
|
-
state: WorkerState;
|
|
13
|
-
cardId: string | null;
|
|
14
|
-
branchName: string | null;
|
|
15
|
-
worktreePath: string | null;
|
|
16
|
-
startedAt: number | null;
|
|
17
|
-
private process;
|
|
18
|
-
private devServerProcess;
|
|
19
|
-
private timeoutTimer;
|
|
20
|
-
private heartbeatTimer;
|
|
21
|
-
private progressTracker;
|
|
22
|
-
private lastSessionStats;
|
|
23
|
-
private aborted;
|
|
24
|
-
private runId;
|
|
25
|
-
private lastRunLogPath;
|
|
26
|
-
private sessionId;
|
|
27
|
-
constructor(id: number, config: AgentConfig, client: HarmonyApiClient, _userEmail: string, onDone: (worker: ReviewWorker) => void, stateStore: StateStore, workspaceId?: string | undefined, _projectId?: string);
|
|
28
|
-
private startHeartbeat;
|
|
29
|
-
private stopHeartbeat;
|
|
30
|
-
private recordPhase;
|
|
31
|
-
get tag(): string;
|
|
32
|
-
get isIdle(): boolean;
|
|
33
|
-
private get reviewPort();
|
|
34
|
-
get isActive(): boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Start reviewing a card. Runs the full lifecycle:
|
|
37
|
-
* PREPARING → REVIEWING → COMPLETING → IDLE
|
|
38
|
-
*/
|
|
39
|
-
run(card: Card, column: Column, labels: Label[], subtasks: Subtask[]): Promise<void>;
|
|
40
|
-
/**
|
|
41
|
-
* Pause the current review by suspending the Claude process (SIGSTOP).
|
|
42
|
-
*/
|
|
43
|
-
pause(): Promise<void>;
|
|
44
|
-
/**
|
|
45
|
-
* Resume the Claude process after a pause (SIGCONT).
|
|
46
|
-
*/
|
|
47
|
-
resume(): Promise<void>;
|
|
48
|
-
/**
|
|
49
|
-
* Cancel the current review. Sends escalating signals to both processes.
|
|
50
|
-
*/
|
|
51
|
-
cancel(): Promise<void>;
|
|
52
|
-
private spawnClaude;
|
|
53
|
-
private killDevServer;
|
|
54
|
-
private resolveLocalChanges;
|
|
55
|
-
private cleanup;
|
|
56
|
-
}
|