@vladimir-ks/aigile 0.2.4 → 0.2.5

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.
@@ -970,12 +970,32 @@ function getFilesWithQualityIssues(sessionId) {
970
970
  );
971
971
  }
972
972
  function getUntaggedFiles(projectId, sessionId, options = {}) {
973
- if (options.assignedOnly && options.chunkId) {
974
- const chunk = getChunk(options.chunkId);
975
- if (!chunk || !chunk.assigned_files) {
973
+ if (options.assignedOnly) {
974
+ let assignedFiles = [];
975
+ if (options.chunkId) {
976
+ const chunk = getChunk(options.chunkId);
977
+ if (chunk?.assigned_files) {
978
+ try {
979
+ assignedFiles = JSON.parse(chunk.assigned_files);
980
+ } catch {
981
+ }
982
+ }
983
+ } else {
984
+ const chunks = getSessionChunks(sessionId);
985
+ for (const chunk of chunks) {
986
+ if (chunk.assigned_files) {
987
+ try {
988
+ const files = JSON.parse(chunk.assigned_files);
989
+ assignedFiles.push(...files);
990
+ } catch {
991
+ }
992
+ }
993
+ }
994
+ assignedFiles = [...new Set(assignedFiles)];
995
+ }
996
+ if (assignedFiles.length === 0) {
976
997
  return [];
977
998
  }
978
- const assignedFiles = JSON.parse(chunk.assigned_files);
979
999
  return queryAll(
980
1000
  `SELECT d.path, d.id as document_id
981
1001
  FROM documents d
@@ -1166,7 +1186,7 @@ var init_connection = __esm({
1166
1186
  import { Command as Command23 } from "commander";
1167
1187
 
1168
1188
  // src/index.ts
1169
- var VERSION = true ? "0.2.4" : "0.0.0-dev";
1189
+ var VERSION = true ? "0.2.5" : "0.0.0-dev";
1170
1190
 
1171
1191
  // src/bin/aigile.ts
1172
1192
  init_connection();