@zonease/happy 0.6.41 → 0.6.42
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/{api-XeHlmApX.cjs → api-CIE4_cWd.cjs} +4 -4
- package/dist/{api-K2-jr9ar.mjs → api-Ew6xr81i.mjs} +4 -4
- package/dist/{auth-CjLkoM3m.mjs → auth-BzYevJo2.mjs} +4 -4
- package/dist/{auth-BbvPcnkY.cjs → auth-Dor79zTL.cjs} +4 -4
- package/dist/{auth-BQvEuSs5.cjs → auth-G9fZpVJ2.cjs} +2 -2
- package/dist/{auth-DS8fzlin.mjs → auth-Q2STUNI-.mjs} +2 -2
- package/dist/{browser-C05Ak6RL.mjs → browser-BI7s-V8E.mjs} +1 -1
- package/dist/{browser-C05SP_Tt.cjs → browser-qDIIAL7S.cjs} +1 -1
- package/dist/{claudeLocal-DJNRlHIC.mjs → claudeLocal-Db2tDC4X.mjs} +1 -1
- package/dist/{claudeLocal-CpDhLCcZ.cjs → claudeLocal-f4uBLJaM.cjs} +1 -1
- package/dist/{config-DWWtjKQx.mjs → config-CHjDs8AS.mjs} +1 -1
- package/dist/{config-B0mns9fF.cjs → config-CSBlEik9.cjs} +1 -1
- package/dist/{connect-BxCScVNX.cjs → connect-CJoTliii.cjs} +5 -5
- package/dist/{connect-DXQC1CJe.mjs → connect-O_nA5BOC.mjs} +5 -5
- package/dist/{controlClient-DgELDZgM.cjs → controlClient-CEz_p1zc.cjs} +1 -1
- package/dist/{controlClient-DgjVRN8D.mjs → controlClient-DoS9JqQC.mjs} +1 -1
- package/dist/cursorApprovalHook-B0v1kGa7.mjs +95 -0
- package/dist/cursorApprovalHook-DRAHfTXU.cjs +97 -0
- package/dist/cursorApprovalServer-DzY8yJlI.cjs +167 -0
- package/dist/cursorApprovalServer-JjPkdjGR.mjs +164 -0
- package/dist/{deviceKeys-CejCdWpw.mjs → deviceKeys-B4aqjnE6.mjs} +2 -2
- package/dist/{deviceKeys-BpIAWz13.cjs → deviceKeys-DyUn0bEx.cjs} +2 -2
- package/dist/{doctor-DznasgP3.cjs → doctor-BJSuVRUZ.cjs} +2 -2
- package/dist/{doctor-B-LCMVN9.mjs → doctor-DRnft_5-.mjs} +2 -2
- package/dist/{downloadImage-ia5SzlCV.mjs → downloadImage-BpVF7A79.mjs} +7 -40
- package/dist/{downloadImage-B_ygLAXY.cjs → downloadImage-Cijmufpr.cjs} +5 -39
- package/dist/{enroll-BvfpRUGJ.cjs → enroll-C2gunHdt.cjs} +3 -3
- package/dist/{enroll-HjUqyGnD.mjs → enroll-CysDL6ee.mjs} +3 -3
- package/dist/{evidence-BEQd1dCh.mjs → evidence-DPutCuUr.mjs} +1 -1
- package/dist/{evidence-CVgTjBrq.cjs → evidence-DsQ-h-_W.cjs} +1 -1
- package/dist/{formatImageMessage-DVs57t3x.mjs → formatImageMessage-6aV9YFWr.mjs} +1 -1
- package/dist/{formatImageMessage-CmJTP_hU.cjs → formatImageMessage-BPK_Ivfe.cjs} +1 -1
- package/dist/gitWorktree-C6jLoaMw.cjs +39 -0
- package/dist/gitWorktree-CzJDU2BV.mjs +37 -0
- package/dist/{index-CDTNgfUf.cjs → index-BeKrqPYR.cjs} +25 -1
- package/dist/{index-CPKdvi7J.mjs → index-DTV7drqs.mjs} +25 -1
- package/dist/index.cjs +91 -41
- package/dist/index.mjs +91 -41
- package/dist/{install-UTz_vYvB.mjs → install-BsTA2tZn.mjs} +2 -2
- package/dist/{install-B3mMGISS.mjs → install-DBg0xQ3g.mjs} +1 -1
- package/dist/{install-2Yl_L582.cjs → install-DlOppA-e.cjs} +2 -2
- package/dist/{install-Ck22tYHP.cjs → install-Tyhs6rUp.cjs} +1 -1
- package/dist/lib.cjs +4 -4
- package/dist/lib.d.cts +3 -2
- package/dist/lib.d.mts +3 -2
- package/dist/lib.mjs +4 -4
- package/dist/{loadableToolOutput-4EvraaNY.mjs → loadableToolOutput-2dMPAp4N.mjs} +3 -456
- package/dist/{loadableToolOutput-BZYlaqHn.cjs → loadableToolOutput-DPGTtKJM.cjs} +2 -458
- package/dist/{persistence-DrfN7TzY.cjs → persistence-BcQmjobZ.cjs} +7 -4
- package/dist/{persistence-CIUFyOwz.mjs → persistence-D9tMm6bj.mjs} +7 -4
- package/dist/{push-CCOXCcM_.cjs → push-Cnm6JQMD.cjs} +6 -6
- package/dist/{push-USXj_pv0.mjs → push-Dxsugkes.mjs} +6 -6
- package/dist/{run-Dy6KX6m-.mjs → run-BEflQaQ2.mjs} +12 -9
- package/dist/{run-D3CopmEb.cjs → run-CiPWWhXt.cjs} +12 -9
- package/dist/{runClaude-aHzvx6Ha.cjs → runClaude-BVXsyCHb.cjs} +19 -18
- package/dist/{runClaude-CWux2RDq.mjs → runClaude-sPkSqHWY.mjs} +16 -15
- package/dist/{runCodex-G-Aq531U.cjs → runCodex-BAwhdmSA.cjs} +19 -17
- package/dist/{runCodex-D0ZxSj3O.mjs → runCodex-C4rHkIyw.mjs} +16 -14
- package/dist/runCursor-CD5wC3gA.cjs +578 -0
- package/dist/runCursor-DiHLWMs8.mjs +576 -0
- package/dist/{runGemini-DZC2i6vA.mjs → runGemini-B-93gOqB.mjs} +18 -16
- package/dist/{runGemini-DxGgDAIM.cjs → runGemini-Cto-adir.cjs} +21 -19
- package/dist/{runOneShot-BgT-JNMA.cjs → runOneShot-BfIzE9W4.cjs} +3 -3
- package/dist/{runOneShot-cxlk7VKA.mjs → runOneShot-DGjlYVhR.mjs} +3 -3
- package/dist/{serve-Dr3wPrtK.cjs → serve-CqL6NWDr.cjs} +7 -7
- package/dist/{serve-CKyvJNs0.mjs → serve-ttlqF5jn.mjs} +7 -7
- package/dist/{session-dYzbOo_W.cjs → session-BZhGpQUJ.cjs} +5 -5
- package/dist/{session-vf2ZjFto.mjs → session-Co0REU9e.mjs} +5 -5
- package/dist/{sessionKeyCache-dDquDzn0.cjs → sessionKeyCache-BwFUGgMs.cjs} +1 -1
- package/dist/{sessionKeyCache-D2u3JUys.mjs → sessionKeyCache-pXTjpETo.mjs} +1 -1
- package/dist/{sessionList-C1k2PNg_.mjs → sessionList-DaufR-sA.mjs} +2 -2
- package/dist/{sessionList-DmmtC7uR.cjs → sessionList-fG5uAPzU.cjs} +2 -2
- package/dist/{sessionSummary-DGLoVOxd.cjs → sessionSummary-CjZPt6nr.cjs} +3 -3
- package/dist/{sessionSummary-5a1QtFVS.mjs → sessionSummary-Dv6dPABg.mjs} +3 -3
- package/dist/setupOfflineReconnection-B6coH9QN.cjs +461 -0
- package/dist/setupOfflineReconnection-DW5il97B.mjs +457 -0
- package/dist/{spawnHappyCLI-CarRI4GM.cjs → spawnHappyCLI-Cfu7C1uM.cjs} +1 -1
- package/dist/{spawnHappyCLI-D3EkTFIn.mjs → spawnHappyCLI-DhUeycct.mjs} +1 -1
- package/dist/{ssh-B0hvEYIl.mjs → ssh-8tPIKk-i.mjs} +5 -5
- package/dist/{ssh-CBgVwKsB.cjs → ssh-C4YTSHXL.cjs} +5 -5
- package/dist/{task-CRo6W-3_.mjs → task-CH-oidFy.mjs} +6 -6
- package/dist/{task-CMunPKCV.cjs → task-DFW-PecP.cjs} +6 -6
- package/dist/{uninstall-BALE2up0.mjs → uninstall-CeioRZNI.mjs} +2 -2
- package/dist/{uninstall-BJ3eEGM4.cjs → uninstall-yTSL3X6Y.cjs} +2 -2
- package/dist/{update-Bb3iijy8.cjs → update-Bju28vNP.cjs} +3 -3
- package/dist/{update-BfjtLrhO.mjs → update-Derd2hoX.mjs} +3 -3
- package/package.json +1 -1
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
import { createServer } from 'node:http';
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { mkdir, rename, writeFile, readFile, rm, readdir, rmdir } from 'node:fs/promises';
|
|
4
|
+
import { existsSync } from 'node:fs';
|
|
5
|
+
import { join } from 'node:path';
|
|
6
|
+
import { l as logger } from './persistence-D9tMm6bj.mjs';
|
|
7
|
+
|
|
8
|
+
const APPROVAL_ENDPOINT_FILE = ".happy-approval.json";
|
|
9
|
+
const HOOKS_FILE = "hooks.json";
|
|
10
|
+
const HOOKS_BACKUP_FILE = "hooks.json.happy-backup";
|
|
11
|
+
const HOOK_TIMEOUT_SECONDS = 900;
|
|
12
|
+
class CursorApprovalBridge {
|
|
13
|
+
cwd;
|
|
14
|
+
handler;
|
|
15
|
+
token = randomUUID();
|
|
16
|
+
server = null;
|
|
17
|
+
port = 0;
|
|
18
|
+
hadExistingHooks = false;
|
|
19
|
+
/** True when .cursor/ did not exist before this session created it. */
|
|
20
|
+
createdCursorDir = false;
|
|
21
|
+
started = false;
|
|
22
|
+
constructor(options) {
|
|
23
|
+
this.cwd = options.cwd;
|
|
24
|
+
this.handler = options.handler;
|
|
25
|
+
}
|
|
26
|
+
get cursorDir() {
|
|
27
|
+
return join(this.cwd, ".cursor");
|
|
28
|
+
}
|
|
29
|
+
async start() {
|
|
30
|
+
await this.listen();
|
|
31
|
+
await this.installHooks();
|
|
32
|
+
this.started = true;
|
|
33
|
+
logger.debug(`[cursor] approval bridge listening on 127.0.0.1:${this.port}`);
|
|
34
|
+
}
|
|
35
|
+
listen() {
|
|
36
|
+
return new Promise((resolve, reject) => {
|
|
37
|
+
const server = createServer((req, res) => {
|
|
38
|
+
if (req.method !== "POST" || !req.url?.startsWith("/approve")) {
|
|
39
|
+
res.writeHead(404).end();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
let body = "";
|
|
43
|
+
req.on("data", (chunk) => {
|
|
44
|
+
body += chunk;
|
|
45
|
+
});
|
|
46
|
+
req.on("end", () => {
|
|
47
|
+
void this.decide(body).then((approved) => {
|
|
48
|
+
res.writeHead(200, { "content-type": "application/json" });
|
|
49
|
+
res.end(JSON.stringify({ approved }));
|
|
50
|
+
}).catch((error) => {
|
|
51
|
+
logger.debug(`[cursor] approval failed: ${error}`);
|
|
52
|
+
res.writeHead(200, { "content-type": "application/json" });
|
|
53
|
+
res.end(JSON.stringify({ approved: false }));
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
server.listen(0, "127.0.0.1", () => {
|
|
58
|
+
const address = server.address();
|
|
59
|
+
if (address === null || typeof address === "string") {
|
|
60
|
+
reject(new Error("Failed to determine approval server port"));
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
this.port = address.port;
|
|
64
|
+
this.server = server;
|
|
65
|
+
resolve();
|
|
66
|
+
});
|
|
67
|
+
server.on("error", reject);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
async decide(rawBody) {
|
|
71
|
+
let parsed;
|
|
72
|
+
try {
|
|
73
|
+
parsed = JSON.parse(rawBody);
|
|
74
|
+
} catch {
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
if (parsed.token !== this.token) {
|
|
78
|
+
logger.debug("[cursor] rejecting approval request with a bad token");
|
|
79
|
+
return false;
|
|
80
|
+
}
|
|
81
|
+
const toolName = typeof parsed.tool_name === "string" && parsed.tool_name.length > 0 ? parsed.tool_name : "unknown tool";
|
|
82
|
+
const toolCallId = typeof parsed.tool_use_id === "string" && parsed.tool_use_id.length > 0 ? parsed.tool_use_id : `cursor-${randomUUID()}`;
|
|
83
|
+
return this.handler.requestApproval(toolCallId, toolName, parsed.tool_input ?? {});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Writes .cursor/hooks.json pointing at this CLI. Any file already there is
|
|
87
|
+
* moved aside and restored on stop, so a project with its own hooks is not
|
|
88
|
+
* quietly clobbered.
|
|
89
|
+
*/
|
|
90
|
+
async installHooks() {
|
|
91
|
+
this.createdCursorDir = !existsSync(this.cursorDir);
|
|
92
|
+
await mkdir(this.cursorDir, { recursive: true });
|
|
93
|
+
const hooksPath = join(this.cursorDir, HOOKS_FILE);
|
|
94
|
+
if (existsSync(hooksPath)) {
|
|
95
|
+
await rename(hooksPath, join(this.cursorDir, HOOKS_BACKUP_FILE));
|
|
96
|
+
this.hadExistingHooks = true;
|
|
97
|
+
logger.debug("[cursor] existing hooks.json moved aside for the session");
|
|
98
|
+
}
|
|
99
|
+
await writeFile(join(this.cursorDir, APPROVAL_ENDPOINT_FILE), JSON.stringify({
|
|
100
|
+
port: this.port,
|
|
101
|
+
token: this.token,
|
|
102
|
+
pid: process.pid
|
|
103
|
+
}), "utf8");
|
|
104
|
+
const hookCommand = `${process.execPath} ${process.argv[1]} cursor-approval-hook`;
|
|
105
|
+
await writeFile(hooksPath, JSON.stringify({
|
|
106
|
+
version: 1,
|
|
107
|
+
hooks: {
|
|
108
|
+
// preToolUse covers every tool, including Read, Write and Shell.
|
|
109
|
+
// It only understands allow/deny — never "ask" — and failClosed
|
|
110
|
+
// has to be explicit because hooks fail open by default.
|
|
111
|
+
preToolUse: [
|
|
112
|
+
{ type: "command", command: hookCommand, timeout: HOOK_TIMEOUT_SECONDS, failClosed: true }
|
|
113
|
+
]
|
|
114
|
+
}
|
|
115
|
+
}, null, 2), "utf8");
|
|
116
|
+
await this.excludeFromGit();
|
|
117
|
+
}
|
|
118
|
+
/** Keep the session's scaffolding out of `git status`. */
|
|
119
|
+
async excludeFromGit() {
|
|
120
|
+
const excludePath = join(this.cwd, ".git", "info", "exclude");
|
|
121
|
+
if (!existsSync(excludePath)) return;
|
|
122
|
+
try {
|
|
123
|
+
const current = await readFile(excludePath, "utf8");
|
|
124
|
+
if (current.includes(".cursor/.happy-approval.json")) return;
|
|
125
|
+
await writeFile(
|
|
126
|
+
excludePath,
|
|
127
|
+
`${current}${current.endsWith("\n") ? "" : "\n"}# added by happy cursor session
|
|
128
|
+
.cursor/hooks.json
|
|
129
|
+
.cursor/.happy-approval.json
|
|
130
|
+
`,
|
|
131
|
+
"utf8"
|
|
132
|
+
);
|
|
133
|
+
} catch (error) {
|
|
134
|
+
logger.debug(`[cursor] could not update .git/info/exclude: ${error}`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
async stop() {
|
|
138
|
+
if (!this.started) return;
|
|
139
|
+
this.started = false;
|
|
140
|
+
try {
|
|
141
|
+
await rm(join(this.cursorDir, APPROVAL_ENDPOINT_FILE), { force: true });
|
|
142
|
+
const hooksPath = join(this.cursorDir, HOOKS_FILE);
|
|
143
|
+
const backupPath = join(this.cursorDir, HOOKS_BACKUP_FILE);
|
|
144
|
+
if (this.hadExistingHooks && existsSync(backupPath)) {
|
|
145
|
+
await rename(backupPath, hooksPath);
|
|
146
|
+
} else {
|
|
147
|
+
await rm(hooksPath, { force: true });
|
|
148
|
+
}
|
|
149
|
+
if (this.createdCursorDir && (await readdir(this.cursorDir)).length === 0) {
|
|
150
|
+
await rmdir(this.cursorDir);
|
|
151
|
+
}
|
|
152
|
+
} catch (error) {
|
|
153
|
+
logger.debug(`[cursor] cleanup of .cursor/ failed: ${error}`);
|
|
154
|
+
}
|
|
155
|
+
await new Promise((resolve) => {
|
|
156
|
+
if (!this.server) return resolve();
|
|
157
|
+
this.server.close(() => resolve());
|
|
158
|
+
this.server = null;
|
|
159
|
+
});
|
|
160
|
+
logger.debug("[cursor] approval bridge stopped");
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export { APPROVAL_ENDPOINT_FILE as A, CursorApprovalBridge as C };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import { h as decodeBase64, e as encodeBase64, f as encrypt, g as decrypt, c as configuration } from './persistence-
|
|
3
|
-
import { decryptWithEphemeralKey } from './auth-
|
|
2
|
+
import { h as decodeBase64, e as encodeBase64, f as encrypt, g as decrypt, c as configuration } from './persistence-D9tMm6bj.mjs';
|
|
3
|
+
import { decryptWithEphemeralKey } from './auth-Q2STUNI-.mjs';
|
|
4
4
|
import tweetnacl from 'tweetnacl';
|
|
5
5
|
import { existsSync } from 'node:fs';
|
|
6
6
|
import { writeFile, mkdir, readFile } from 'node:fs/promises';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var axios = require('axios');
|
|
4
|
-
var logger = require('./persistence-
|
|
5
|
-
var auth = require('./auth-
|
|
4
|
+
var logger = require('./persistence-BcQmjobZ.cjs');
|
|
5
|
+
var auth = require('./auth-G9fZpVJ2.cjs');
|
|
6
6
|
var tweetnacl = require('tweetnacl');
|
|
7
7
|
var fs = require('node:fs');
|
|
8
8
|
var promises = require('node:fs/promises');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chalk = require('chalk');
|
|
4
|
-
var logger = require('./persistence-
|
|
5
|
-
var controlClient = require('./controlClient-
|
|
4
|
+
var logger = require('./persistence-BcQmjobZ.cjs');
|
|
5
|
+
var controlClient = require('./controlClient-CEz_p1zc.cjs');
|
|
6
6
|
var doctor = require('./doctor-C08m5Z9f.cjs');
|
|
7
7
|
var fs = require('node:fs');
|
|
8
8
|
var path = require('node:path');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { p as packageJson, c as configuration, a as readSettings, r as readCredentials, m as readDaemonState } from './persistence-
|
|
3
|
-
import { checkIfDaemonRunningAndCleanupStaleState } from './controlClient-
|
|
2
|
+
import { p as packageJson, c as configuration, a as readSettings, r as readCredentials, m as readDaemonState } from './persistence-D9tMm6bj.mjs';
|
|
3
|
+
import { checkIfDaemonRunningAndCleanupStaleState } from './controlClient-DoS9JqQC.mjs';
|
|
4
4
|
import { findAllHappyProcesses } from './doctor-ON7pN5G5.mjs';
|
|
5
5
|
import { existsSync, readdirSync, statSync } from 'node:fs';
|
|
6
6
|
import { join } from 'node:path';
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
import { l as logger, r as readCredentials } from './persistence-
|
|
1
|
+
import { l as logger, r as readCredentials } from './persistence-D9tMm6bj.mjs';
|
|
2
2
|
import { createHash } from 'crypto';
|
|
3
|
-
import { join
|
|
3
|
+
import { join } from 'node:path';
|
|
4
4
|
import { p as projectPath } from './projectPath-BTBIMB57.mjs';
|
|
5
5
|
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
6
6
|
import { createServer } from 'node:http';
|
|
7
7
|
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
8
8
|
import { isInitializeRequest } from '@modelcontextprotocol/sdk/types.js';
|
|
9
9
|
import { z } from 'zod';
|
|
10
|
-
import { l as listDevices, d as deviceExec } from './deviceKeys-
|
|
10
|
+
import { l as listDevices, d as deviceExec } from './deviceKeys-B4aqjnE6.mjs';
|
|
11
11
|
import { randomUUID } from 'node:crypto';
|
|
12
12
|
import { s as shouldEnableOrchestratorTools } from './prompt-BsAZsPbo.mjs';
|
|
13
13
|
import './mcpToolSchemas-CjeTfrAs.mjs';
|
|
14
|
-
import './index-
|
|
15
|
-
import { execSync } from 'node:child_process';
|
|
14
|
+
import './index-DTV7drqs.mjs';
|
|
16
15
|
import axios from 'axios';
|
|
17
16
|
import 'node:events';
|
|
18
17
|
import 'socket.io-client';
|
|
19
|
-
import './api-
|
|
18
|
+
import './api-Ew6xr81i.mjs';
|
|
20
19
|
import 'tweetnacl';
|
|
21
20
|
import 'ws';
|
|
22
21
|
import '@stablelib/base64';
|
|
@@ -24,6 +23,7 @@ import 'node:os';
|
|
|
24
23
|
import 'node:fs/promises';
|
|
25
24
|
import 'node:fs';
|
|
26
25
|
import 'node:readline';
|
|
26
|
+
import 'node:child_process';
|
|
27
27
|
import 'expo-server-sdk';
|
|
28
28
|
import 'chalk';
|
|
29
29
|
import './types-BoJh4Qfv.mjs';
|
|
@@ -757,39 +757,6 @@ async function createMcpContext(session) {
|
|
|
757
757
|
};
|
|
758
758
|
}
|
|
759
759
|
|
|
760
|
-
function detectGitWorktree(cwd) {
|
|
761
|
-
try {
|
|
762
|
-
const gitDir = execSync("git rev-parse --git-dir", {
|
|
763
|
-
cwd,
|
|
764
|
-
encoding: "utf8",
|
|
765
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
766
|
-
}).trim();
|
|
767
|
-
const gitCommonDir = execSync("git rev-parse --git-common-dir", {
|
|
768
|
-
cwd,
|
|
769
|
-
encoding: "utf8",
|
|
770
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
771
|
-
}).trim();
|
|
772
|
-
const absGitDir = resolve(cwd, gitDir);
|
|
773
|
-
const absCommonDir = resolve(cwd, gitCommonDir);
|
|
774
|
-
if (absGitDir === absCommonDir) {
|
|
775
|
-
return { isWorktree: false };
|
|
776
|
-
}
|
|
777
|
-
const basePath = dirname(absCommonDir);
|
|
778
|
-
const branchName = execSync("git rev-parse --abbrev-ref HEAD", {
|
|
779
|
-
cwd,
|
|
780
|
-
encoding: "utf8",
|
|
781
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
782
|
-
}).trim();
|
|
783
|
-
return {
|
|
784
|
-
isWorktree: true,
|
|
785
|
-
worktreeBasePath: basePath,
|
|
786
|
-
worktreeBranchName: branchName || void 0
|
|
787
|
-
};
|
|
788
|
-
} catch {
|
|
789
|
-
return { isWorktree: false };
|
|
790
|
-
}
|
|
791
|
-
}
|
|
792
|
-
|
|
793
760
|
class MessageBuffer {
|
|
794
761
|
messages = [];
|
|
795
762
|
listeners = [];
|
|
@@ -884,4 +851,4 @@ async function downloadImage(url) {
|
|
|
884
851
|
return { base64, mimeType };
|
|
885
852
|
}
|
|
886
853
|
|
|
887
|
-
export { MessageQueue2 as M,
|
|
854
|
+
export { MessageQueue2 as M, MessageBuffer as a, parseSpecialCommand as b, createMcpContext as c, downloadImage as d, hashObject as h, parseClear as p, registerKillSessionHandler as r };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var logger = require('./persistence-
|
|
3
|
+
var logger = require('./persistence-BcQmjobZ.cjs');
|
|
4
4
|
var crypto = require('crypto');
|
|
5
5
|
var path = require('node:path');
|
|
6
6
|
var projectPath = require('./projectPath-ChLhdOyt.cjs');
|
|
@@ -9,16 +9,15 @@ var node_http = require('node:http');
|
|
|
9
9
|
var streamableHttp_js = require('@modelcontextprotocol/sdk/server/streamableHttp.js');
|
|
10
10
|
var types_js = require('@modelcontextprotocol/sdk/types.js');
|
|
11
11
|
var z = require('zod');
|
|
12
|
-
var deviceKeys = require('./deviceKeys-
|
|
12
|
+
var deviceKeys = require('./deviceKeys-DyUn0bEx.cjs');
|
|
13
13
|
var node_crypto = require('node:crypto');
|
|
14
14
|
var prompt = require('./prompt-BTWDZZO0.cjs');
|
|
15
15
|
require('./mcpToolSchemas-DK42yoZ_.cjs');
|
|
16
|
-
require('./index-
|
|
17
|
-
var node_child_process = require('node:child_process');
|
|
16
|
+
require('./index-BeKrqPYR.cjs');
|
|
18
17
|
var axios = require('axios');
|
|
19
18
|
require('node:events');
|
|
20
19
|
require('socket.io-client');
|
|
21
|
-
require('./api-
|
|
20
|
+
require('./api-CIE4_cWd.cjs');
|
|
22
21
|
require('tweetnacl');
|
|
23
22
|
require('ws');
|
|
24
23
|
require('@stablelib/base64');
|
|
@@ -26,6 +25,7 @@ require('node:os');
|
|
|
26
25
|
require('node:fs/promises');
|
|
27
26
|
require('node:fs');
|
|
28
27
|
require('node:readline');
|
|
28
|
+
require('node:child_process');
|
|
29
29
|
require('expo-server-sdk');
|
|
30
30
|
require('chalk');
|
|
31
31
|
require('./types-DWeB7aqh.cjs');
|
|
@@ -759,39 +759,6 @@ async function createMcpContext(session) {
|
|
|
759
759
|
};
|
|
760
760
|
}
|
|
761
761
|
|
|
762
|
-
function detectGitWorktree(cwd) {
|
|
763
|
-
try {
|
|
764
|
-
const gitDir = node_child_process.execSync("git rev-parse --git-dir", {
|
|
765
|
-
cwd,
|
|
766
|
-
encoding: "utf8",
|
|
767
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
768
|
-
}).trim();
|
|
769
|
-
const gitCommonDir = node_child_process.execSync("git rev-parse --git-common-dir", {
|
|
770
|
-
cwd,
|
|
771
|
-
encoding: "utf8",
|
|
772
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
773
|
-
}).trim();
|
|
774
|
-
const absGitDir = path.resolve(cwd, gitDir);
|
|
775
|
-
const absCommonDir = path.resolve(cwd, gitCommonDir);
|
|
776
|
-
if (absGitDir === absCommonDir) {
|
|
777
|
-
return { isWorktree: false };
|
|
778
|
-
}
|
|
779
|
-
const basePath = path.dirname(absCommonDir);
|
|
780
|
-
const branchName = node_child_process.execSync("git rev-parse --abbrev-ref HEAD", {
|
|
781
|
-
cwd,
|
|
782
|
-
encoding: "utf8",
|
|
783
|
-
stdio: ["ignore", "pipe", "ignore"]
|
|
784
|
-
}).trim();
|
|
785
|
-
return {
|
|
786
|
-
isWorktree: true,
|
|
787
|
-
worktreeBasePath: basePath,
|
|
788
|
-
worktreeBranchName: branchName || void 0
|
|
789
|
-
};
|
|
790
|
-
} catch {
|
|
791
|
-
return { isWorktree: false };
|
|
792
|
-
}
|
|
793
|
-
}
|
|
794
|
-
|
|
795
762
|
class MessageBuffer {
|
|
796
763
|
messages = [];
|
|
797
764
|
listeners = [];
|
|
@@ -889,7 +856,6 @@ async function downloadImage(url) {
|
|
|
889
856
|
exports.MessageBuffer = MessageBuffer;
|
|
890
857
|
exports.MessageQueue2 = MessageQueue2;
|
|
891
858
|
exports.createMcpContext = createMcpContext;
|
|
892
|
-
exports.detectGitWorktree = detectGitWorktree;
|
|
893
859
|
exports.downloadImage = downloadImage;
|
|
894
860
|
exports.hashObject = hashObject;
|
|
895
861
|
exports.parseClear = parseClear;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
var axios = require('axios');
|
|
4
4
|
var tweetnacl = require('tweetnacl');
|
|
5
5
|
var node_crypto = require('node:crypto');
|
|
6
|
-
var logger = require('./persistence-
|
|
7
|
-
var auth = require('./auth-
|
|
6
|
+
var logger = require('./persistence-BcQmjobZ.cjs');
|
|
7
|
+
var auth = require('./auth-G9fZpVJ2.cjs');
|
|
8
8
|
require('node:fs/promises');
|
|
9
9
|
require('node:fs');
|
|
10
10
|
require('node:os');
|
|
@@ -14,7 +14,7 @@ require('chalk');
|
|
|
14
14
|
require('fs');
|
|
15
15
|
require('qrcode-terminal');
|
|
16
16
|
require('./time-Bj2HRkKH.cjs');
|
|
17
|
-
require('./browser-
|
|
17
|
+
require('./browser-qDIIAL7S.cjs');
|
|
18
18
|
require('open');
|
|
19
19
|
require('react');
|
|
20
20
|
require('ink');
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
2
|
import tweetnacl from 'tweetnacl';
|
|
3
3
|
import { createHmac, randomBytes } from 'node:crypto';
|
|
4
|
-
import { r as readCredentials, c as configuration, h as decodeBase64, u as updateSettings, w as writeCredentialsDataKey, o as libsodiumPublicKeyFromSecretKey } from './persistence-
|
|
5
|
-
import { decryptWithEphemeralKey } from './auth-
|
|
4
|
+
import { r as readCredentials, c as configuration, h as decodeBase64, u as updateSettings, w as writeCredentialsDataKey, o as libsodiumPublicKeyFromSecretKey } from './persistence-D9tMm6bj.mjs';
|
|
5
|
+
import { decryptWithEphemeralKey } from './auth-Q2STUNI-.mjs';
|
|
6
6
|
import 'node:fs/promises';
|
|
7
7
|
import 'node:fs';
|
|
8
8
|
import 'node:os';
|
|
@@ -12,7 +12,7 @@ import 'chalk';
|
|
|
12
12
|
import 'fs';
|
|
13
13
|
import 'qrcode-terminal';
|
|
14
14
|
import './time-DgsBLJA_.mjs';
|
|
15
|
-
import './browser-
|
|
15
|
+
import './browser-BI7s-V8E.mjs';
|
|
16
16
|
import 'open';
|
|
17
17
|
import 'react';
|
|
18
18
|
import 'ink';
|
|
@@ -3,7 +3,7 @@ import { constants } from 'node:fs';
|
|
|
3
3
|
import { mkdir, appendFile, access, readFile } from 'node:fs/promises';
|
|
4
4
|
import { randomUUID } from 'node:crypto';
|
|
5
5
|
import { basename, dirname, resolve } from 'node:path';
|
|
6
|
-
import { c as configuration } from './persistence-
|
|
6
|
+
import { c as configuration } from './persistence-D9tMm6bj.mjs';
|
|
7
7
|
import { r as renderEvidenceReport, i as inferEvidenceKind } from './workflowReports-Dd8-4-8f.mjs';
|
|
8
8
|
import { p as parseWorkflowArgs, s as stringFlag, b as booleanFlag, a as printOrWriteOutput } from './workflowCommon-B0d01Y_a.mjs';
|
|
9
9
|
import 'node:os';
|
|
@@ -5,7 +5,7 @@ var fs = require('node:fs');
|
|
|
5
5
|
var promises = require('node:fs/promises');
|
|
6
6
|
var node_crypto = require('node:crypto');
|
|
7
7
|
var path = require('node:path');
|
|
8
|
-
var logger = require('./persistence-
|
|
8
|
+
var logger = require('./persistence-BcQmjobZ.cjs');
|
|
9
9
|
var workflowReports = require('./workflowReports-BEWuQesA.cjs');
|
|
10
10
|
var workflowCommon = require('./workflowCommon-Bl568-rt.cjs');
|
|
11
11
|
require('node:os');
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var node_child_process = require('node:child_process');
|
|
4
|
+
var path = require('node:path');
|
|
5
|
+
|
|
6
|
+
function detectGitWorktree(cwd) {
|
|
7
|
+
try {
|
|
8
|
+
const gitDir = node_child_process.execSync("git rev-parse --git-dir", {
|
|
9
|
+
cwd,
|
|
10
|
+
encoding: "utf8",
|
|
11
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
12
|
+
}).trim();
|
|
13
|
+
const gitCommonDir = node_child_process.execSync("git rev-parse --git-common-dir", {
|
|
14
|
+
cwd,
|
|
15
|
+
encoding: "utf8",
|
|
16
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
17
|
+
}).trim();
|
|
18
|
+
const absGitDir = path.resolve(cwd, gitDir);
|
|
19
|
+
const absCommonDir = path.resolve(cwd, gitCommonDir);
|
|
20
|
+
if (absGitDir === absCommonDir) {
|
|
21
|
+
return { isWorktree: false };
|
|
22
|
+
}
|
|
23
|
+
const basePath = path.dirname(absCommonDir);
|
|
24
|
+
const branchName = node_child_process.execSync("git rev-parse --abbrev-ref HEAD", {
|
|
25
|
+
cwd,
|
|
26
|
+
encoding: "utf8",
|
|
27
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
28
|
+
}).trim();
|
|
29
|
+
return {
|
|
30
|
+
isWorktree: true,
|
|
31
|
+
worktreeBasePath: basePath,
|
|
32
|
+
worktreeBranchName: branchName || void 0
|
|
33
|
+
};
|
|
34
|
+
} catch {
|
|
35
|
+
return { isWorktree: false };
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
exports.detectGitWorktree = detectGitWorktree;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { execSync } from 'node:child_process';
|
|
2
|
+
import { resolve, dirname } from 'node:path';
|
|
3
|
+
|
|
4
|
+
function detectGitWorktree(cwd) {
|
|
5
|
+
try {
|
|
6
|
+
const gitDir = execSync("git rev-parse --git-dir", {
|
|
7
|
+
cwd,
|
|
8
|
+
encoding: "utf8",
|
|
9
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
10
|
+
}).trim();
|
|
11
|
+
const gitCommonDir = execSync("git rev-parse --git-common-dir", {
|
|
12
|
+
cwd,
|
|
13
|
+
encoding: "utf8",
|
|
14
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
15
|
+
}).trim();
|
|
16
|
+
const absGitDir = resolve(cwd, gitDir);
|
|
17
|
+
const absCommonDir = resolve(cwd, gitCommonDir);
|
|
18
|
+
if (absGitDir === absCommonDir) {
|
|
19
|
+
return { isWorktree: false };
|
|
20
|
+
}
|
|
21
|
+
const basePath = dirname(absCommonDir);
|
|
22
|
+
const branchName = execSync("git rev-parse --abbrev-ref HEAD", {
|
|
23
|
+
cwd,
|
|
24
|
+
encoding: "utf8",
|
|
25
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
26
|
+
}).trim();
|
|
27
|
+
return {
|
|
28
|
+
isWorktree: true,
|
|
29
|
+
worktreeBasePath: basePath,
|
|
30
|
+
worktreeBranchName: branchName || void 0
|
|
31
|
+
};
|
|
32
|
+
} catch {
|
|
33
|
+
return { isWorktree: false };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { detectGitWorktree as d };
|
|
@@ -301,7 +301,18 @@ const MODEL_MODES = [
|
|
|
301
301
|
"gpt-5.1-codex-mini-high",
|
|
302
302
|
"gemini-3-pro-preview",
|
|
303
303
|
"gemini-3-flash-preview",
|
|
304
|
-
"gemini-2.5-pro"
|
|
304
|
+
"gemini-2.5-pro",
|
|
305
|
+
// Cursor resells models from every vendor — `cursor-agent --list-models`
|
|
306
|
+
// returned 161 ids. Only a curated set lives here: the ids below are the
|
|
307
|
+
// ones the picker offers. Anything else Cursor supports is still reachable
|
|
308
|
+
// by passing --model to `happy cursor`, which does not go through this list.
|
|
309
|
+
"auto",
|
|
310
|
+
"composer-2.5",
|
|
311
|
+
"composer-2.5-fast",
|
|
312
|
+
"cursor-grok-4.6-high",
|
|
313
|
+
"gemini-3.7-flash-high",
|
|
314
|
+
"claude-opus-5-thinking-high",
|
|
315
|
+
"claude-sonnet-5-high"
|
|
305
316
|
];
|
|
306
317
|
const CLAUDE_MODEL_MODES = [
|
|
307
318
|
MODEL_MODE_DEFAULT,
|
|
@@ -370,6 +381,17 @@ const GEMINI_MODEL_MODES = [
|
|
|
370
381
|
"gemini-3-flash-preview",
|
|
371
382
|
"gemini-2.5-pro"
|
|
372
383
|
];
|
|
384
|
+
const CURSOR_MODEL_MODES = [
|
|
385
|
+
MODEL_MODE_DEFAULT,
|
|
386
|
+
"auto",
|
|
387
|
+
"composer-2.5",
|
|
388
|
+
"composer-2.5-fast",
|
|
389
|
+
"claude-opus-5-thinking-high",
|
|
390
|
+
"claude-sonnet-5-high",
|
|
391
|
+
"gpt-5.6-sol-high",
|
|
392
|
+
"cursor-grok-4.6-high",
|
|
393
|
+
"gemini-3.7-flash-high"
|
|
394
|
+
];
|
|
373
395
|
const CODEX_MODEL_MODES = [
|
|
374
396
|
MODEL_MODE_DEFAULT,
|
|
375
397
|
"gpt-5.6-sol-low",
|
|
@@ -416,6 +438,7 @@ const MODEL_MODE_SET = new Set(MODEL_MODES);
|
|
|
416
438
|
const CLAUDE_MODEL_MODE_SET = new Set(CLAUDE_MODEL_MODES);
|
|
417
439
|
const GEMINI_MODEL_MODE_SET = new Set(GEMINI_MODEL_MODES);
|
|
418
440
|
const CODEX_MODEL_MODE_SET = new Set(CODEX_MODEL_MODES);
|
|
441
|
+
const CURSOR_MODEL_MODE_SET = new Set(CURSOR_MODEL_MODES);
|
|
419
442
|
function isModelMode(value) {
|
|
420
443
|
return MODEL_MODE_SET.has(value);
|
|
421
444
|
}
|
|
@@ -423,6 +446,7 @@ function isModelModeForAgent(agent, mode) {
|
|
|
423
446
|
if (!isModelMode(mode)) return false;
|
|
424
447
|
if (agent === "claude") return CLAUDE_MODEL_MODE_SET.has(mode);
|
|
425
448
|
if (agent === "gemini") return GEMINI_MODEL_MODE_SET.has(mode);
|
|
449
|
+
if (agent === "cursor") return CURSOR_MODEL_MODE_SET.has(mode);
|
|
426
450
|
return CODEX_MODEL_MODE_SET.has(mode);
|
|
427
451
|
}
|
|
428
452
|
const CLAUDE_MODE_TO_SELECTION = {
|
|
@@ -281,7 +281,18 @@ const MODEL_MODES = [
|
|
|
281
281
|
"gpt-5.1-codex-mini-high",
|
|
282
282
|
"gemini-3-pro-preview",
|
|
283
283
|
"gemini-3-flash-preview",
|
|
284
|
-
"gemini-2.5-pro"
|
|
284
|
+
"gemini-2.5-pro",
|
|
285
|
+
// Cursor resells models from every vendor — `cursor-agent --list-models`
|
|
286
|
+
// returned 161 ids. Only a curated set lives here: the ids below are the
|
|
287
|
+
// ones the picker offers. Anything else Cursor supports is still reachable
|
|
288
|
+
// by passing --model to `happy cursor`, which does not go through this list.
|
|
289
|
+
"auto",
|
|
290
|
+
"composer-2.5",
|
|
291
|
+
"composer-2.5-fast",
|
|
292
|
+
"cursor-grok-4.6-high",
|
|
293
|
+
"gemini-3.7-flash-high",
|
|
294
|
+
"claude-opus-5-thinking-high",
|
|
295
|
+
"claude-sonnet-5-high"
|
|
285
296
|
];
|
|
286
297
|
const CLAUDE_MODEL_MODES = [
|
|
287
298
|
MODEL_MODE_DEFAULT,
|
|
@@ -350,6 +361,17 @@ const GEMINI_MODEL_MODES = [
|
|
|
350
361
|
"gemini-3-flash-preview",
|
|
351
362
|
"gemini-2.5-pro"
|
|
352
363
|
];
|
|
364
|
+
const CURSOR_MODEL_MODES = [
|
|
365
|
+
MODEL_MODE_DEFAULT,
|
|
366
|
+
"auto",
|
|
367
|
+
"composer-2.5",
|
|
368
|
+
"composer-2.5-fast",
|
|
369
|
+
"claude-opus-5-thinking-high",
|
|
370
|
+
"claude-sonnet-5-high",
|
|
371
|
+
"gpt-5.6-sol-high",
|
|
372
|
+
"cursor-grok-4.6-high",
|
|
373
|
+
"gemini-3.7-flash-high"
|
|
374
|
+
];
|
|
353
375
|
const CODEX_MODEL_MODES = [
|
|
354
376
|
MODEL_MODE_DEFAULT,
|
|
355
377
|
"gpt-5.6-sol-low",
|
|
@@ -396,6 +418,7 @@ const MODEL_MODE_SET = new Set(MODEL_MODES);
|
|
|
396
418
|
const CLAUDE_MODEL_MODE_SET = new Set(CLAUDE_MODEL_MODES);
|
|
397
419
|
const GEMINI_MODEL_MODE_SET = new Set(GEMINI_MODEL_MODES);
|
|
398
420
|
const CODEX_MODEL_MODE_SET = new Set(CODEX_MODEL_MODES);
|
|
421
|
+
const CURSOR_MODEL_MODE_SET = new Set(CURSOR_MODEL_MODES);
|
|
399
422
|
function isModelMode(value) {
|
|
400
423
|
return MODEL_MODE_SET.has(value);
|
|
401
424
|
}
|
|
@@ -403,6 +426,7 @@ function isModelModeForAgent(agent, mode) {
|
|
|
403
426
|
if (!isModelMode(mode)) return false;
|
|
404
427
|
if (agent === "claude") return CLAUDE_MODEL_MODE_SET.has(mode);
|
|
405
428
|
if (agent === "gemini") return GEMINI_MODEL_MODE_SET.has(mode);
|
|
429
|
+
if (agent === "cursor") return CURSOR_MODEL_MODE_SET.has(mode);
|
|
406
430
|
return CODEX_MODEL_MODE_SET.has(mode);
|
|
407
431
|
}
|
|
408
432
|
const CLAUDE_MODE_TO_SELECTION = {
|