viagen 0.0.39 → 0.0.43
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/cli.js +16 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.js +14108 -226
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -187,6 +187,12 @@ async function deploySandbox(opts) {
|
|
|
187
187
|
await sandbox2.writeFiles(files);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
+
if (opts.fling) {
|
|
191
|
+
await sandbox2.runCommand("bash", [
|
|
192
|
+
"-c",
|
|
193
|
+
`mkdir -p ~/.fling && echo '${opts.fling.token}' > ~/.fling/token && chmod 600 ~/.fling/token`
|
|
194
|
+
]);
|
|
195
|
+
}
|
|
190
196
|
const envMap = { ...opts.envVars ?? {} };
|
|
191
197
|
envMap["VIAGEN_AUTH_TOKEN"] = token;
|
|
192
198
|
envMap["VIAGEN_SESSION_START"] = String(Math.floor(Date.now() / 1e3));
|
|
@@ -227,7 +233,7 @@ async function deploySandbox(opts) {
|
|
|
227
233
|
}
|
|
228
234
|
const devServer = await sandbox2.runCommand({
|
|
229
235
|
cmd: "npm",
|
|
230
|
-
args: ["run", "dev"
|
|
236
|
+
args: ["run", "dev"],
|
|
231
237
|
detached: true
|
|
232
238
|
});
|
|
233
239
|
const baseUrl = sandbox2.domain(5173);
|
|
@@ -1573,12 +1579,17 @@ async function tasksList(args) {
|
|
|
1573
1579
|
}
|
|
1574
1580
|
async function tasksCreate(args) {
|
|
1575
1581
|
const branch = parseFlag(args, "--branch") || parseFlag(args, "-b");
|
|
1582
|
+
const type = parseFlag(args, "--type") || parseFlag(args, "-T");
|
|
1576
1583
|
const positional = [];
|
|
1577
1584
|
for (let i = 0; i < args.length; i++) {
|
|
1578
1585
|
if (args[i] === "--branch" || args[i] === "-b") {
|
|
1579
1586
|
i++;
|
|
1580
1587
|
continue;
|
|
1581
1588
|
}
|
|
1589
|
+
if (args[i] === "--type" || args[i] === "-T") {
|
|
1590
|
+
i++;
|
|
1591
|
+
continue;
|
|
1592
|
+
}
|
|
1582
1593
|
positional.push(args[i]);
|
|
1583
1594
|
}
|
|
1584
1595
|
let prompt = positional.join(" ");
|
|
@@ -1593,9 +1604,11 @@ async function tasksCreate(args) {
|
|
|
1593
1604
|
const projectId = await requireProjectId(client);
|
|
1594
1605
|
const input = { prompt };
|
|
1595
1606
|
if (branch) input.branch = branch;
|
|
1607
|
+
if (type) input.type = type;
|
|
1596
1608
|
const task = await client.tasks.create(projectId, input);
|
|
1597
1609
|
console.log(`Task created: ${task.id}`);
|
|
1598
1610
|
console.log(` Prompt: ${task.prompt}`);
|
|
1611
|
+
console.log(` Type: ${task.type}`);
|
|
1599
1612
|
console.log(` Branch: ${task.branch}`);
|
|
1600
1613
|
console.log(` Status: ${task.status}`);
|
|
1601
1614
|
console.log("");
|
|
@@ -1611,6 +1624,7 @@ async function tasksGet(args) {
|
|
|
1611
1624
|
const projectId = await requireProjectId(client);
|
|
1612
1625
|
const task = await client.tasks.get(projectId, taskId);
|
|
1613
1626
|
console.log(` ID: ${task.id}`);
|
|
1627
|
+
console.log(` Type: ${task.type}`);
|
|
1614
1628
|
console.log(` Status: ${formatTaskStatus(task.status)}`);
|
|
1615
1629
|
console.log(` Prompt: ${task.prompt}`);
|
|
1616
1630
|
console.log(` Branch: ${task.branch}`);
|
|
@@ -1721,6 +1735,7 @@ function help() {
|
|
|
1721
1735
|
console.log("Task options:");
|
|
1722
1736
|
console.log(" -s, --status <status> Filter tasks by status (list)");
|
|
1723
1737
|
console.log(" -b, --branch <name> Branch for the task (create)");
|
|
1738
|
+
console.log(" -T, --type <type> Task type: task or plan (create)");
|
|
1724
1739
|
console.log("");
|
|
1725
1740
|
console.log("Getting started:");
|
|
1726
1741
|
console.log(" 1. npm install viagen");
|
package/dist/index.d.ts
CHANGED
|
@@ -40,6 +40,10 @@ interface DeploySandboxOptions {
|
|
|
40
40
|
teamId: string;
|
|
41
41
|
projectId: string;
|
|
42
42
|
};
|
|
43
|
+
/** Fling platform credentials. */
|
|
44
|
+
fling?: {
|
|
45
|
+
token: string;
|
|
46
|
+
};
|
|
43
47
|
/** Sandbox timeout in minutes (default: 30, max depends on Vercel plan). */
|
|
44
48
|
timeoutMinutes?: number;
|
|
45
49
|
/** User's .env variables to forward into the sandbox. */
|