@banaxi/banana-code 1.0.4 → 1.1.0

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.
@@ -0,0 +1,30 @@
1
+ import fs from 'fs/promises';
2
+ import path from 'path';
3
+ import { glob } from 'glob';
4
+
5
+ export async function getWorkspaceTree() {
6
+ let ignores = ['node_modules/**', '.git/**'];
7
+
8
+ try {
9
+ const gitignore = await fs.readFile(path.join(process.cwd(), '.gitignore'), 'utf8');
10
+ ignores = ignores.concat(gitignore.split('\n').map(l => l.trim()).filter(l => l && !l.startsWith('#')));
11
+ } catch (e) {}
12
+
13
+ try {
14
+ const bananacodeignore = await fs.readFile(path.join(process.cwd(), '.bananacodeignore'), 'utf8');
15
+ ignores = ignores.concat(bananacodeignore.split('\n').map(l => l.trim()).filter(l => l && !l.startsWith('#')));
16
+ } catch (e) {}
17
+
18
+ try {
19
+ const files = await glob('**/*', {
20
+ cwd: process.cwd(),
21
+ ignore: ignores,
22
+ nodir: true,
23
+ dot: true
24
+ });
25
+
26
+ return files.join('\n');
27
+ } catch (err) {
28
+ return `Error reading workspace: ${err.message}`;
29
+ }
30
+ }
package/test-codex.js DELETED
@@ -1,5 +0,0 @@
1
- import { CodexAuth } from '@openai/codex';
2
- console.log(Object.keys(CodexAuth.prototype));
3
- try {
4
- import('@openai/codex').then(mod => console.log(Object.keys(mod)));
5
- } catch (e) { }