@vemdev/cli 0.1.55 → 0.1.59
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/{chunk-SOAUDPRS.js → chunk-RDM4THSV.js} +90 -5
- package/dist/chunk-RDM4THSV.js.map +1 -0
- package/dist/{dist-27CAVU4D.js → dist-GKJQQVJF.js} +2 -2
- package/dist/index.js +163 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-SOAUDPRS.js.map +0 -1
- /package/dist/{dist-27CAVU4D.js.map → dist-GKJQQVJF.js.map} +0 -0
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
validateEnv,
|
|
59
59
|
validatePasswordStrength,
|
|
60
60
|
validateWebhookUrl
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-RDM4THSV.js";
|
|
62
62
|
import {
|
|
63
63
|
computeCopilotSessionStats,
|
|
64
64
|
getCopilotSessionsDir,
|
|
@@ -147,4 +147,4 @@ export {
|
|
|
147
147
|
validatePasswordStrength,
|
|
148
148
|
validateWebhookUrl
|
|
149
149
|
};
|
|
150
|
-
//# sourceMappingURL=dist-
|
|
150
|
+
//# sourceMappingURL=dist-GKJQQVJF.js.map
|
package/dist/index.js
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
isVemInitialized,
|
|
24
24
|
listAllAgentSessions,
|
|
25
25
|
parseVemUpdateBlock
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-RDM4THSV.js";
|
|
27
27
|
import {
|
|
28
28
|
readCopilotSessionDetail
|
|
29
29
|
} from "./chunk-PO3WNPAJ.js";
|
|
@@ -45,8 +45,8 @@ import prompts4 from "prompts";
|
|
|
45
45
|
// src/runtime/auth.ts
|
|
46
46
|
import { spawn } from "child_process";
|
|
47
47
|
import chalk from "chalk";
|
|
48
|
-
var API_URL = "
|
|
49
|
-
var WEB_URL = "
|
|
48
|
+
var API_URL = "http://localhost:3002";
|
|
49
|
+
var WEB_URL = "http://localhost:3000";
|
|
50
50
|
function getApiUrlCandidates(apiUrl) {
|
|
51
51
|
const candidates = [apiUrl];
|
|
52
52
|
try {
|
|
@@ -1163,7 +1163,7 @@ var syncParsedTaskUpdatesToRemote = async (configService, update, result, active
|
|
|
1163
1163
|
const changelogEntry = Array.isArray(update.changelog_append) ? update.changelog_append.join("\n").trim() || null : update.changelog_append?.trim() ?? null;
|
|
1164
1164
|
await updateTaskMetaRemote(configService, activeTask, {
|
|
1165
1165
|
raw_vem_update: JSON.parse(JSON.stringify(update)),
|
|
1166
|
-
cli_version: "0.1.
|
|
1166
|
+
cli_version: "0.1.58",
|
|
1167
1167
|
...changelogEntry ? { changelog_entry: changelogEntry } : {}
|
|
1168
1168
|
});
|
|
1169
1169
|
}
|
|
@@ -1220,7 +1220,7 @@ var syncParsedTaskUpdatesToRemote = async (configService, update, result, active
|
|
|
1220
1220
|
...patch.subtask_order !== void 0 ? { subtask_order: patch.subtask_order } : {},
|
|
1221
1221
|
...patch.due_at !== void 0 ? { due_at: patch.due_at } : {},
|
|
1222
1222
|
raw_vem_update: JSON.parse(JSON.stringify(update)),
|
|
1223
|
-
cli_version: "0.1.
|
|
1223
|
+
cli_version: "0.1.58",
|
|
1224
1224
|
// Task memory fields — stored in task_memory_entries on the API side.
|
|
1225
1225
|
...buildRemoteTaskContextPatch(patch, updatedTask) ?? {},
|
|
1226
1226
|
changelog_entry: changelogReasoning ?? null
|
|
@@ -2056,6 +2056,8 @@ Agent exited with code ${exitCode}
|
|
|
2056
2056
|
` (Auto-applying due to ${dynamicAutoExit ? "dynamic signal" : "--auto-exit"})`
|
|
2057
2057
|
)
|
|
2058
2058
|
);
|
|
2059
|
+
console.log(chalk7.cyan("\n\u{1F4C4} Full vem_update content:"));
|
|
2060
|
+
console.log(JSON.stringify(parsedAgentUpdate, null, 2));
|
|
2059
2061
|
}
|
|
2060
2062
|
try {
|
|
2061
2063
|
appliedUpdateResult = await applyVemUpdate(parsedAgentUpdate);
|
|
@@ -2382,7 +2384,7 @@ function registerAuthCommands(program2) {
|
|
|
2382
2384
|
if (receivedKey) {
|
|
2383
2385
|
await configService.setApiKey(receivedKey);
|
|
2384
2386
|
try {
|
|
2385
|
-
const API_URL2 = "
|
|
2387
|
+
const API_URL2 = "http://localhost:3002";
|
|
2386
2388
|
const headers = await buildDeviceHeaders(configService);
|
|
2387
2389
|
await fetch(`${API_URL2}/verify`, {
|
|
2388
2390
|
headers: {
|
|
@@ -3401,7 +3403,7 @@ function registerMaintenanceCommands(program2) {
|
|
|
3401
3403
|
});
|
|
3402
3404
|
program2.command("diff").description("Show differences between local and cloud state").option("--detailed", "Show detailed content diffs").option("--json", "Output as JSON").action(async (options) => {
|
|
3403
3405
|
try {
|
|
3404
|
-
const { DiffService } = await import("./dist-
|
|
3406
|
+
const { DiffService } = await import("./dist-GKJQQVJF.js");
|
|
3405
3407
|
const diffService = new DiffService();
|
|
3406
3408
|
const result = await diffService.compareWithLastPush();
|
|
3407
3409
|
if (options.json) {
|
|
@@ -3459,7 +3461,7 @@ ${"\u2500".repeat(50)}`));
|
|
|
3459
3461
|
});
|
|
3460
3462
|
program2.command("doctor").description("Run health checks on VEM setup").option("--json", "Output as JSON").action(async (options) => {
|
|
3461
3463
|
try {
|
|
3462
|
-
const { DoctorService } = await import("./dist-
|
|
3464
|
+
const { DoctorService } = await import("./dist-GKJQQVJF.js");
|
|
3463
3465
|
const doctorService = new DoctorService();
|
|
3464
3466
|
const results = await doctorService.runAllChecks();
|
|
3465
3467
|
if (options.json) {
|
|
@@ -4654,6 +4656,7 @@ async function executeClaimedRunInSandbox(input) {
|
|
|
4654
4656
|
let containerName = null;
|
|
4655
4657
|
let cancellationRequested = false;
|
|
4656
4658
|
let timedOut = false;
|
|
4659
|
+
let fullDockerLogLines = [];
|
|
4657
4660
|
const baseBranch = run.agent_base_branch || "main";
|
|
4658
4661
|
const remote = await resolveGitRemote(configService);
|
|
4659
4662
|
worktreePath = `/tmp/vem-run-${run.id}-${Date.now().toString(36)}`;
|
|
@@ -4670,6 +4673,20 @@ async function executeClaimedRunInSandbox(input) {
|
|
|
4670
4673
|
} catch {
|
|
4671
4674
|
baseHash = runGit(["rev-parse", baseBranch]);
|
|
4672
4675
|
}
|
|
4676
|
+
const localBranchExists = (() => {
|
|
4677
|
+
try {
|
|
4678
|
+
runGit(["rev-parse", "--verify", `refs/heads/${baseBranch}`]);
|
|
4679
|
+
return true;
|
|
4680
|
+
} catch {
|
|
4681
|
+
return false;
|
|
4682
|
+
}
|
|
4683
|
+
})();
|
|
4684
|
+
if (!localBranchExists) {
|
|
4685
|
+
try {
|
|
4686
|
+
runGit(["branch", baseBranch, `${remote.name}/${baseBranch}`]);
|
|
4687
|
+
} catch {
|
|
4688
|
+
}
|
|
4689
|
+
}
|
|
4673
4690
|
if (existsSync(worktreePath)) {
|
|
4674
4691
|
execFileSync("rm", ["-rf", worktreePath], { stdio: "ignore" });
|
|
4675
4692
|
}
|
|
@@ -4832,7 +4849,7 @@ async function executeClaimedRunInSandbox(input) {
|
|
|
4832
4849
|
} else if (!cancellationRequested && !timedOut) {
|
|
4833
4850
|
completionStatus = "failed";
|
|
4834
4851
|
}
|
|
4835
|
-
|
|
4852
|
+
fullDockerLogLines = stdoutChunks.join("").split("\n").filter(Boolean).slice(-1e3);
|
|
4836
4853
|
if (completionStatus === "completed" && commitHashes.length > 0) {
|
|
4837
4854
|
try {
|
|
4838
4855
|
runGitIn(worktreePath, ["push", "-u", "origin", branchName], {
|
|
@@ -4863,6 +4880,7 @@ async function executeClaimedRunInSandbox(input) {
|
|
|
4863
4880
|
const msg = err instanceof Error ? err.message : String(err);
|
|
4864
4881
|
completionError = msg;
|
|
4865
4882
|
completionStatus = "failed";
|
|
4883
|
+
console.error(chalk13.red(` \u2717 Sandbox run error: ${msg}`));
|
|
4866
4884
|
if (heartbeatTimer) {
|
|
4867
4885
|
clearInterval(heartbeatTimer);
|
|
4868
4886
|
heartbeatTimer = null;
|
|
@@ -6574,7 +6592,7 @@ Snapshot Contents:`));
|
|
|
6574
6592
|
const update = parseVemUpdateBlock(input);
|
|
6575
6593
|
const sandboxRunId = process.env.VEM_TASK_RUN_ID;
|
|
6576
6594
|
const sandboxApiKey = process.env.VEM_API_KEY;
|
|
6577
|
-
const sandboxApiUrl = "
|
|
6595
|
+
const sandboxApiUrl = "http://localhost:3002";
|
|
6578
6596
|
if (sandboxRunId && sandboxApiKey) {
|
|
6579
6597
|
const res = await fetch(
|
|
6580
6598
|
`${sandboxApiUrl}/task-runs/${sandboxRunId}/vem-update-structured`,
|
|
@@ -8918,6 +8936,138 @@ No agent sessions attached to ${id} yet.`)
|
|
|
8918
8936
|
console.error(chalk18.red(`Failed to mark task ready: ${error.message}`));
|
|
8919
8937
|
}
|
|
8920
8938
|
});
|
|
8939
|
+
taskCmd.command("iterate <id>").description(
|
|
8940
|
+
"Start an iterative run on a task that already has a PR \u2014 continues from the existing PR branch"
|
|
8941
|
+
).option(
|
|
8942
|
+
"-p, --prompt <text>",
|
|
8943
|
+
"Follow-up instructions for the agent"
|
|
8944
|
+
).option(
|
|
8945
|
+
"--run-id <runId>",
|
|
8946
|
+
"UUID of the specific run to iterate from (defaults to the latest run with a PR)"
|
|
8947
|
+
).option(
|
|
8948
|
+
"--agent <name>",
|
|
8949
|
+
"Agent to use (copilot, claude, gemini, codex)",
|
|
8950
|
+
"copilot"
|
|
8951
|
+
).option(
|
|
8952
|
+
"--cloud",
|
|
8953
|
+
"Dispatch as a cloud run (sandbox_job) \u2014 requires Ultra plan"
|
|
8954
|
+
).action(async (id, options) => {
|
|
8955
|
+
await trackCommandUsage("task iterate");
|
|
8956
|
+
try {
|
|
8957
|
+
const configService = new ConfigService();
|
|
8958
|
+
const apiKey = await tryAuthenticatedKey(configService);
|
|
8959
|
+
if (!apiKey) {
|
|
8960
|
+
console.error(
|
|
8961
|
+
chalk18.red(
|
|
8962
|
+
"\u2717 Not authenticated. Run `vem login` first."
|
|
8963
|
+
)
|
|
8964
|
+
);
|
|
8965
|
+
process.exit(1);
|
|
8966
|
+
}
|
|
8967
|
+
if (!await configService.getProjectId()) {
|
|
8968
|
+
console.error(
|
|
8969
|
+
chalk18.red(
|
|
8970
|
+
"\u2717 This directory is not linked to a VEM project. Run `vem link` first."
|
|
8971
|
+
)
|
|
8972
|
+
);
|
|
8973
|
+
process.exit(1);
|
|
8974
|
+
}
|
|
8975
|
+
const tasks = await taskService.getTasks();
|
|
8976
|
+
const task = tasks.find((t) => t.id === id || t.id === id.toUpperCase());
|
|
8977
|
+
if (!task?.db_id) {
|
|
8978
|
+
console.error(chalk18.red(`\u2717 Task ${id} not found or not synced.`));
|
|
8979
|
+
process.exit(1);
|
|
8980
|
+
}
|
|
8981
|
+
const deviceHeaders = await buildDeviceHeaders(configService);
|
|
8982
|
+
const headers = {
|
|
8983
|
+
Authorization: `Bearer ${apiKey}`,
|
|
8984
|
+
"Content-Type": "application/json",
|
|
8985
|
+
...deviceHeaders
|
|
8986
|
+
};
|
|
8987
|
+
const runsRes = await fetch(
|
|
8988
|
+
`${API_URL}/tasks/${task.db_id}/runs`,
|
|
8989
|
+
{ headers }
|
|
8990
|
+
);
|
|
8991
|
+
if (!runsRes.ok) {
|
|
8992
|
+
const data = await runsRes.json().catch(() => ({}));
|
|
8993
|
+
console.error(
|
|
8994
|
+
chalk18.red(
|
|
8995
|
+
`\u2717 Failed to fetch runs: ${data.error ?? runsRes.statusText}`
|
|
8996
|
+
)
|
|
8997
|
+
);
|
|
8998
|
+
process.exit(1);
|
|
8999
|
+
}
|
|
9000
|
+
const runsData = await runsRes.json();
|
|
9001
|
+
let parentRunId = options.runId ?? null;
|
|
9002
|
+
if (!parentRunId) {
|
|
9003
|
+
const runWithPr = runsData.runs.find(
|
|
9004
|
+
(r) => typeof r.pr_url === "string" && r.pr_url.trim().length > 0
|
|
9005
|
+
);
|
|
9006
|
+
if (!runWithPr) {
|
|
9007
|
+
console.error(
|
|
9008
|
+
chalk18.yellow(
|
|
9009
|
+
`\u2717 No run with a PR found for task ${id}. Create an initial run first.`
|
|
9010
|
+
)
|
|
9011
|
+
);
|
|
9012
|
+
process.exit(1);
|
|
9013
|
+
}
|
|
9014
|
+
parentRunId = runWithPr.id;
|
|
9015
|
+
console.log(
|
|
9016
|
+
chalk18.gray(
|
|
9017
|
+
` Using run ${runWithPr.id.slice(0, 8)} (PR: ${runWithPr.pr_url}) as base.`
|
|
9018
|
+
)
|
|
9019
|
+
);
|
|
9020
|
+
}
|
|
9021
|
+
const prompt = typeof options.prompt === "string" && options.prompt.trim() ? options.prompt.trim() : void 0;
|
|
9022
|
+
if (!prompt) {
|
|
9023
|
+
const response = await prompts9({
|
|
9024
|
+
type: "text",
|
|
9025
|
+
name: "value",
|
|
9026
|
+
message: "Follow-up instructions for the agent (leave blank to skip):"
|
|
9027
|
+
});
|
|
9028
|
+
if (response.value?.trim()) {
|
|
9029
|
+
options.prompt = response.value.trim();
|
|
9030
|
+
}
|
|
9031
|
+
}
|
|
9032
|
+
const executionBackend = options.cloud ? "sandbox_job" : void 0;
|
|
9033
|
+
const createRes = await fetch(
|
|
9034
|
+
`${API_URL}/tasks/${task.db_id}/runs`,
|
|
9035
|
+
{
|
|
9036
|
+
method: "POST",
|
|
9037
|
+
headers,
|
|
9038
|
+
body: JSON.stringify({
|
|
9039
|
+
parent_run_id: parentRunId,
|
|
9040
|
+
user_prompt: options.prompt ?? void 0,
|
|
9041
|
+
agent_name: options.agent,
|
|
9042
|
+
execution_backend: executionBackend
|
|
9043
|
+
})
|
|
9044
|
+
}
|
|
9045
|
+
);
|
|
9046
|
+
if (!createRes.ok) {
|
|
9047
|
+
const data = await createRes.json().catch(() => ({}));
|
|
9048
|
+
console.error(
|
|
9049
|
+
chalk18.red(
|
|
9050
|
+
`\u2717 Failed to start iterative run: ${data.error ?? createRes.statusText}`
|
|
9051
|
+
)
|
|
9052
|
+
);
|
|
9053
|
+
process.exit(1);
|
|
9054
|
+
}
|
|
9055
|
+
const result = await createRes.json();
|
|
9056
|
+
console.log(
|
|
9057
|
+
chalk18.green(
|
|
9058
|
+
`
|
|
9059
|
+
\u2714 Iterative run queued (ID: ${result.run.id.slice(0, 8)}\u2026)
|
|
9060
|
+
`
|
|
9061
|
+
)
|
|
9062
|
+
);
|
|
9063
|
+
console.log(chalk18.gray(" The agent will continue from the existing PR branch."));
|
|
9064
|
+
console.log(chalk18.gray(" A new PR will be opened with cumulative changes."));
|
|
9065
|
+
} catch (error) {
|
|
9066
|
+
console.error(
|
|
9067
|
+
chalk18.red(`Failed to start iterative run: ${error.message}`)
|
|
9068
|
+
);
|
|
9069
|
+
}
|
|
9070
|
+
});
|
|
8921
9071
|
}
|
|
8922
9072
|
|
|
8923
9073
|
// src/runtime/monitoring.ts
|
|
@@ -8966,13 +9116,13 @@ async function initServerMonitoring(config) {
|
|
|
8966
9116
|
|
|
8967
9117
|
// src/index.ts
|
|
8968
9118
|
await initServerMonitoring({
|
|
8969
|
-
dsn: "
|
|
9119
|
+
dsn: "",
|
|
8970
9120
|
environment: process.env.NODE_ENV || "production",
|
|
8971
|
-
release: "0.1.
|
|
9121
|
+
release: "0.1.58",
|
|
8972
9122
|
serviceName: "cli"
|
|
8973
9123
|
});
|
|
8974
9124
|
var program = new Command();
|
|
8975
|
-
program.name("vem").description("vem Project Memory CLI").version("0.1.
|
|
9125
|
+
program.name("vem").description("vem Project Memory CLI").version("0.1.58").addHelpText(
|
|
8976
9126
|
"after",
|
|
8977
9127
|
`
|
|
8978
9128
|
${chalk19.bold("\n\u26A1 Power Workflows:")}
|