orquesta-cli 0.2.43 → 0.2.44

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.
@@ -25,12 +25,33 @@ export function insertFilePaths(input, atPosition, filterLength, filePaths) {
25
25
  }
26
26
  }
27
27
  export function extractFileReferences(input) {
28
- const regex = /@([^\s@]+)/g;
29
28
  const matches = [];
29
+ const seen = new Set();
30
+ const atRegex = /@([^\s@]+)/g;
30
31
  let match;
31
- while ((match = regex.exec(input)) !== null) {
32
+ while ((match = atRegex.exec(input)) !== null) {
32
33
  const filePath = match[1];
33
34
  if (filePath && filePath.length > 1 && (filePath.includes('/') || filePath.includes('.'))) {
35
+ if (!seen.has(filePath)) {
36
+ seen.add(filePath);
37
+ matches.push(filePath);
38
+ }
39
+ }
40
+ }
41
+ const KNOWN_EXTS = /\.(png|jpg|jpeg|gif|webp|bmp|pdf|csv|tsv|json|yaml|yml|xml|txt|md|ts|tsx|js|jsx|py|go|rs|java|kt|swift|sql|sh|toml|html|css|svg)$/i;
42
+ const quotedRegex = /['"]([^'"]+\.[a-z]{2,5})['"]/gi;
43
+ while ((match = quotedRegex.exec(input)) !== null) {
44
+ const filePath = match[1];
45
+ if (filePath && KNOWN_EXTS.test(filePath) && !seen.has(filePath)) {
46
+ seen.add(filePath);
47
+ matches.push(filePath);
48
+ }
49
+ }
50
+ const absRegex = /(?:^|\s)(\/[^\s'"]+\.[a-z]{2,5})(?:\s|$)/gi;
51
+ while ((match = absRegex.exec(input)) !== null) {
52
+ const filePath = match[1];
53
+ if (filePath && KNOWN_EXTS.test(filePath) && !seen.has(filePath)) {
54
+ seen.add(filePath);
34
55
  matches.push(filePath);
35
56
  }
36
57
  }
@@ -57,7 +78,7 @@ export async function processFileReferences(input) {
57
78
  for (const filePath of fileRefs) {
58
79
  try {
59
80
  const resolvedPath = path.resolve(process.cwd(), filePath);
60
- if (!resolvedPath.startsWith(process.cwd())) {
81
+ if (filePath.includes('..') && !resolvedPath.startsWith(process.cwd())) {
61
82
  failedFiles.push(filePath);
62
83
  continue;
63
84
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "orquesta-cli",
3
- "version": "0.2.43",
3
+ "version": "0.2.44",
4
4
  "description": "Orquesta CLI - AI-powered coding assistant with team collaboration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",