@todoforai/cli 0.1.21 → 0.1.22
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/todoai.js +19 -48
- package/package.json +1 -1
package/dist/todoai.js
CHANGED
|
@@ -44096,7 +44096,7 @@ Usage:
|
|
|
44096
44096
|
todoforai-cli -c ["prompt"] # Resume last todo (optional prompt sent on attach)
|
|
44097
44097
|
todoforai-cli --resume <todo-id> ["prompt"] # Resume specific todo (optional prompt sent on attach)
|
|
44098
44098
|
todoforai-cli --inspect <todo-id>[@<slice>] # Read chat log. <slice> = -3:, :1, 5:10, 7 (Python-style)
|
|
44099
|
-
todoforai-cli
|
|
44099
|
+
todoforai-cli start <id> # Start a TODO from the registry (todoregistry.com)
|
|
44100
44100
|
todoforai-cli --list-agents # List available agents and exit
|
|
44101
44101
|
todoforai-cli --list-models [filter] # List models usable with --model and exit
|
|
44102
44102
|
todoforai-cli agent update <agent> model=<model> # Update agent settings (see 'agent --help')
|
|
@@ -44123,8 +44123,7 @@ Options:
|
|
|
44123
44123
|
--api-key <key> API key
|
|
44124
44124
|
--user-id <id> Admin HTTP impersonation; requires --no-watch
|
|
44125
44125
|
--inspect, -i <todo-id>[@<slice>] Print chat log (read-only)
|
|
44126
|
-
--template, -t <id> Start from a registry template
|
|
44127
|
-
--input <key=value> Template input (repeatable)
|
|
44126
|
+
--template, -t <id> Start from a registry template (alias: start <id>)
|
|
44128
44127
|
--resume, -r [todo-id] Resume existing todo
|
|
44129
44128
|
--continue, -c Continue most recent todo
|
|
44130
44129
|
--non-interactive, -n Run to completion and exit without interactive prompt
|
|
@@ -44181,7 +44180,6 @@ function parseCliArgs() {
|
|
|
44181
44180
|
"user-id": { type: "string" },
|
|
44182
44181
|
inspect: { type: "string", short: "i" },
|
|
44183
44182
|
template: { type: "string", short: "t" },
|
|
44184
|
-
input: { type: "string", multiple: true },
|
|
44185
44183
|
note: { type: "string" },
|
|
44186
44184
|
priority: { type: "string" },
|
|
44187
44185
|
title: { type: "string" },
|
|
@@ -44217,9 +44215,6 @@ function parseCliArgs() {
|
|
|
44217
44215
|
return { values, positionals };
|
|
44218
44216
|
}
|
|
44219
44217
|
|
|
44220
|
-
// src/input.ts
|
|
44221
|
-
import { createInterface } from "readline";
|
|
44222
|
-
|
|
44223
44218
|
// src/colors.ts
|
|
44224
44219
|
var on = !process.env.NO_COLOR && !!process.stdout.isTTY;
|
|
44225
44220
|
var c = (seq) => on ? seq : "";
|
|
@@ -44240,15 +44235,6 @@ var BG_RED_HL = c("\x1B[48;2;100;35;35m");
|
|
|
44240
44235
|
var BG_GREEN_HL = c("\x1B[48;2;35;85;35m");
|
|
44241
44236
|
|
|
44242
44237
|
// src/input.ts
|
|
44243
|
-
function readLine(prompt) {
|
|
44244
|
-
const rl = createInterface({ input: process.stdin, output: process.stderr });
|
|
44245
|
-
return new Promise((res) => {
|
|
44246
|
-
rl.question(prompt, (ans) => {
|
|
44247
|
-
rl.close();
|
|
44248
|
-
res(ans.trim());
|
|
44249
|
-
});
|
|
44250
|
-
});
|
|
44251
|
-
}
|
|
44252
44238
|
function readMultiline(prompt, history) {
|
|
44253
44239
|
let cancelFn = () => {};
|
|
44254
44240
|
const promise = new Promise((resolve, reject) => {
|
|
@@ -45320,7 +45306,7 @@ ${label}${ts}
|
|
|
45320
45306
|
}
|
|
45321
45307
|
|
|
45322
45308
|
// src/select.ts
|
|
45323
|
-
import { createInterface
|
|
45309
|
+
import { createInterface } from "readline";
|
|
45324
45310
|
function getDisplayName(item) {
|
|
45325
45311
|
if (item?.project?.name)
|
|
45326
45312
|
return item.project.name;
|
|
@@ -45354,7 +45340,7 @@ function resolveAgentMatch(agents, query) {
|
|
|
45354
45340
|
return {};
|
|
45355
45341
|
}
|
|
45356
45342
|
function terminalLine(prompt) {
|
|
45357
|
-
const rl =
|
|
45343
|
+
const rl = createInterface({ input: process.stdin, output: process.stderr });
|
|
45358
45344
|
return new Promise((resolve3) => {
|
|
45359
45345
|
rl.question(prompt, (answer) => {
|
|
45360
45346
|
rl.close();
|
|
@@ -46580,6 +46566,15 @@ Cancelled by user (Ctrl+C)
|
|
|
46580
46566
|
process.exit(130);
|
|
46581
46567
|
});
|
|
46582
46568
|
const { values: args, positionals } = parseCliArgs();
|
|
46569
|
+
if (positionals[0] === "start") {
|
|
46570
|
+
if (!positionals[1] && !args.template) {
|
|
46571
|
+
process.stderr.write(`${RED}Usage: todoforai-cli start <todo-id>${RESET}
|
|
46572
|
+
`);
|
|
46573
|
+
process.exit(2);
|
|
46574
|
+
}
|
|
46575
|
+
if (!args.template)
|
|
46576
|
+
args.template = positionals[1];
|
|
46577
|
+
}
|
|
46583
46578
|
if (args.version) {
|
|
46584
46579
|
console.log(VERSION);
|
|
46585
46580
|
process.exit(0);
|
|
@@ -46769,7 +46764,7 @@ Cancelled by user (Ctrl+C)
|
|
|
46769
46764
|
}
|
|
46770
46765
|
const rec = await api.recommend({
|
|
46771
46766
|
projectId: projectId2,
|
|
46772
|
-
templateId,
|
|
46767
|
+
specId: templateId,
|
|
46773
46768
|
...args.title ? { title: args.title } : {},
|
|
46774
46769
|
...args.note ? { note: args.note } : {},
|
|
46775
46770
|
...priority ? { priority } : {},
|
|
@@ -46921,36 +46916,12 @@ Cancelled by user (Ctrl+C)
|
|
|
46921
46916
|
if (!args["no-bridge"] && !args["no-watch"])
|
|
46922
46917
|
ensureBridgeRunning(apiUrl, apiKey);
|
|
46923
46918
|
const templateId = args.template;
|
|
46924
|
-
const
|
|
46925
|
-
|
|
46926
|
-
const eq = kv.indexOf("=");
|
|
46927
|
-
if (eq > 0)
|
|
46928
|
-
inputValues[kv.slice(0, eq)] = kv.slice(eq + 1);
|
|
46929
|
-
}
|
|
46930
|
-
const template = await api.getRegistryTemplate(templateId);
|
|
46931
|
-
process.stderr.write(`${DIM}Template:${RESET} ${BRAND}${template.todoname}${RESET}
|
|
46919
|
+
const spec = await api.getRegistrySpec(templateId);
|
|
46920
|
+
process.stderr.write(`${DIM}Template:${RESET} ${BRAND}${spec.name}${RESET}
|
|
46932
46921
|
`);
|
|
46933
|
-
if (
|
|
46934
|
-
process.stderr.write(`${DIM}${
|
|
46922
|
+
if (spec.description)
|
|
46923
|
+
process.stderr.write(`${DIM}${spec.description}${RESET}
|
|
46935
46924
|
`);
|
|
46936
|
-
const templateInputs = template.inputs || [];
|
|
46937
|
-
if (templateInputs.length && !args["non-interactive"]) {
|
|
46938
|
-
for (const inp of templateInputs) {
|
|
46939
|
-
const key = inp.label.toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/_+$/, "");
|
|
46940
|
-
if (inputValues[key])
|
|
46941
|
-
continue;
|
|
46942
|
-
const req = inp.required ? ` ${RED}*${RESET}` : "";
|
|
46943
|
-
const hint = inp.placeholder ? ` ${DIM}(${inp.placeholder.split(`
|
|
46944
|
-
`)[0]})${RESET}` : "";
|
|
46945
|
-
const val = await readLine(`${inp.label}${req}${hint}: `);
|
|
46946
|
-
if (val)
|
|
46947
|
-
inputValues[key] = val;
|
|
46948
|
-
}
|
|
46949
|
-
}
|
|
46950
|
-
if (Object.keys(inputValues).length) {
|
|
46951
|
-
process.stderr.write(`${DIM}Inputs:${RESET} ${JSON.stringify(inputValues)}
|
|
46952
|
-
`);
|
|
46953
|
-
}
|
|
46954
46925
|
const projects2 = await api.listProjects();
|
|
46955
46926
|
let projectId2 = args.project;
|
|
46956
46927
|
if (!projectId2) {
|
|
@@ -46961,7 +46932,7 @@ Cancelled by user (Ctrl+C)
|
|
|
46961
46932
|
`);
|
|
46962
46933
|
process.exit(1);
|
|
46963
46934
|
}
|
|
46964
|
-
const todo2 = await api.
|
|
46935
|
+
const todo2 = await api.startFromSpec(projectId2, templateId);
|
|
46965
46936
|
const todoId = todo2.id;
|
|
46966
46937
|
cfgScope.setLastTodoId(todoId);
|
|
46967
46938
|
const frontendUrl2 = getFrontendUrl(apiUrl, projectId2, todoId);
|