@git.zone/tsdoc 1.9.2 → 1.10.1

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 (35) hide show
  1. package/dist_ts/00_commitinfo_data.js +2 -2
  2. package/dist_ts/aidocs_classes/commit.js +8 -8
  3. package/dist_ts/aidocs_classes/description.js +3 -3
  4. package/dist_ts/aidocs_classes/projectcontext.js +7 -7
  5. package/dist_ts/aidocs_classes/readme.js +4 -4
  6. package/dist_ts/classes.aidoc.js +15 -2
  7. package/dist_ts/classes.typedoc.js +5 -5
  8. package/dist_ts/cli.js +2 -2
  9. package/dist_ts/context/config-manager.js +8 -8
  10. package/dist_ts/context/context-analyzer.js +2 -2
  11. package/dist_ts/context/context-cache.js +5 -5
  12. package/dist_ts/context/diff-processor.js +12 -3
  13. package/dist_ts/context/enhanced-context.js +2 -2
  14. package/dist_ts/context/iterative-context-builder.js +2 -2
  15. package/dist_ts/context/lazy-file-loader.js +26 -8
  16. package/dist_ts/plugins.d.ts +4 -1
  17. package/dist_ts/plugins.js +8 -2
  18. package/package.json +12 -11
  19. package/readme.md +38 -227
  20. package/ts/00_commitinfo_data.ts +1 -1
  21. package/ts/aidocs_classes/commit.ts +7 -7
  22. package/ts/aidocs_classes/description.ts +2 -2
  23. package/ts/aidocs_classes/projectcontext.ts +8 -10
  24. package/ts/aidocs_classes/readme.ts +3 -3
  25. package/ts/classes.aidoc.ts +17 -1
  26. package/ts/classes.typedoc.ts +4 -4
  27. package/ts/cli.ts +1 -1
  28. package/ts/context/config-manager.ts +7 -7
  29. package/ts/context/context-analyzer.ts +1 -1
  30. package/ts/context/context-cache.ts +4 -4
  31. package/ts/context/diff-processor.ts +14 -2
  32. package/ts/context/enhanced-context.ts +1 -1
  33. package/ts/context/iterative-context-builder.ts +1 -1
  34. package/ts/context/lazy-file-loader.ts +23 -7
  35. package/ts/plugins.ts +9 -0
@@ -39,13 +39,13 @@ export class ContextCache {
39
39
  }
40
40
 
41
41
  // Ensure cache directory exists
42
- await plugins.smartfile.fs.ensureDir(this.cacheDir);
42
+ await plugins.fsInstance.directory(this.cacheDir).recursive().create();
43
43
 
44
44
  // Load cache index if it exists
45
45
  try {
46
- const indexExists = await plugins.smartfile.fs.fileExists(this.cacheIndexPath);
46
+ const indexExists = await plugins.fsInstance.file(this.cacheIndexPath).exists();
47
47
  if (indexExists) {
48
- const indexContent = await plugins.smartfile.fs.toStringSync(this.cacheIndexPath);
48
+ const indexContent = await plugins.fsInstance.file(this.cacheIndexPath).encoding('utf8').read() as string;
49
49
  const indexData = JSON.parse(indexContent) as ICacheEntry[];
50
50
  if (Array.isArray(indexData)) {
51
51
  for (const entry of indexData) {
@@ -278,7 +278,7 @@ export class ContextCache {
278
278
  try {
279
279
  const entries = Array.from(this.cache.values());
280
280
  const content = JSON.stringify(entries, null, 2);
281
- await plugins.smartfile.memory.toFs(content, this.cacheIndexPath);
281
+ await plugins.fsInstance.file(this.cacheIndexPath).encoding('utf8').write(content);
282
282
  } catch (error) {
283
283
  console.warn('Failed to persist cache index:', error.message);
284
284
  }
@@ -239,8 +239,20 @@ export class DiffProcessor {
239
239
  return 10;
240
240
  }
241
241
 
242
- // Everything else - default priority
243
- return 50;
242
+ // Start with default priority
243
+ let score = 50;
244
+
245
+ // Boost interface/type files - they're usually small but critical
246
+ if (filepath.includes('interfaces/') || filepath.includes('.types.')) {
247
+ score += 20;
248
+ }
249
+
250
+ // Boost entry points
251
+ if (filepath.endsWith('index.ts') || filepath.endsWith('mod.ts')) {
252
+ score += 15;
253
+ }
254
+
255
+ return score;
244
256
  }
245
257
 
246
258
  /**
@@ -120,7 +120,7 @@ export class EnhancedContext {
120
120
  originalTokenCount = cached.tokenCount;
121
121
  } else {
122
122
  // Load file
123
- const fileData = await plugins.smartfile.fs.toStringSync(fileAnalysis.path);
123
+ const fileData = await plugins.fsInstance.file(fileAnalysis.path).encoding('utf8').read() as string;
124
124
  contents = fileData;
125
125
  originalTokenCount = this.countTokens(contents);
126
126
 
@@ -463,7 +463,7 @@ Do not wrap the JSON in markdown code blocks or add any other text.`,
463
463
  }
464
464
 
465
465
  // Load from disk
466
- const contents = await plugins.smartfile.fs.toStringSync(filePath);
466
+ const contents = await plugins.fsInstance.file(filePath).encoding('utf8').read() as string;
467
467
  const tokenCount = this.countTokens(contents);
468
468
  const relativePath = plugins.path.relative(this.projectRoot, filePath);
469
469
 
@@ -31,16 +31,32 @@ export class LazyFileLoader {
31
31
 
32
32
  for (const globPattern of globs) {
33
33
  try {
34
- const smartFiles = await plugins.smartfile.fs.fileTreeToObject(this.projectRoot, globPattern);
35
- const fileArray = Array.isArray(smartFiles) ? smartFiles : [smartFiles];
34
+ const virtualDir = await plugins.smartfileFactory.virtualDirectoryFromPath(this.projectRoot);
35
+ // Filter files based on glob pattern using simple pattern matching
36
+ const smartFiles = virtualDir.filter(file => {
37
+ // Simple glob matching
38
+ const relativePath = file.relative;
39
+ if (globPattern.includes('**')) {
40
+ // Handle ** patterns - match any path
41
+ const pattern = globPattern.replace(/\*\*/g, '.*').replace(/\*/g, '[^/]*');
42
+ return new RegExp(`^${pattern}$`).test(relativePath);
43
+ } else if (globPattern.includes('*')) {
44
+ // Handle single * patterns
45
+ const pattern = globPattern.replace(/\*/g, '[^/]*');
46
+ return new RegExp(`^${pattern}$`).test(relativePath);
47
+ } else {
48
+ // Exact match
49
+ return relativePath === globPattern;
50
+ }
51
+ }).listFiles();
36
52
 
