@getpochi/cli 0.5.53 → 0.5.54
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 +35 -8
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -368449,7 +368449,7 @@ var {
|
|
|
368449
368449
|
// package.json
|
|
368450
368450
|
var package_default = {
|
|
368451
368451
|
name: "@getpochi/cli",
|
|
368452
|
-
version: "0.5.
|
|
368452
|
+
version: "0.5.54",
|
|
368453
368453
|
type: "module",
|
|
368454
368454
|
bin: {
|
|
368455
368455
|
pochi: "src/cli.ts"
|
|
@@ -386105,6 +386105,24 @@ async function parseWorkflowFrontmatter2(id3) {
|
|
|
386105
386105
|
return parseWorkflowFrontmatter(content3);
|
|
386106
386106
|
}
|
|
386107
386107
|
|
|
386108
|
+
// src/json-renderer.ts
|
|
386109
|
+
class JsonRenderer {
|
|
386110
|
+
state;
|
|
386111
|
+
pendingMessageId = "";
|
|
386112
|
+
constructor(state) {
|
|
386113
|
+
this.state = state;
|
|
386114
|
+
this.state.signal.messages.subscribe((messages) => {
|
|
386115
|
+
const pendingMessageIndex = messages.findIndex((message) => message.id === this.pendingMessageId);
|
|
386116
|
+
const pendingMessages = messages.slice(pendingMessageIndex);
|
|
386117
|
+
for (const message of pendingMessages) {
|
|
386118
|
+
console.log(JSON.stringify(message));
|
|
386119
|
+
}
|
|
386120
|
+
});
|
|
386121
|
+
}
|
|
386122
|
+
shutdown() {}
|
|
386123
|
+
renderSubTask(_task) {}
|
|
386124
|
+
}
|
|
386125
|
+
|
|
386108
386126
|
// src/lib/shutdown.ts
|
|
386109
386127
|
async function shutdownStoreAndExit(store, exitCode2 = 0) {
|
|
386110
386128
|
await store.shutdownPromise();
|
|
@@ -396528,6 +396546,9 @@ function displayProviderModels(providerId, provider) {
|
|
|
396528
396546
|
}
|
|
396529
396547
|
console.log();
|
|
396530
396548
|
}
|
|
396549
|
+
// src/output-renderer.ts
|
|
396550
|
+
import { Console } from "node:console";
|
|
396551
|
+
|
|
396531
396552
|
// ../../node_modules/unist-util-find-after/lib/index.js
|
|
396532
396553
|
var findAfter = function(parent, index3, test3) {
|
|
396533
396554
|
const is6 = convert(test3);
|
|
@@ -409275,6 +409296,8 @@ var Listr = class {
|
|
|
409275
409296
|
};
|
|
409276
409297
|
|
|
409277
409298
|
// src/output-renderer.ts
|
|
409299
|
+
var console4 = new Console(process.stderr);
|
|
409300
|
+
|
|
409278
409301
|
class OutputRenderer {
|
|
409279
409302
|
state;
|
|
409280
409303
|
renderingSubTask = false;
|
|
@@ -409301,9 +409324,9 @@ class OutputRenderer {
|
|
|
409301
409324
|
this.pendingPartIndex = 0;
|
|
409302
409325
|
const name17 = lastMessage.role === "assistant" ? "Pochi" : "You";
|
|
409303
409326
|
if (messages2.length > 1) {
|
|
409304
|
-
|
|
409327
|
+
console4.log("");
|
|
409305
409328
|
}
|
|
409306
|
-
|
|
409329
|
+
console4.log(source_default.bold(source_default.underline(name17)));
|
|
409307
409330
|
this.nextSpinner();
|
|
409308
409331
|
}
|
|
409309
409332
|
while (true) {
|
|
@@ -412281,6 +412304,9 @@ async function downloadAndInstall(program5, release3) {
|
|
|
412281
412304
|
}
|
|
412282
412305
|
}
|
|
412283
412306
|
|
|
412307
|
+
// src/upgrade/version-check.ts
|
|
412308
|
+
import { Console as Console2 } from "node:console";
|
|
412309
|
+
|
|
412284
412310
|
// src/upgrade/release-fetcher.ts
|
|
412285
412311
|
var GITHUB_REPO = "TabbyML/pochi";
|
|
412286
412312
|
function filterCliReleases(releases) {
|
|
@@ -412303,6 +412329,7 @@ async function fetchLatestCliRelease() {
|
|
|
412303
412329
|
}
|
|
412304
412330
|
|
|
412305
412331
|
// src/upgrade/version-check.ts
|
|
412332
|
+
var console5 = new Console2(process.stderr);
|
|
412306
412333
|
async function returnVersionInfo(options6) {
|
|
412307
412334
|
const { timeoutMs } = options6 ?? {};
|
|
412308
412335
|
const latestReleasePromise = fetchLatestCliRelease();
|
|
@@ -412319,14 +412346,14 @@ async function returnVersionInfo(options6) {
|
|
|
412319
412346
|
};
|
|
412320
412347
|
}
|
|
412321
412348
|
async function checkForUpdates() {
|
|
412322
|
-
const { updateAvailable, currentVersion, latestVersion } = await returnVersionInfo({ timeoutMs:
|
|
412349
|
+
const { updateAvailable, currentVersion, latestVersion } = await returnVersionInfo({ timeoutMs: 500 });
|
|
412323
412350
|
const header = `
|
|
412324
412351
|
${source_default.bold("Pochi")} ${source_default.white(currentVersion)}`;
|
|
412325
412352
|
if (updateAvailable) {
|
|
412326
|
-
|
|
412353
|
+
console5.log(`${header} ${source_default.dim("(update available")} ${source_default.green(latestVersion)}${source_default.dim(")")}`);
|
|
412327
412354
|
const columns = process.stdout.columns || 80;
|
|
412328
412355
|
const width3 = Math.max(Math.min(columns, 100), 20);
|
|
412329
|
-
|
|
412356
|
+
console5.log(source_default.yellow("─".repeat(width3)));
|
|
412330
412357
|
}
|
|
412331
412358
|
}
|
|
412332
412359
|
|
|
@@ -412367,7 +412394,7 @@ var parsePositiveInt = (input2) => {
|
|
|
412367
412394
|
}
|
|
412368
412395
|
return result2;
|
|
412369
412396
|
};
|
|
412370
|
-
var program5 = new Command().name("pochi").description(`${source_default.bold("Pochi")} v${package_default.version} - A powerful CLI tool for AI-driven development.`).optionsGroup("Prompt:").option("-p, --prompt <prompt>", "Create a new task with a given prompt. Input can also be piped. For example: `cat my-prompt.md | pochi`. Workflows can be triggered with `/workflow-name`, like `pochi -p /create-pr`.").optionsGroup("Options:").option("--max-steps <number>", "Set the maximum number of steps for a task. The task will stop if it exceeds this limit.", parsePositiveInt, 24).option("--max-retries <number>", "Set the maximum number of retries for a single step in a task.", parsePositiveInt, 3).optionsGroup("Model:").option("-m, --model <model>", "Specify the model to be used for the task.", "qwen/qwen3-coder").action(async (options6) => {
|
|
412397
|
+
var program5 = new Command().name("pochi").description(`${source_default.bold("Pochi")} v${package_default.version} - A powerful CLI tool for AI-driven development.`).optionsGroup("Prompt:").option("-p, --prompt <prompt>", "Create a new task with a given prompt. Input can also be piped. For example: `cat my-prompt.md | pochi`. Workflows can be triggered with `/workflow-name`, like `pochi -p /create-pr`.").optionsGroup("Options:").option("--stream-json", "Stream the output in JSON format. This is useful for parsing the output in scripts.").option("--max-steps <number>", "Set the maximum number of steps for a task. The task will stop if it exceeds this limit.", parsePositiveInt, 24).option("--max-retries <number>", "Set the maximum number of retries for a single step in a task.", parsePositiveInt, 3).optionsGroup("Model:").option("-m, --model <model>", "Specify the model to be used for the task.", "qwen/qwen3-coder").action(async (options6) => {
|
|
412371
412398
|
const { uid, prompt: prompt3 } = await parseTaskInput(options6, program5);
|
|
412372
412399
|
const store = await createStore3();
|
|
412373
412400
|
const llm = await createLLMConfig(program5, options6);
|
|
@@ -412394,7 +412421,7 @@ var program5 = new Command().name("pochi").description(`${source_default.bold("P
|
|
|
412394
412421
|
customAgents,
|
|
412395
412422
|
mcpHub
|
|
412396
412423
|
});
|
|
412397
|
-
const renderer = new OutputRenderer(runner.state);
|
|
412424
|
+
const renderer = options6.streamJson ? new JsonRenderer(runner.state) : new OutputRenderer(runner.state);
|
|
412398
412425
|
await runner.run();
|
|
412399
412426
|
renderer.shutdown();
|
|
412400
412427
|
mcpHub.dispose();
|