@getpochi/cli 0.5.29 → 0.5.30

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 +43 -26
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -352525,7 +352525,7 @@ var {
352525
352525
  // package.json
352526
352526
  var package_default = {
352527
352527
  name: "@getpochi/cli",
352528
- version: "0.5.29",
352528
+ version: "0.5.30",
352529
352529
  type: "module",
352530
352530
  bin: {
352531
352531
  pochi: "src/cli.ts"
@@ -364336,7 +364336,6 @@ var binary_to_base58_default = binary_to_base58;
364336
364336
  var StoreId = v4_default.object({
364337
364337
  sub: v4_default.string(),
364338
364338
  machineId: v4_default.string(),
364339
- cwd: v4_default.string(),
364340
364339
  date: v4_default.string().describe("Local date in MM/DD/YYYY format")
364341
364340
  });
364342
364341
  function encodeStoreId(storeId) {
@@ -364353,7 +364352,6 @@ __export(exports_livestore, {
364353
364352
  });
364354
364353
 
364355
364354
  // ../../node_modules/@livestore/livestore/dist/mod.js
364356
- init_dist2();
364357
364355
  init_mod8();
364358
364356
  init_effect();
364359
364357
 
@@ -366108,6 +366106,7 @@ var tables = {
366108
366106
  columns: {
366109
366107
  id: exports_mod4.SQLite.text({ primaryKey: true }),
366110
366108
  shareId: exports_mod4.SQLite.text({ nullable: true }),
366109
+ cwd: exports_mod4.SQLite.text({ nullable: true }),
366111
366110
  isPublicShared: exports_mod4.SQLite.boolean({ default: false }),
366112
366111
  title: exports_mod4.SQLite.text({ nullable: true }),
366113
366112
  parentId: exports_mod4.SQLite.text({ nullable: true }),
@@ -366137,6 +366136,10 @@ var tables = {
366137
366136
  name: "idx-shareId",
366138
366137
  columns: ["shareId"],
366139
366138
  isUnique: true
366139
+ },
366140
+ {
366141
+ name: "idx-cwd",
366142
+ columns: ["cwd"]
366140
366143
  }
366141
366144
  ]
366142
366145
  }),
@@ -366161,6 +366164,7 @@ var events = {
366161
366164
  schema: exports_Schema2.Struct({
366162
366165
  id: exports_Schema2.String,
366163
366166
  parentId: exports_Schema2.optional(exports_Schema2.String),
366167
+ cwd: exports_Schema2.optional(exports_Schema2.String),
366164
366168
  createdAt: exports_Schema2.Date,
366165
366169
  initMessage: exports_Schema2.optional(exports_Schema2.Struct({
366166
366170
  id: exports_Schema2.String,
@@ -366224,12 +366228,13 @@ var events = {
366224
366228
  })
366225
366229
  };
366226
366230
  var materializers2 = exports_mod4.SQLite.materializers(events, {
366227
- "v1.TaskInited": ({ id: id4, parentId, createdAt, initMessage }) => [
366231
+ "v1.TaskInited": ({ id: id4, parentId, createdAt, cwd, initMessage }) => [
366228
366232
  tables.tasks.insert({
366229
366233
  id: id4,
366230
366234
  status: initMessage ? "pending-model" : "pending-input",
366231
366235
  parentId,
366232
366236
  createdAt,
366237
+ cwd,
366233
366238
  updatedAt: createdAt
366234
366239
  }),
366235
366240
  ...initMessage ? [
@@ -366294,7 +366299,7 @@ var schema6 = makeSchema({ events, state });
366294
366299
  // ../livekit/src/livestore/queries.ts
366295
366300
  var exports_queries = {};
366296
366301
  __export(exports_queries, {
366297
- tasks$: () => tasks$,
366302
+ makeTasksQuery: () => makeTasksQuery,
366298
366303
  makeTaskQuery: () => makeTaskQuery,
366299
366304
  makeSubTaskQuery: () => makeSubTaskQuery,
366300
366305
  makeMessagesQuery: () => makeMessagesQuery
@@ -366307,11 +366312,12 @@ var makeMessagesQuery = (taskId) => queryDb(() => tables.messages.where("taskId"
366307
366312
  label: "messages",
366308
366313
  deps: [taskId]
366309
366314
  });
366310
- var tasks$ = queryDb({
366311
- query: sql`select * from tasks where parentId is null order by updatedAt desc`,
366312
- schema: exports_Schema2.Array(tables.tasks.rowSchema)
366315
+ var makeTasksQuery = (cwd) => queryDb(() => {
366316
+ const q = tables.tasks.where("parentId", "=", null).orderBy("updatedAt", "desc");
366317
+ return cwd ? q.where("cwd", "=", cwd) : q;
366313
366318
  }, {
366314
- label: "tasks"
366319
+ label: "tasks",
366320
+ deps: [cwd]
366315
366321
  });
366316
366322
  var makeSubTaskQuery = (taskId) => queryDb(() => tables.tasks.where("parentId", "=", taskId), {
366317
366323
  label: "subTasks",
@@ -374091,9 +374097,9 @@ var makeWsSync = (options4) => ({ storeId, payload }) => exports_Effect2.gen(fun
374091
374097
 
374092
374098
  // src/livekit/store.ts
374093
374099
  var import_node_machine_id = __toESM(require_dist3(), 1);
374094
- async function createStore3(cwd2) {
374100
+ async function createStore3() {
374095
374101
  const { jwt: jwt2 = null } = await getPochiCredentials2() || {};
374096
- const storeId = await getStoreId(jwt2, cwd2);
374102
+ const storeId = await getStoreId(jwt2);
374097
374103
  const adapter4 = makeAdapter({
374098
374104
  storage: {
374099
374105
  type: "fs",
@@ -374123,10 +374129,10 @@ async function getPochiCredentials2() {
374123
374129
  const credentials = await pochi.getCredentials().catch(() => null);
374124
374130
  return credentials;
374125
374131
  }
374126
- async function getStoreId(jwt2, cwd2) {
374132
+ async function getStoreId(jwt2) {
374127
374133
  const sub = (jwt2 ? decodeJwt(jwt2).sub : undefined) ?? "anonymous";
374128
374134
  const date8 = new Date().toLocaleDateString("en-US");
374129
- return encodeStoreId({ sub, machineId: await import_node_machine_id.machineId(), cwd: cwd2, date: date8 });
374135
+ return encodeStoreId({ sub, machineId: await import_node_machine_id.machineId(), date: date8 });
374130
374136
  }
374131
374137
 
374132
374138
  // src/mcp/list.ts
@@ -387721,9 +387727,9 @@ init_effect();
387721
387727
  import os10 from "node:os";
387722
387728
  import path21 from "node:path";
387723
387729
  var import_node_machine_id2 = __toESM(require_dist3(), 1);
387724
- async function createStore4(cwd2) {
387730
+ async function createStore4() {
387725
387731
  const { jwt: jwt2 = null } = await getPochiCredentials3() || {};
387726
- const storeId = await getStoreId2(jwt2, cwd2);
387732
+ const storeId = await getStoreId2(jwt2);
387727
387733
  const adapter4 = makeAdapter({
387728
387734
  storage: {
387729
387735
  type: "fs",
@@ -387753,10 +387759,10 @@ async function getPochiCredentials3() {
387753
387759
  const credentials = await pochi.getCredentials().catch(() => null);
387754
387760
  return credentials;
387755
387761
  }
387756
- async function getStoreId2(jwt2, cwd2) {
387762
+ async function getStoreId2(jwt2) {
387757
387763
  const sub = (jwt2 ? decodeJwt(jwt2).sub : undefined) ?? "anonymous";
387758
387764
  const date8 = new Date().toLocaleDateString("en-US");
387759
- return encodeStoreId({ sub, machineId: await import_node_machine_id2.machineId(), cwd: cwd2, date: date8 });
387765
+ return encodeStoreId({ sub, machineId: await import_node_machine_id2.machineId(), date: date8 });
387760
387766
  }
387761
387767
  // src/livekit/chat.node.ts
387762
387768
  class NodeChatState {
@@ -387843,9 +387849,9 @@ function registerTaskListCommand(taskCommand) {
387843
387849
  if (Number.isNaN(limit) || limit <= 0) {
387844
387850
  return taskCommand.error("Limit must be a positive number");
387845
387851
  }
387846
- const store = await createStore4(process.cwd());
387852
+ const store = await createStore4();
387847
387853
  try {
387848
- const allTasks = store.query(exports_livestore.queries.tasks$);
387854
+ const allTasks = store.query(exports_livestore.queries.makeTasksQuery(process.cwd()));
387849
387855
  const sortedTasks = [...allTasks].sort((a11, b10) => b10.updatedAt.getTime() - a11.updatedAt.getTime());
387850
387856
  const tasks = sortedTasks.slice(0, limit);
387851
387857
  if (tasks.length === 0) {
@@ -387961,7 +387967,7 @@ function clipTitle(title, maxLength2) {
387961
387967
  // src/task/share.ts
387962
387968
  function registerTaskShareCommand(taskCommand) {
387963
387969
  taskCommand.command("get-share-url").description("Get the shareable URL for a specific task by its ID.").argument("<task-id>", "The ID of the task to get the share URL for.").action(async (taskId) => {
387964
- const store = await createStore4(process.cwd());
387970
+ const store = await createStore4();
387965
387971
  const { shareId } = store.query(exports_livestore.queries.makeTaskQuery(taskId)) || {};
387966
387972
  if (shareId) {
387967
387973
  const shareUrl = `https://app.getpochi.com/share/${shareId}`;
@@ -387982,7 +387988,7 @@ function registerTaskCommand(program5) {
387982
387988
  return taskCommand;
387983
387989
  }
387984
387990
  async function waitForSync() {
387985
- const store = await createStore4(process.cwd());
387991
+ const store = await createStore4();
387986
387992
  await exports_Effect2.gen(function* (_8) {
387987
387993
  while (true) {
387988
387994
  const nextChange = store.syncProcessor.syncState.changes.pipe(exports_Stream2.take(1), exports_Stream2.runCollect, exports_Effect2.as(false));
@@ -388448,7 +388454,7 @@ function createReasoningMiddleware(tag9 = "think") {
388448
388454
  };
388449
388455
  }
388450
388456
  // ../livekit/src/chat/middlewares/new-task-middleware.ts
388451
- function createNewTaskMiddleware(store, parentTaskId, customAgents) {
388457
+ function createNewTaskMiddleware(store, cwd2, parentTaskId, customAgents) {
388452
388458
  return {
388453
388459
  middlewareVersion: "v2",
388454
388460
  transformParams: async ({ params: params2 }) => {
@@ -388508,6 +388514,7 @@ function createNewTaskMiddleware(store, parentTaskId, customAgents) {
388508
388514
  };
388509
388515
  store.commit(events.taskInited({
388510
388516
  id: uid,
388517
+ cwd: cwd2,
388511
388518
  parentId: parentTaskId,
388512
388519
  createdAt: new Date,
388513
388520
  initMessage: {
@@ -390269,6 +390276,7 @@ class FlexibleChatTransport {
390269
390276
  isCli;
390270
390277
  store;
390271
390278
  customAgent;
390279
+ cwd;
390272
390280
  constructor(options4) {
390273
390281
  this.onStart = options4.onStart;
390274
390282
  this.getters = options4.getters;
@@ -390276,6 +390284,7 @@ class FlexibleChatTransport {
390276
390284
  this.isCli = options4.isCli;
390277
390285
  this.store = options4.store;
390278
390286
  this.customAgent = overrideCustomAgentTools(options4.customAgent);
390287
+ this.cwd = options4.cwd;
390279
390288
  }
390280
390289
  sendMessages = async ({
390281
390290
  chatId,
@@ -390294,7 +390303,7 @@ class FlexibleChatTransport {
390294
390303
  });
390295
390304
  const middlewares = [];
390296
390305
  if (!this.isSubTask) {
390297
- middlewares.push(createNewTaskMiddleware(this.store, chatId, customAgents));
390306
+ middlewares.push(createNewTaskMiddleware(this.store, this.cwd, chatId, customAgents));
390298
390307
  }
390299
390308
  if ("modelId" in llm && isWellKnownReasoningModel(llm.modelId)) {
390300
390309
  middlewares.push(createReasoningMiddleware());
@@ -390393,9 +390402,11 @@ class LiveChatKit {
390393
390402
  store;
390394
390403
  chat;
390395
390404
  transport;
390405
+ cwd;
390396
390406
  spawn;
390397
390407
  constructor({
390398
390408
  taskId,
390409
+ cwd: cwd2,
390399
390410
  abortSignal,
390400
390411
  store,
390401
390412
  chatClass,
@@ -390407,6 +390418,7 @@ class LiveChatKit {
390407
390418
  ...chatInit
390408
390419
  }) {
390409
390420
  this.taskId = taskId;
390421
+ this.cwd = cwd2;
390410
390422
  this.store = store;
390411
390423
  this.transport = new FlexibleChatTransport({
390412
390424
  store,
@@ -390414,7 +390426,8 @@ class LiveChatKit {
390414
390426
  getters,
390415
390427
  isSubTask,
390416
390428
  isCli,
390417
- customAgent
390429
+ customAgent,
390430
+ cwd: cwd2
390418
390431
  });
390419
390432
  this.chat = new chatClass({
390420
390433
  ...chatInit,
@@ -390464,6 +390477,7 @@ class LiveChatKit {
390464
390477
  }
390465
390478
  this.store.commit(events.taskInited({
390466
390479
  id: taskId2,
390480
+ cwd: this.cwd,
390467
390481
  createdAt: new Date,
390468
390482
  initMessage: {
390469
390483
  id: crypto.randomUUID(),
@@ -390485,6 +390499,7 @@ class LiveChatKit {
390485
390499
  init(prompt) {
390486
390500
  this.store.commit(events.taskInited({
390487
390501
  id: this.taskId,
390502
+ cwd: this.cwd,
390488
390503
  createdAt: new Date,
390489
390504
  initMessage: {
390490
390505
  id: crypto.randomUUID(),
@@ -390526,6 +390541,7 @@ class LiveChatKit {
390526
390541
  if (!this.inited) {
390527
390542
  store.commit(events.taskInited({
390528
390543
  id: this.taskId,
390544
+ cwd: this.cwd,
390529
390545
  createdAt: new Date
390530
390546
  }));
390531
390547
  }
@@ -391168,6 +391184,7 @@ class TaskRunner {
391168
391184
  this.stepCount = new StepCount(options4.maxSteps, options4.maxRetries);
391169
391185
  this.chatKit = new LiveChatKit({
391170
391186
  taskId: options4.uid,
391187
+ cwd: options4.cwd,
391171
391188
  store: options4.store,
391172
391189
  chatClass: Chat,
391173
391190
  isCli: true,
@@ -391525,7 +391542,7 @@ async function downloadAndInstall(program5, release2) {
391525
391542
  // package.json
391526
391543
  var package_default2 = {
391527
391544
  name: "@getpochi/cli",
391528
- version: "0.5.29",
391545
+ version: "0.5.30",
391529
391546
  type: "module",
391530
391547
  bin: {
391531
391548
  pochi: "src/cli.ts"
@@ -391655,7 +391672,7 @@ var parsePositiveInt = (input2) => {
391655
391672
  };
391656
391673
  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 (options4) => {
391657
391674
  const { uid, prompt } = await parseTaskInput(options4, program5);
391658
- const store = await createStore3(process.cwd());
391675
+ const store = await createStore3();
391659
391676
  const llm = await createLLMConfig(program5, options4);
391660
391677
  const rg2 = findRipgrep();
391661
391678
  if (!rg2) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpochi/cli",
3
- "version": "0.5.29",
3
+ "version": "0.5.30",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "pochi": "dist/cli.js"