37
- for (const smartFile of fileArray) {
53
+ for (const smartFile of smartFiles) {
38
54
  try {
39
- const meta = await this.getMetadata(smartFile.path);
55
+ const meta = await this.getMetadata(smartFile.absolutePath);
40
56
  metadata.push(meta);
41
57
  } catch (error) {
42
58
  // Skip files that can't be read
43
- console.warn(`Failed to get metadata for ${smartFile.path}:`, error.message);
59
+ console.warn(`Failed to get metadata for ${smartFile.absolutePath}:`, error.message);
44
60
  }
45
61
  }
46
62
  } catch (error) {
@@ -104,7 +120,7 @@ export class LazyFileLoader {
104
120
  // Load files in parallel
105
121
  const loadPromises = metadata.map(async (meta) => {
106
122
  try {
107
- const contents = await plugins.smartfile.fs.toStringSync(meta.path);
123
+ const contents = await plugins.fsInstance.file(meta.path).encoding('utf8').read() as string;
108
124
  const tokenCount = tokenizer(contents);
109
125
 
110
126
  const fileInfo: IFileInfo = {
@@ -138,7 +154,7 @@ export class LazyFileLoader {
138
154
  tokenizer: (content: string) => number
139
155
  ): Promise<IFileInfo> {
140
156
  const meta = await this.getMetadata(filePath);
141
- const contents = await plugins.smartfile.fs.toStringSync(filePath);
157
+ const contents = await plugins.fsInstance.file(filePath).encoding('utf8').read() as string;
142
158
  const tokenCount = tokenizer(contents);
143
159
  const relativePath = plugins.path.relative(this.projectRoot, filePath);
144
160
 
package/ts/plugins.ts CHANGED
@@ -10,6 +10,7 @@ import * as smartai from '@push.rocks/smartai';
10
10
  import * as smartcli from '@push.rocks/smartcli';
11
11
  import * as smartdelay from '@push.rocks/smartdelay';
12
12
  import * as smartfile from '@push.rocks/smartfile';
13
+ import * as smartfs from '@push.rocks/smartfs';
13
14
  import * as smartgit from '@push.rocks/smartgit';
14
15
  import * as smartinteract from '@push.rocks/smartinteract';
15
16
  import * as smartlog from '@push.rocks/smartlog';
@@ -25,6 +26,7 @@ export {
25
26
  smartcli,
26
27
  smartdelay,
27
28
  smartfile,
29
+ smartfs,
28
30
  smartgit,
29
31
  smartinteract,
30
32
  smartlog,
@@ -34,6 +36,13 @@ export {
34
36
  smarttime,
35
37
  };
36
38
 
39
+ // Create a shared SmartFs instance for filesystem operations
40
+ const smartFsNodeProvider = new smartfs.SmartFsProviderNode();
41
+ export const fsInstance = new smartfs.SmartFs(smartFsNodeProvider);
42
+
43
+ // Create a shared SmartFileFactory for in-memory file operations
44
+ export const smartfileFactory = smartfile.SmartFileFactory.nodeFs();
45
+
37
46
  // @git.zone scope
38
47
  import * as tspublish from '@git.zone/tspublish';
39
48