@agilemonster/mcp-server 1.0.22 → 1.0.24
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 +33 -0
- package/dist/agent-engine.d.ts +132 -0
- package/dist/agent-engine.js +517 -0
- package/dist/client.d.ts +15 -2
- package/dist/client.js +23 -2
- package/dist/deploy-profile.d.ts +26 -1
- package/dist/deploy-profile.js +69 -1
- package/dist/deploy-runner.js +3 -1
- package/dist/server.d.ts +24 -2
- package/dist/server.js +679 -286
- package/dist/types.d.ts +19 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -91,6 +91,39 @@ Agents have access to these purpose-built lifecycle tools:
|
|
|
91
91
|
|
|
92
92
|
---
|
|
93
93
|
|
|
94
|
+
## 🧠 Who works a card that is queued from the board
|
|
95
|
+
|
|
96
|
+
A card you assign to an agent in the web app is picked up by the background runner on your machine. The
|
|
97
|
+
runner hands it to a **real coding agent running headless in the project folder** — the same agent you use
|
|
98
|
+
in the IDE, with the same ability to search the code, open what it finds, run the build and fix what it broke:
|
|
99
|
+
|
|
100
|
+
| Card's agent | Command line agent used | One-time setup |
|
|
101
|
+
| :--- | :--- | :--- |
|
|
102
|
+
| Cursor | `cursor-agent -p --force` | `curl https://cursor.com/install -fsS \| bash`, then `cursor-agent login` |
|
|
103
|
+
| Claude Code | `claude -p --permission-mode acceptEdits` | `npm install -g @anthropic-ai/claude-code`, then `claude` once to sign in |
|
|
104
|
+
| Codex | `codex exec --sandbox workspace-write` | `npm install -g @openai/codex`, then `codex login` |
|
|
105
|
+
|
|
106
|
+
If the card's own agent has no CLI here, any other installed one is used and the card says which. The agent
|
|
107
|
+
gets the card, the requester's replies on it, and three rules: decide open details the way the codebase
|
|
108
|
+
already does instead of asking, check your own work, and do not commit — the runner commits and deploys
|
|
109
|
+
exactly the files the agent changed, after its own build check.
|
|
110
|
+
|
|
111
|
+
- **No CLI installed or signed in?** The card falls back to the built-in engine (the server-side model picks
|
|
112
|
+
a few files and writes one patch). It cannot explore or debug, so it is noticeably weaker; the card tells
|
|
113
|
+
you what to install or sign in to.
|
|
114
|
+
- **Only your own cards reach the agent.** It can run commands on your machine, so a card or comment written
|
|
115
|
+
by another board member is never passed to it. Those cards use the built-in engine.
|
|
116
|
+
- **Your uncommitted work is safe.** If the agent touches a file you had open changes in, everything it did
|
|
117
|
+
is put back and the card asks you to commit or stash first.
|
|
118
|
+
|
|
119
|
+
| Variable | Effect |
|
|
120
|
+
| :--- | :--- |
|
|
121
|
+
| `AGILEMONSTER_AGENT_ENGINE` | `claude`, `cursor` or `codex` to pin one; `builtin` to never start an agent CLI. |
|
|
122
|
+
| `AGILEMONSTER_AGENT_COMMAND` | Your own command instead. It runs in the project folder with the brief in `$AGILEMONSTER_PROMPT_FILE`; whatever it prints last is the report. |
|
|
123
|
+
| `AGILEMONSTER_AGENT_TIMEOUT_MINUTES` | How long one agent run may take (default 30). |
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
94
127
|
## 🚀 How deployment is decided (and remembered)
|
|
95
128
|
|
|
96
129
|
Cards started from the Agile Monster web app run in the background without your IDE's context, so the
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hands a card to a real coding agent running headless in the project folder — the same Cursor, Claude Code
|
|
3
|
+
* or Codex agent the developer uses interactively — instead of the built-in "pick six files, generate one
|
|
4
|
+
* search/replace patch" pipeline.
|
|
5
|
+
*
|
|
6
|
+
* The difference is the whole point: an agent with tools can search the repository for "Recently active
|
|
7
|
+
* projects", open the files it finds, run the type checker and fix what it broke. The built-in pipeline can
|
|
8
|
+
* do none of that, which is why it asked the requester where things live and gave up on a compile error.
|
|
9
|
+
*
|
|
10
|
+
* This module knows how to start each CLI, what the working tree looked like before, and what the agent
|
|
11
|
+
* changed. It never commits: the runner ships exactly the files reported here through its normal gates.
|
|
12
|
+
*/
|
|
13
|
+
export type EngineId = 'claude' | 'cursor' | 'codex' | 'custom';
|
|
14
|
+
export interface EngineRunOptions {
|
|
15
|
+
prompt: string;
|
|
16
|
+
projectPath: string;
|
|
17
|
+
model?: string | null;
|
|
18
|
+
/** Continue the agent's own session (it remembers what it did) instead of starting cold. */
|
|
19
|
+
resumeSessionId?: string | null;
|
|
20
|
+
timeoutMs?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface EngineRun {
|
|
23
|
+
ok: boolean;
|
|
24
|
+
/** The agent's final message. */
|
|
25
|
+
text: string;
|
|
26
|
+
sessionId?: string;
|
|
27
|
+
costUsd?: number;
|
|
28
|
+
timedOut: boolean;
|
|
29
|
+
durationMs: number;
|
|
30
|
+
/** Why the run produced nothing usable (for the log and the card). */
|
|
31
|
+
failure?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface ResolvedEngine {
|
|
34
|
+
id: EngineId;
|
|
35
|
+
label: string;
|
|
36
|
+
bin: string;
|
|
37
|
+
}
|
|
38
|
+
export declare function engineLabelFor(provider: string): string | null;
|
|
39
|
+
/**
|
|
40
|
+
* The agent CLIs this machine can run for a card, best first: the card's own agent, then any other one that
|
|
41
|
+
* is installed. `AGILEMONSTER_AGENT_ENGINE` pins the choice (`claude`, `cursor`, `codex`) or switches the
|
|
42
|
+
* whole thing off (`builtin`); `AGILEMONSTER_AGENT_COMMAND` replaces it with a command of the developer's own.
|
|
43
|
+
*
|
|
44
|
+
* `notes` say, in words for the card, why a better engine was passed over — an installed CLI that is not
|
|
45
|
+
* signed in is one command away from working, and the developer should hear that.
|
|
46
|
+
*/
|
|
47
|
+
export declare function resolveEngines(provider: string): Promise<{
|
|
48
|
+
engines: ResolvedEngine[];
|
|
49
|
+
notes: string[];
|
|
50
|
+
}>;
|
|
51
|
+
export declare function agentTimeoutMs(): number;
|
|
52
|
+
/** Run one agent to completion. Never throws: a CLI that is missing, logged out or crashed comes back as `ok: false`. */
|
|
53
|
+
export declare function runEngine(engine: ResolvedEngine, opts: EngineRunOptions): Promise<EngineRun>;
|
|
54
|
+
export interface ConversationTurn {
|
|
55
|
+
who: 'requester' | 'agent';
|
|
56
|
+
text: string;
|
|
57
|
+
}
|
|
58
|
+
export interface AgentBrief {
|
|
59
|
+
title: string;
|
|
60
|
+
description: string;
|
|
61
|
+
projectPath: string;
|
|
62
|
+
boardName?: string | null;
|
|
63
|
+
conversation: ConversationTurn[];
|
|
64
|
+
/** Files with the developer's own uncommitted work: off limits. */
|
|
65
|
+
developerFiles: string[];
|
|
66
|
+
/** Uncommitted files an earlier attempt at this card left behind: the agent's to continue. */
|
|
67
|
+
earlierFiles: string[];
|
|
68
|
+
earlierSummary?: string | null;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* What the agent is told. It reads like a request typed into the IDE — the card, the thread, and the few
|
|
72
|
+
* rules that differ from an interactive session (nobody is there to answer, and the runner does the shipping).
|
|
73
|
+
*/
|
|
74
|
+
export declare function buildAgentPrompt(brief: AgentBrief): string;
|
|
75
|
+
export interface AgentReport {
|
|
76
|
+
status: 'done' | 'blocked' | 'unknown';
|
|
77
|
+
summary: string;
|
|
78
|
+
verificationSteps: string[];
|
|
79
|
+
question: string;
|
|
80
|
+
}
|
|
81
|
+
/** Read the closing JSON object out of the agent's final message. Tolerates code fences and prose around it. */
|
|
82
|
+
export declare function parseAgentReport(text: string): AgentReport;
|
|
83
|
+
/** The agent's prose without the closing JSON object: what to show a human when the report is missing a field. */
|
|
84
|
+
export declare function proseOf(text: string, maxChars?: number): string;
|
|
85
|
+
export interface TreeSnapshot {
|
|
86
|
+
head: string;
|
|
87
|
+
/** Every path Git reported as changed or untracked, with a fingerprint of its content at that moment. */
|
|
88
|
+
entries: Map<string, string>;
|
|
89
|
+
/** Contents of those files, so a file the developer had open can be put back exactly (null = did not exist). */
|
|
90
|
+
saved: Map<string, Buffer | null>;
|
|
91
|
+
}
|
|
92
|
+
/** Paths from `git status --porcelain -z`. A rename reports both its new and its old path. */
|
|
93
|
+
export declare function parsePorcelainZ(out: string): string[];
|
|
94
|
+
/** Record the working tree before the agent starts. Null when the folder is not a Git repository. */
|
|
95
|
+
export declare function snapshotWorkingTree(projectPath: string): Promise<TreeSnapshot | null>;
|
|
96
|
+
export interface TreeChange {
|
|
97
|
+
/** Every file that differs from the snapshot. */
|
|
98
|
+
changed: string[];
|
|
99
|
+
/** Of those, the ones that already had uncommitted changes before the agent started. */
|
|
100
|
+
overlapping: string[];
|
|
101
|
+
/** Set when the agent committed and the commit is already on a remote: it can no longer be folded back. */
|
|
102
|
+
pushedCommit?: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Compare the working tree with the snapshot. If the agent committed despite its instructions, the commits
|
|
106
|
+
* are undone first (soft, so nothing is lost) — unless they were pushed, which only a human can sort out.
|
|
107
|
+
*/
|
|
108
|
+
export declare function changesSince(projectPath: string, snap: TreeSnapshot): Promise<TreeChange>;
|
|
109
|
+
/**
|
|
110
|
+
* Put the given files back the way the snapshot found them. Returns the files that could not be restored
|
|
111
|
+
* (only possible for a file the developer had changed that was too large to keep a copy of).
|
|
112
|
+
*/
|
|
113
|
+
export declare function restoreWorkingTree(projectPath: string, snap: TreeSnapshot, paths: string[]): Promise<string[]>;
|
|
114
|
+
/**
|
|
115
|
+
* `git diff` does not show files Git has never seen. Mark the agent's new files as "to be added" (no content
|
|
116
|
+
* is staged) so the reviewer's diff includes them.
|
|
117
|
+
*/
|
|
118
|
+
export declare function markNewFilesForDiff(projectPath: string, files: string[]): Promise<void>;
|
|
119
|
+
/**
|
|
120
|
+
* Snapshot the tree before this card's agent starts, and note that a run is in progress.
|
|
121
|
+
*
|
|
122
|
+
* `interrupted` is true when an earlier run of the same card never reached a conclusion (the machine slept,
|
|
123
|
+
* the daemon was killed). Whatever that run left in the tree cannot be told apart from the developer's own
|
|
124
|
+
* edits, so it is treated as theirs — never reverted, never committed — and the card can say where the
|
|
125
|
+
* leftovers probably came from.
|
|
126
|
+
*/
|
|
127
|
+
export declare function baselineFor(cardId: string, projectPath: string): Promise<{
|
|
128
|
+
snapshot: TreeSnapshot;
|
|
129
|
+
interrupted: boolean;
|
|
130
|
+
} | null>;
|
|
131
|
+
/** The card's run reached a conclusion (shipped, reverted, or handed to the human): it is no longer in progress. */
|
|
132
|
+
export declare function clearBaseline(cardId: string): void;
|