@getpochi/cli 0.5.72 → 0.5.74

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 +20 -13
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -402452,7 +402452,7 @@ var {
402452
402452
  // package.json
402453
402453
  var package_default = {
402454
402454
  name: "@getpochi/cli",
402455
- version: "0.5.72",
402455
+ version: "0.5.74",
402456
402456
  type: "module",
402457
402457
  bin: {
402458
402458
  pochi: "src/cli.ts"
@@ -404028,12 +404028,12 @@ import * as fs3 from "node:fs/promises";
404028
404028
  import * as path4 from "node:path";
404029
404029
  var logger11 = getLogger("ignoreWalk");
404030
404030
  var MaxScanItems = 1e4;
404031
- async function attemptLoadIgnoreFromPath(directoryPath) {
404031
+ async function attemptLoadIgnoreFile(directoryPath, filename) {
404032
404032
  try {
404033
- const gitignoreUri = path4.join(directoryPath, ".gitignore");
404034
- const gitignoreContentBytes = await fs3.readFile(gitignoreUri);
404035
- const gitignoreContent = Buffer.from(gitignoreContentBytes).toString("utf8");
404036
- return gitignoreContent.split(/\r?\n/).map((rule) => rule.trim()).filter((rule) => rule && !rule.startsWith("#"));
404033
+ const ignoreFileUri = path4.join(directoryPath, filename);
404034
+ const ignoreFileContentBytes = await fs3.readFile(ignoreFileUri);
404035
+ const ignoreFileContent = Buffer.from(ignoreFileContentBytes).toString("utf8");
404036
+ return ignoreFileContent.split(/\r?\n/).map((rule) => rule.trim()).filter((rule) => rule && !rule.startsWith("#"));
404037
404037
  } catch (e2) {
404038
404038
  return [];
404039
404039
  }
@@ -404042,7 +404042,8 @@ async function processDirectoryEntry(entry, currentUri, rootDir, directoryIg, re
404042
404042
  const fullPath = path4.join(currentUri, entry.name);
404043
404043
  const relativePath = path4.relative(rootDir, fullPath);
404044
404044
  const normalizedPath = relativePath.replace(/\\/g, "/");
404045
- if (directoryIg.ignores(normalizedPath)) {
404045
+ const pathToTest = entry.isDirectory() ? `${normalizedPath}/` : normalizedPath;
404046
+ if (directoryIg.ignores(pathToTest)) {
404046
404047
  return false;
404047
404048
  }
404048
404049
  if (entry.isDirectory()) {
@@ -404067,7 +404068,8 @@ async function ignoreWalk({
404067
404068
  dir: dir2,
404068
404069
  recursive = true,
404069
404070
  abortSignal,
404070
- useGitignore = true
404071
+ useGitignore = true,
404072
+ usePochiignore = true
404071
404073
  }) {
404072
404074
  const scannedFileResults = [];
404073
404075
  const processedDirs = new Set;
@@ -404088,8 +404090,12 @@ async function ignoreWalk({
404088
404090
  }
404089
404091
  processedDirs.add(currentFsPath);
404090
404092
  try {
404091
- const newRules = useGitignore ? await attemptLoadIgnoreFromPath(currentFsPath) : [];
404092
- const directoryIg = newRules.length > 0 ? import_ignore.default().add(currentIg).add(newRules) : currentIg;
404093
+ let directoryIg = currentIg;
404094
+ const gitIgnoreRules = useGitignore ? await attemptLoadIgnoreFile(currentFsPath, ".gitignore") : [];
404095
+ const pochiIgnoreRules = usePochiignore ? await attemptLoadIgnoreFile(currentFsPath, ".pochiignore") : [];
404096
+ if (gitIgnoreRules.length > 0 || pochiIgnoreRules.length > 0) {
404097
+ directoryIg = currentIg.add(gitIgnoreRules).add(pochiIgnoreRules);
404098
+ }
404093
404099
  const entries4 = await fs3.readdir(currentFsPath, { withFileTypes: true });
404094
404100
  for (const entry of entries4) {
404095
404101
  if (abortSignal?.aborted) {
@@ -404226,7 +404232,8 @@ async function listFiles2(options4) {
404226
404232
  dir: dir2,
404227
404233
  recursive: !!recursive,
404228
404234
  abortSignal,
404229
- useGitignore: false
404235
+ useGitignore: false,
404236
+ usePochiignore: false
404230
404237
  });
404231
404238
  const isTruncated = fileResults.length > MaxListFileItems;
404232
404239
  const files = fileResults.slice(0, MaxListFileItems).map((x) => path6.relative(cwd, x.filepath));
@@ -414272,7 +414279,7 @@ var logger15 = getLogger("loadAgents");
414272
414279
  async function readAgentsFromDir(dir2) {
414273
414280
  const agents = [];
414274
414281
  try {
414275
- if (!isFileExists(dir2)) {
414282
+ if (!await isFileExists(dir2)) {
414276
414283
  return agents;
414277
414284
  }
414278
414285
  const files = await fs5.readdir(dir2);
@@ -445324,7 +445331,7 @@ async function ensureOutputSchema(taskId, model2, schema7, content3) {
445324
445331
  `),
445325
445332
  maxRetries: 0
445326
445333
  });
445327
- return JSON.stringify(object4);
445334
+ return JSON.stringify(object4, null, 2);
445328
445335
  } catch (err2) {
445329
445336
  return content3;
445330
445337
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getpochi/cli",
3
- "version": "0.5.72",
3
+ "version": "0.5.74",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "pochi": "dist/cli.js"