@kynver-app/runtime 0.1.1 → 0.1.2
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 +12 -1
- package/dist/cli.js +52 -3
- package/dist/cli.js.map +4 -4
- package/dist/index.js +52 -3
- package/dist/index.js.map +4 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -691,9 +691,58 @@ var claudeProvider = {
|
|
|
691
691
|
}
|
|
692
692
|
};
|
|
693
693
|
|
|
694
|
+
// src/providers/cursor.ts
|
|
695
|
+
import { closeSync as closeSync2, openSync as openSync2 } from "node:fs";
|
|
696
|
+
import { spawn as spawn2 } from "node:child_process";
|
|
697
|
+
var DEFAULT_CURSOR_MODEL = "composer-2.5";
|
|
698
|
+
function resolveAgentBin() {
|
|
699
|
+
return process.env.KYNVER_CURSOR_AGENT_BIN?.trim() || process.env.CURSOR_AGENT_BIN?.trim() || "agent";
|
|
700
|
+
}
|
|
701
|
+
var cursorProvider = {
|
|
702
|
+
name: "cursor",
|
|
703
|
+
start(opts) {
|
|
704
|
+
const model = opts.model || DEFAULT_CURSOR_MODEL;
|
|
705
|
+
const stdoutFd = openSync2(opts.stdoutPath, "a");
|
|
706
|
+
const stderrFd = openSync2(opts.stderrPath, "a");
|
|
707
|
+
const agentBin = resolveAgentBin();
|
|
708
|
+
const child = spawn2(
|
|
709
|
+
agentBin,
|
|
710
|
+
[
|
|
711
|
+
"-p",
|
|
712
|
+
"--force",
|
|
713
|
+
"--trust",
|
|
714
|
+
"--workspace",
|
|
715
|
+
opts.worktreePath,
|
|
716
|
+
"--output-format",
|
|
717
|
+
"stream-json",
|
|
718
|
+
"--stream-partial-output",
|
|
719
|
+
"--model",
|
|
720
|
+
model,
|
|
721
|
+
opts.prompt
|
|
722
|
+
],
|
|
723
|
+
{
|
|
724
|
+
cwd: opts.worktreePath,
|
|
725
|
+
detached: true,
|
|
726
|
+
stdio: ["ignore", stdoutFd, stderrFd],
|
|
727
|
+
env: process.env
|
|
728
|
+
}
|
|
729
|
+
);
|
|
730
|
+
closeSync2(stdoutFd);
|
|
731
|
+
closeSync2(stderrFd);
|
|
732
|
+
if (!child.pid) {
|
|
733
|
+
throw new Error(
|
|
734
|
+
`failed to spawn Cursor agent worker (is \`${agentBin}\` on PATH? run \`agent login\` or set CURSOR_API_KEY)`
|
|
735
|
+
);
|
|
736
|
+
}
|
|
737
|
+
child.unref();
|
|
738
|
+
return { pid: child.pid, model };
|
|
739
|
+
}
|
|
740
|
+
};
|
|
741
|
+
|
|
694
742
|
// src/providers/registry.ts
|
|
695
743
|
var BUILTIN = {
|
|
696
|
-
claude: claudeProvider
|
|
744
|
+
claude: claudeProvider,
|
|
745
|
+
cursor: cursorProvider
|
|
697
746
|
};
|
|
698
747
|
var overrideProvider = null;
|
|
699
748
|
function resolveWorkerProvider(name) {
|
|
@@ -1439,14 +1488,14 @@ function usage(code = 0) {
|
|
|
1439
1488
|
[
|
|
1440
1489
|
"Usage:",
|
|
1441
1490
|
" kynver login --api-key KEY",
|
|
1442
|
-
" kynver setup [--api-base-url URL] [--agent-os-id ID] [--agent-os-slug SLUG] [--repo PATH] [--max-workers N]",
|
|
1491
|
+
" kynver setup [--api-base-url URL] [--agent-os-id ID] [--agent-os-slug SLUG] [--repo PATH] [--max-workers N] [--provider claude|cursor]",
|
|
1443
1492
|
" kynver daemon --run RUN_ID --agent-os-id AOS_ID [--execute] [--interval-ms MS]",
|
|
1444
1493
|
" kynver run create --repo /path/repo [--name name] [--base origin/main]",
|
|
1445
1494
|
" kynver run list",
|
|
1446
1495
|
" kynver run status --run RUN_ID",
|
|
1447
1496
|
" kynver run dispatch --run RUN_ID --agent-os-id AOS_ID [--base-url URL] [--secret SECRET] [--execute] [--lane any|implementation|review|landing] [--max-starts 1] [--lease-ms MS] [--owned path[,path]] [--model claude-opus-4-7] [--disk-path /]",
|
|
1448
1497
|
" kynver run sweep --run RUN_ID --agent-os-id AOS_ID [--base-url URL] [--secret SECRET] [--grace-ms MS]",
|
|
1449
|
-
' kynver worker start --run RUN_ID --name worker --task "..." [--owned path[,path]] [--model claude
|
|
1498
|
+
' kynver worker start --run RUN_ID --name worker --task "..." [--owned path[,path]] [--model MODEL] [--provider claude|cursor] [--agent-os-id AOS_ID] [--task-id TASK_ID]',
|
|
1450
1499
|
" kynver worker status --run RUN_ID --name worker",
|
|
1451
1500
|
" kynver worker tail --run RUN_ID --name worker [--lines 40] [--raw]",
|
|
1452
1501
|
" kynver worker stop --run RUN_ID --name worker",
|