@getpochi/cli 0.5.52 → 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.
Files changed (2) hide show
  1. package/dist/cli.js +45 -18
  2. 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.52",
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();
@@ -395922,16 +395940,16 @@ var import_node_machine_id = __toESM(require_dist3(), 1);
395922
395940
  async function createStore3() {
395923
395941
  const { jwt: jwt2 = null } = await getPochiCredentials2() || {};
395924
395942
  const storeId = await getStoreId(jwt2);
395925
- const disableSync = !!process.env.POCHI_LIVEKIT_NO_SYNC;
395943
+ const enableSync = !!process.env.POCHI_LIVEKIT_SYNC_ON;
395926
395944
  const adapter4 = makeAdapter({
395927
- storage: disableSync ? { type: "in-memory" } : {
395945
+ storage: enableSync ? {
395928
395946
  type: "fs",
395929
395947
  baseDirectory: path24.join(os9.homedir(), ".pochi", "storage")
395930
- },
395948
+ } : { type: "in-memory" },
395931
395949
  devtools: process.env.POCHI_LIVEKIT_DEVTOOLS ? {
395932
395950
  schemaPath: "../../packages/livekit/src/livestore/schema.ts"
395933
395951
  } : undefined,
395934
- sync: jwt2 && !disableSync ? {
395952
+ sync: jwt2 && enableSync ? {
395935
395953
  backend: makeWsSync({
395936
395954
  url: getSyncBaseUrl()
395937
395955
  })
@@ -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
- console.log("");
409327
+ console4.log("");
409305
409328
  }
409306
- console.log(source_default.bold(source_default.underline(name17)));
409329
+ console4.log(source_default.bold(source_default.underline(name17)));
409307
409330
  this.nextSpinner();
409308
409331
  }
409309
409332
  while (true) {
@@ -409705,6 +409728,9 @@ function registerTaskShareCommand(taskCommand) {
409705
409728
 
409706
409729
  // src/task/cmd.ts
409707
409730
  function registerTaskCommand(program5) {
409731
+ const enableSync = !!process.env.POCHI_LIVEKIT_SYNC_ON;
409732
+ if (!enableSync)
409733
+ return;
409708
409734
  const taskCommand = program5.command("task").description("Manage and interact with tasks.").addHelpCommand(true);
409709
409735
  registerTaskListCommand(taskCommand);
409710
409736
  registerTaskShareCommand(taskCommand);
@@ -412278,6 +412304,9 @@ async function downloadAndInstall(program5, release3) {
412278
412304
  }
412279
412305
  }
412280
412306
 
412307
+ // src/upgrade/version-check.ts
412308
+ import { Console as Console2 } from "node:console";
412309
+
412281
412310
  // src/upgrade/release-fetcher.ts
412282
412311
  var GITHUB_REPO = "TabbyML/pochi";
412283
412312
  function filterCliReleases(releases) {
@@ -412300,6 +412329,7 @@ async function fetchLatestCliRelease() {
412300
412329
  }
412301
412330
 
412302
412331
  // src/upgrade/version-check.ts
412332
+ var console5 = new Console2(process.stderr);
412303
412333
  async function returnVersionInfo(options6) {
412304
412334
  const { timeoutMs } = options6 ?? {};
412305
412335
  const latestReleasePromise = fetchLatestCliRelease();
@@ -412316,14 +412346,14 @@ async function returnVersionInfo(options6) {
412316
412346
  };
412317
412347
  }
412318
412348
  async function checkForUpdates() {
412319
- const { updateAvailable, currentVersion, latestVersion } = await returnVersionInfo({ timeoutMs: 300 });
412349
+ const { updateAvailable, currentVersion, latestVersion } = await returnVersionInfo({ timeoutMs: 500 });
412320
412350
  const header = `
412321
412351
  ${source_default.bold("Pochi")} ${source_default.white(currentVersion)}`;
412322
412352
  if (updateAvailable) {
412323
- console.log(`${header} ${source_default.dim("(update available")} ${source_default.green(latestVersion)}${source_default.dim(")")}`);
412353
+ console5.log(`${header} ${source_default.dim("(update available")} ${source_default.green(latestVersion)}${source_default.dim(")")}`);
412324
412354
  const columns = process.stdout.columns || 80;
412325
412355
  const width3 = Math.max(Math.min(columns, 100), 20);
412326
- console.log(source_default.yellow("─".repeat(width3)));
412356
+ console5.log(source_default.yellow("─".repeat(width3)));
412327
412357
  }
412328
412358
  }
412329
412359
 
@@ -412364,7 +412394,7 @@ var parsePositiveInt = (input2) => {
412364
412394
  }
412365
412395
  return result2;
412366
412396
  };
412367
- 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) => {
412368
412398
  const { uid, prompt: prompt3 } = await parseTaskInput(options6, program5);
412369
412399
  const store = await createStore3();
412370
412400
  const llm = await createLLMConfig(program5, options6);
@@ -412391,15 +412421,9 @@ var program5 = new Command().name("pochi").description(`${source_default.bold("P
412391
412421
  customAgents,
412392
412422
  mcpHub
412393
412423
  });
412394
- const renderer = new OutputRenderer(runner.state);
412424
+ const renderer = options6.streamJson ? new JsonRenderer(runner.state) : new OutputRenderer(runner.state);
412395
412425
  await runner.run();
412396
412426
  renderer.shutdown();
412397
- const shareId = runner.shareId;
412398
- if (shareId) {
412399
- const shareUrl = source_default.underline(`https://app.getpochi.com/share/${shareId}`);
412400
- console.log(`
412401
- ${source_default.bold("Task link: ")} ${shareUrl}`);
412402
- }
412403
412427
  mcpHub.dispose();
412404
412428
  await waitForSync(store, "2 second").catch(console.error);
412405
412429
  await shutdownStoreAndExit(store);
@@ -412537,6 +412561,9 @@ async function createLLMConfigWithProviders(program6, model2) {
412537
412561
  assertUnreachable2(modelProvider.kind);
412538
412562
  }
412539
412563
  async function waitForSync(inputStore, timeoutDuration = "1 second") {
412564
+ if (!process.env.POCHI_LIVEKIT_SYNC_ON) {
412565
+ return;
412566
+ }
412540
412567
  const store = inputStore || await createStore3();
412541
412568
  await exports_Effect2.gen(function* (_8) {
412542
412569
  while (true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpochi/cli",
3
- "version": "0.5.52",
3
+ "version": "0.5.54",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "pochi": "dist/cli.js"