continue
This commit is contained in:
+13
-3
@@ -8,7 +8,7 @@ import { agent, installFromCurl } from "./shared.ts";
|
|||||||
|
|
||||||
export const cursor = agent({
|
export const cursor = agent({
|
||||||
name: "cursor",
|
name: "cursor",
|
||||||
inputKey: "cursor_api_key",
|
inputKeys: ["cursor_api_key"],
|
||||||
install: async () => {
|
install: async () => {
|
||||||
return await installFromCurl({
|
return await installFromCurl({
|
||||||
installUrl: "https://cursor.com/install",
|
installUrl: "https://cursor.com/install",
|
||||||
@@ -93,10 +93,20 @@ export const cursor = agent({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Handle process exit
|
// Handle process exit
|
||||||
child.on("close", (code) => {
|
child.on("close", (code, signal) => {
|
||||||
clearTimeout(timeout);
|
clearTimeout(timeout);
|
||||||
|
|
||||||
if (code !== 0) {
|
if (signal) {
|
||||||
|
log.warning(`Cursor CLI terminated by signal: ${signal}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (code === 0) {
|
||||||
|
log.success("Cursor CLI completed successfully");
|
||||||
|
resolve({
|
||||||
|
success: true,
|
||||||
|
output: stdout.trim(),
|
||||||
|
});
|
||||||
|
} else {
|
||||||
const errorMessage = stderr || `Cursor CLI exited with code ${code}`;
|
const errorMessage = stderr || `Cursor CLI exited with code ${code}`;
|
||||||
log.error(`Cursor CLI failed: ${errorMessage}`);
|
log.error(`Cursor CLI failed: ${errorMessage}`);
|
||||||
resolve({
|
resolve({
|
||||||
|
|||||||
@@ -29,6 +29,11 @@ export async function run(
|
|||||||
agent.inputKeys.map((inputKey) => [inputKey, process.env[inputKey.toUpperCase()]])
|
agent.inputKeys.map((inputKey) => [inputKey, process.env[inputKey.toUpperCase()]])
|
||||||
),
|
),
|
||||||
};
|
};
|
||||||
|
// agent: "cursor",
|
||||||
|
// ...flatMorph(agents, (_, agent) => [
|
||||||
|
// agent.inputKey,
|
||||||
|
// process.env[agent.inputKey.toUpperCase()],
|
||||||
|
// ]),
|
||||||
|
|
||||||
const result = await main(inputs);
|
const result = await main(inputs);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user