@made-by-moonlight/athene-plugin-agent-cursor 0.9.1

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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Composio, Inc.
4
+ Copyright (c) 2026 slievr (Athene fork)
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
@@ -0,0 +1,23 @@
1
+ import { type Agent } from "@made-by-moonlight/athene-core";
2
+ export declare const manifest: {
3
+ name: string;
4
+ slot: "agent";
5
+ description: string;
6
+ version: string;
7
+ displayName: string;
8
+ };
9
+ export declare function create(): Agent;
10
+ export declare function detect(): boolean;
11
+ declare const _default: {
12
+ manifest: {
13
+ name: string;
14
+ slot: "agent";
15
+ description: string;
16
+ version: string;
17
+ displayName: string;
18
+ };
19
+ create: typeof create;
20
+ detect: typeof detect;
21
+ };
22
+ export default _default;
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAWL,KAAK,KAAK,EAUX,MAAM,gCAAgC,CAAC;AAwGxC,eAAO,MAAM,QAAQ;;;;;;CAMpB,CAAC;AAoQF,wBAAgB,MAAM,IAAI,KAAK,CAE9B;AAED,wBAAgB,MAAM,IAAI,OAAO,CAqBhC;;;;;;;;;;;;AAED,wBAA0E"}
package/dist/index.js ADDED
@@ -0,0 +1,364 @@
1
+ import { shellEscape, isWindows, normalizeAgentPermissionMode, readLastActivityEntry, checkActivityLogState, getActivityFallbackState, recordTerminalActivity, hasRecentCommits, DEFAULT_READY_THRESHOLD_MS, DEFAULT_ACTIVE_WINDOW_MS, } from "@made-by-moonlight/athene-core";
2
+ import { execFile, execFileSync } from "node:child_process";
3
+ import { promisify } from "node:util";
4
+ import { stat, access, readFile, lstat } from "node:fs/promises";
5
+ import { lstatSync, constants } from "node:fs";
6
+ import { join, resolve } from "node:path";
7
+ const execFileAsync = promisify(execFile);
8
+ // =============================================================================
9
+ // Cursor Activity Detection Helpers
10
+ // =============================================================================
11
+ /**
12
+ * Get modification time of Cursor session file if it exists.
13
+ * Cursor may create a .cursor directory with session data.
14
+ *
15
+ * Checks .cursor/chat.md file mtime (which tracks actual Cursor writes),
16
+ * falling back to directory mtime only if the file doesn't exist.
17
+ */
18
+ async function getCursorSessionMtime(workspacePath) {
19
+ try {
20
+ const cursorDir = join(workspacePath, ".cursor");
21
+ const chatFile = join(cursorDir, "chat.md");
22
+ // Security check: reject symlinks to prevent path traversal
23
+ const dirStats = await lstat(cursorDir);
24
+ if (dirStats.isSymbolicLink()) {
25
+ return null;
26
+ }
27
+ // First try to stat the chat file (preferred - tracks actual writes)
28
+ try {
29
+ const fileStats = await lstat(chatFile);
30
+ if (fileStats.isSymbolicLink()) {
31
+ return null; // Reject symlinked chat file
32
+ }
33
+ const stats = await stat(chatFile);
34
+ return stats.mtime;
35
+ }
36
+ catch {
37
+ // Fall back to directory mtime if chat file doesn't exist
38
+ await access(cursorDir, constants.R_OK);
39
+ const stats = await stat(cursorDir);
40
+ return stats.mtime;
41
+ }
42
+ }
43
+ catch {
44
+ return null;
45
+ }
46
+ }
47
+ // =============================================================================
48
+ // Session Info Helpers
49
+ // =============================================================================
50
+ /**
51
+ * Extract a summary from Cursor's session data if available.
52
+ * This is a best-effort approach as Cursor's internal format may vary.
53
+ */
54
+ async function extractCursorSummary(workspacePath) {
55
+ try {
56
+ // Try to read from .cursor directory if it exists
57
+ const cursorDir = join(workspacePath, ".cursor");
58
+ const chatFile = join(cursorDir, "chat.md");
59
+ try {
60
+ // Security check: reject symlinks to prevent path traversal
61
+ const dirStats = await lstat(cursorDir);
62
+ if (dirStats.isSymbolicLink()) {
63
+ return null; // Reject symlinked .cursor directory
64
+ }
65
+ const lstats = await lstat(chatFile);
66
+ if (lstats.isSymbolicLink()) {
67
+ return null; // Reject symlinked chat file
68
+ }
69
+ // Verify the resolved path stays under workspacePath
70
+ const realPath = resolve(chatFile);
71
+ const realWorkspace = resolve(workspacePath);
72
+ if (!realPath.startsWith(realWorkspace)) {
73
+ return null; // Reject paths outside workspace
74
+ }
75
+ const content = await readFile(chatFile, "utf-8");
76
+ // Extract first meaningful line
77
+ for (const line of content.split("\n")) {
78
+ const trimmed = line.trim();
79
+ if (trimmed.length > 0 && !trimmed.startsWith("#")) {
80
+ return trimmed.length > 120 ? trimmed.substring(0, 120) + "..." : trimmed;
81
+ }
82
+ }
83
+ }
84
+ catch {
85
+ // Chat file doesn't exist, continue
86
+ }
87
+ }
88
+ catch {
89
+ // .cursor directory doesn't exist
90
+ }
91
+ return null;
92
+ }
93
+ // =============================================================================
94
+ // Plugin Manifest
95
+ // =============================================================================
96
+ export const manifest = {
97
+ name: "cursor",
98
+ slot: "agent",
99
+ description: "Agent plugin: Cursor Agent CLI",
100
+ version: "0.1.0",
101
+ displayName: "Cursor",
102
+ };
103
+ // =============================================================================
104
+ // Agent Implementation
105
+ // =============================================================================
106
+ function createCursorAgent() {
107
+ return {
108
+ name: "cursor",
109
+ processName: "agent",
110
+ getLaunchCommand(config) {
111
+ const parts = ["agent"];
112
+ const permissionMode = normalizeAgentPermissionMode(config.permissions);
113
+ if (permissionMode === "permissionless" || permissionMode === "auto-edit") {
114
+ // Cursor uses --force (or --yolo alias) for automatic approval
115
+ // --sandbox disabled: Skip workspace trust prompts entirely
116
+ // --approve-mcps: Auto-approve MCP servers
117
+ // Note: --trust only works in headless mode (with --print), so we use --sandbox disabled instead
118
+ parts.push("--force", "--sandbox", "disabled", "--approve-mcps");
119
+ }
120
+ if (config.model) {
121
+ parts.push("--model", shellEscape(config.model));
122
+ }
123
+ // Build the prompt argument
124
+ // Cursor agent doesn't have a dedicated --system flag, so we prepend
125
+ // system prompt content to the main prompt positional argument
126
+ // Use -- separator to prevent prompts starting with - from being parsed as flags
127
+ // Use shell command substitution for systemPromptFile to avoid tmux truncation
128
+ // when inlining 2000+ char prompts (same pattern as OpenCode)
129
+ if (config.systemPromptFile) {
130
+ try {
131
+ // Security check: reject symlinks to prevent path traversal attacks
132
+ const lstats = lstatSync(config.systemPromptFile);
133
+ if (lstats.isSymbolicLink()) {
134
+ // Skip symlinked system prompt files, fall through to inline handling
135
+ }
136
+ else {
137
+ // Build command with shell substitution using printf %s for safe prompt embedding.
138
+ // shellEscape wraps prompt in single quotes (prevents shell expansion),
139
+ // printf %s outputs it literally. Matches OpenCode pattern exactly.
140
+ if (config.prompt) {
141
+ parts.push("--", `"$(cat ${shellEscape(config.systemPromptFile)}; printf '\\n\\n'; printf %s ${shellEscape(config.prompt)})"`);
142
+ }
143
+ else {
144
+ parts.push("--", `"$(cat ${shellEscape(config.systemPromptFile)})"`);
145
+ }
146
+ return parts.join(" ");
147
+ }
148
+ }
149
+ catch {
150
+ // File doesn't exist or can't be read - fall through to inline handling
151
+ }
152
+ }
153
+ // Inline handling for systemPrompt or prompt without systemPromptFile
154
+ let promptText = "";
155
+ if (config.systemPrompt) {
156
+ promptText = config.systemPrompt.trim();
157
+ }
158
+ if (config.prompt) {
159
+ promptText = promptText ? promptText + "\n\n" + config.prompt : config.prompt;
160
+ }
161
+ if (promptText) {
162
+ parts.push("--", shellEscape(promptText));
163
+ }
164
+ return parts.join(" ");
165
+ },
166
+ getEnvironment(config) {
167
+ const env = {};
168
+ env["AO_SESSION_ID"] = config.sessionId;
169
+ // NOTE: AO_PROJECT_ID is the caller's responsibility (spawn.ts sets it)
170
+ if (config.issueId) {
171
+ env["AO_ISSUE_ID"] = config.issueId;
172
+ }
173
+ // PATH and GH_PATH are injected by session-manager for all agents.
174
+ return env;
175
+ },
176
+ detectActivity(terminalOutput) {
177
+ if (!terminalOutput.trim())
178
+ return "idle";
179
+ const lines = terminalOutput.trim().split("\n");
180
+ const lastLine = lines[lines.length - 1]?.trim() ?? "";
181
+ // Check for permission/confirmation prompts FIRST (actionable states take priority)
182
+ // This must come before idle prompt detection to avoid false negatives when
183
+ // a permission prompt is followed by an input cursor on the next line
184
+ const tail = lines.slice(-5).join("\n");
185
+ if (/\(Y\)es.*\(N\)o/i.test(tail))
186
+ return "waiting_input";
187
+ if (/Approve.*changes\?/i.test(tail))
188
+ return "waiting_input";
189
+ if (/Continue\?/i.test(tail))
190
+ return "waiting_input";
191
+ if (/\[Yes\].*\[No\]/i.test(tail))
192
+ return "waiting_input";
193
+ if (/proceed\?/i.test(tail))
194
+ return "waiting_input";
195
+ if (/Press Enter to continue/i.test(tail))
196
+ return "waiting_input";
197
+ // Cursor agent's input prompt — agent is idle, waiting for user command
198
+ if (/^[>$#]\s*$/.test(lastLine))
199
+ return "idle";
200
+ // Cursor agent-specific prompt patterns
201
+ if (/^agent>\s*$/.test(lastLine))
202
+ return "idle";
203
+ if (/^\[agent\]\s*$/.test(lastLine))
204
+ return "idle";
205
+ // Note: "blocked" detection removed — compiler errors, test failures, and linter
206
+ // messages are extremely common in normal tool output. Unlike Claude Code (which
207
+ // has native JSONL with rich "error" types), terminal-based detection can't
208
+ // distinguish between actionable agent errors and normal tool output.
209
+ // If Cursor CLI provides native JSONL in the future, blocked detection can be
210
+ // added to getActivityState() based on JSONL entry types.
211
+ return "active";
212
+ },
213
+ async getActivityState(session, readyThresholdMs) {
214
+ const threshold = readyThresholdMs ?? DEFAULT_READY_THRESHOLD_MS;
215
+ // Check if process is running first
216
+ const exitedAt = new Date();
217
+ if (!session.runtimeHandle)
218
+ return { state: "exited", timestamp: exitedAt };
219
+ const running = await this.isProcessRunning(session.runtimeHandle);
220
+ if (!running)
221
+ return { state: "exited", timestamp: exitedAt };
222
+ // Process is running - check for activity signals
223
+ if (!session.workspacePath)
224
+ return null;
225
+ // 1. Check AO activity JSONL first (written by recordActivity from terminal output).
226
+ // This is the only source of waiting_input/blocked states for Cursor.
227
+ const activityResult = await readLastActivityEntry(session.workspacePath);
228
+ const activityState = checkActivityLogState(activityResult);
229
+ if (activityState)
230
+ return activityState;
231
+ // 2. Fallback: check for recent git commits (Cursor may auto-commit changes)
232
+ // Note: This can produce false "active" states if other processes make commits,
233
+ // but it's better than missing real activity. Same pattern used in Aider plugin.
234
+ const hasCommits = await hasRecentCommits(session.workspacePath);
235
+ if (hasCommits)
236
+ return { state: "active" };
237
+ // 3. Fallback: check Cursor session directory modification time
238
+ const sessionMtime = await getCursorSessionMtime(session.workspacePath);
239
+ if (sessionMtime) {
240
+ const ageMs = Date.now() - sessionMtime.getTime();
241
+ const activeWindowMs = Math.min(DEFAULT_ACTIVE_WINDOW_MS, threshold);
242
+ if (ageMs <= activeWindowMs)
243
+ return { state: "active", timestamp: sessionMtime };
244
+ if (ageMs <= threshold)
245
+ return { state: "ready", timestamp: sessionMtime };
246
+ return { state: "idle", timestamp: sessionMtime };
247
+ }
248
+ // 4. Fallback: use JSONL entry with age-based decay when session data is unavailable.
249
+ const activeWindowMs = Math.min(DEFAULT_ACTIVE_WINDOW_MS, threshold);
250
+ const fallback = getActivityFallbackState(activityResult, activeWindowMs, threshold);
251
+ if (fallback)
252
+ return fallback;
253
+ return null;
254
+ },
255
+ async recordActivity(session, terminalOutput) {
256
+ if (!session.workspacePath)
257
+ return;
258
+ await recordTerminalActivity(session.workspacePath, terminalOutput, (output) => this.detectActivity(output));
259
+ },
260
+ async isProcessRunning(handle) {
261
+ try {
262
+ if (handle.runtimeName === "tmux" && handle.id) {
263
+ const { stdout: ttyOut } = await execFileAsync("tmux", ["list-panes", "-t", handle.id, "-F", "#{pane_tty}"], { timeout: 30_000 });
264
+ const ttys = ttyOut
265
+ .trim()
266
+ .split("\n")
267
+ .map((t) => t.trim())
268
+ .filter(Boolean);
269
+ if (ttys.length === 0)
270
+ return false;
271
+ const { stdout: psOut } = await execFileAsync("ps", ["-eo", "pid,tty,args"], {
272
+ timeout: 30_000,
273
+ });
274
+ const ttySet = new Set(ttys.map((t) => t.replace(/^\/dev\//, "")));
275
+ // Match "agent" or ".agent" binary (Cursor's CLI is called "agent")
276
+ // Use word boundary to avoid matching "agent-orchestrator" etc.
277
+ // Include optional dot prefix to match installations with dot-prefixed names
278
+ const processRe = /(?:^|\/)\.?agent\b(?:\s|$)/;
279
+ for (const line of psOut.split("\n")) {
280
+ const cols = line.trimStart().split(/\s+/);
281
+ if (cols.length < 3 || !ttySet.has(cols[1] ?? ""))
282
+ continue;
283
+ const args = cols.slice(2).join(" ");
284
+ if (processRe.test(args)) {
285
+ return true;
286
+ }
287
+ }
288
+ return false;
289
+ }
290
+ const rawPid = handle.data["pid"];
291
+ const pid = typeof rawPid === "number" ? rawPid : Number(rawPid);
292
+ if (Number.isFinite(pid) && pid > 0) {
293
+ try {
294
+ process.kill(pid, 0);
295
+ return true;
296
+ }
297
+ catch (err) {
298
+ if (err instanceof Error && "code" in err && err.code === "EPERM") {
299
+ return true;
300
+ }
301
+ return false;
302
+ }
303
+ }
304
+ return false;
305
+ }
306
+ catch {
307
+ return false;
308
+ }
309
+ },
310
+ async getSessionInfo(session) {
311
+ if (!session.workspacePath)
312
+ return null;
313
+ const summary = await extractCursorSummary(session.workspacePath);
314
+ if (!summary)
315
+ return null;
316
+ return {
317
+ summary,
318
+ summaryIsFallback: true,
319
+ agentSessionId: null,
320
+ // Cursor doesn't expose token/cost data via CLI
321
+ };
322
+ },
323
+ // Cursor doesn't support session resume — return null so caller falls back to getLaunchCommand
324
+ async getRestoreCommand(_session, _project) {
325
+ return null;
326
+ },
327
+ async setupWorkspaceHooks(_workspacePath, _config) {
328
+ // PATH wrappers are installed by session-manager for all agents.
329
+ },
330
+ async postLaunchSetup(_session) {
331
+ // PATH wrappers are re-ensured by session-manager.
332
+ },
333
+ };
334
+ }
335
+ // =============================================================================
336
+ // Plugin Export
337
+ // =============================================================================
338
+ export function create() {
339
+ return createCursorAgent();
340
+ }
341
+ export function detect() {
342
+ try {
343
+ // Check for Cursor-specific markers in help output to avoid false positives
344
+ // with other binaries named "agent" (SSH agents, monitoring agents, etc.)
345
+ // Note: --version only outputs a date/hash (e.g., "2026.04.08-a41fba1") with no
346
+ // "cursor" marker, so we check --help output instead.
347
+ const helpOutput = execFileSync("agent", ["--help"], {
348
+ encoding: "utf-8",
349
+ stdio: ["ignore", "pipe", "ignore"],
350
+ shell: isWindows(),
351
+ windowsHide: true,
352
+ timeout: 5_000,
353
+ });
354
+ // Use multiple indicators for robustness - if Cursor changes one, others still work
355
+ const hasCursorAgent = helpOutput.includes("Cursor Agent");
356
+ const hasCursorFlags = helpOutput.includes("--approve-mcps") && helpOutput.includes("--sandbox");
357
+ return hasCursorAgent || hasCursorFlags;
358
+ }
359
+ catch {
360
+ return false;
361
+ }
362
+ }
363
+ export default { manifest, create, detect };
364
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,SAAS,EACT,4BAA4B,EAC5B,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,EAChB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AAC,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC5E,OAAO,cAAc,IAAI,cAAc,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,eAAe,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAgC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,47 @@
1
+ {
2
+ "name": "@made-by-moonlight/athene-plugin-agent-cursor",
3
+ "version": "0.9.1",
4
+ "description": "Agent plugin: Cursor CLI",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "dist/index.js",
8
+ "types": "dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "repository": {
19
+ "type": "git",
20
+ "url": "https://github.com/slievr/Athene.git",
21
+ "directory": "packages/plugins/agent-cursor"
22
+ },
23
+ "homepage": "https://github.com/slievr/Athene",
24
+ "bugs": {
25
+ "url": "https://github.com/slievr/Athene/issues"
26
+ },
27
+ "engines": {
28
+ "node": ">=20.0.0"
29
+ },
30
+ "dependencies": {
31
+ "@made-by-moonlight/athene-core": "0.9.1"
32
+ },
33
+ "devDependencies": {
34
+ "@types/node": "^25.2.3",
35
+ "typescript": "^5.7.0",
36
+ "vitest": "^3.0.0"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ },
41
+ "scripts": {
42
+ "build": "tsc",
43
+ "typecheck": "tsc --noEmit",
44
+ "test": "vitest run",
45
+ "clean": "rm -rf dist"
46
+ }
47
+ }