agentlang 0.9.11 → 0.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.
- package/out/language/generated/ast.d.ts +60 -42
- package/out/language/generated/ast.d.ts.map +1 -1
- package/out/language/generated/ast.js +45 -31
- package/out/language/generated/ast.js.map +1 -1
- package/out/language/generated/grammar.d.ts.map +1 -1
- package/out/language/generated/grammar.js +294 -327
- package/out/language/generated/grammar.js.map +1 -1
- package/out/language/main.cjs +336 -358
- package/out/language/main.cjs.map +2 -2
- package/out/language/parser.d.ts +11 -1
- package/out/language/parser.d.ts.map +1 -1
- package/out/language/parser.js +56 -6
- package/out/language/parser.js.map +1 -1
- package/out/language/syntax.d.ts +8 -0
- package/out/language/syntax.d.ts.map +1 -1
- package/out/language/syntax.js +11 -2
- package/out/language/syntax.js.map +1 -1
- package/out/runtime/agents/common.d.ts +2 -2
- package/out/runtime/agents/common.js +1 -1
- package/out/runtime/interpreter.d.ts.map +1 -1
- package/out/runtime/interpreter.js +104 -87
- package/out/runtime/interpreter.js.map +1 -1
- package/out/runtime/modules/ai.d.ts +2 -5
- package/out/runtime/modules/ai.d.ts.map +1 -1
- package/out/runtime/modules/ai.js +28 -19
- package/out/runtime/modules/ai.js.map +1 -1
- package/out/runtime/services/documentFetcher.js +2 -2
- package/out/runtime/services/documentFetcher.js.map +1 -1
- package/out/runtime/util.d.ts +10 -0
- package/out/runtime/util.d.ts.map +1 -1
- package/out/runtime/util.js +27 -2
- package/out/runtime/util.js.map +1 -1
- package/out/utils/fs/index.d.ts +12 -2
- package/out/utils/fs/index.d.ts.map +1 -1
- package/out/utils/fs/index.js +27 -6
- package/out/utils/fs/index.js.map +1 -1
- package/package.json +1 -1
- package/src/language/agentlang.langium +6 -9
- package/src/language/generated/ast.ts +66 -43
- package/src/language/generated/grammar.ts +294 -327
- package/src/language/parser.ts +65 -4
- package/src/language/syntax.ts +21 -2
- package/src/runtime/agents/common.ts +1 -1
- package/src/runtime/interpreter.ts +111 -84
- package/src/runtime/modules/ai.ts +35 -25
- package/src/runtime/services/documentFetcher.ts +2 -2
- package/src/runtime/util.ts +45 -2
- package/src/utils/fs/index.ts +30 -6
package/src/utils/fs/index.ts
CHANGED
|
@@ -4,25 +4,49 @@
|
|
|
4
4
|
|
|
5
5
|
export * from './interfaces.js';
|
|
6
6
|
import { ExtendedFileSystem } from './interfaces.js';
|
|
7
|
-
import { createNodeFS } from './node-fs.js';
|
|
8
|
-
import { createLightningFS } from './lightning-fs.js';
|
|
9
7
|
|
|
10
8
|
/**
|
|
11
9
|
* Create the appropriate filesystem implementation based on environment
|
|
10
|
+
* Uses dynamic imports to avoid bundling Node.js-specific code in browser builds
|
|
12
11
|
* @returns Promise resolving to appropriate filesystem implementation
|
|
13
12
|
*/
|
|
14
13
|
export async function createFS(options?: any): Promise<ExtendedFileSystem> {
|
|
15
14
|
// Check if we're in a browser or Node environment
|
|
16
15
|
if (typeof window === 'undefined') {
|
|
17
|
-
// Node.js environment
|
|
16
|
+
// Node.js environment - use dynamic import to avoid bundling in browser
|
|
17
|
+
const { createNodeFS } = await import('./node-fs.js');
|
|
18
18
|
return createNodeFS();
|
|
19
19
|
} else {
|
|
20
20
|
// Browser environment - use Lightning FS
|
|
21
|
+
const { createLightningFS } = await import('./lightning-fs.js');
|
|
21
22
|
return createLightningFS(options);
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
//
|
|
26
|
-
export { createNodeFS } from './node-fs.js';
|
|
27
|
-
export { createLightningFS } from './lightning-fs.js';
|
|
26
|
+
// Re-export interface types (these are safe for browser)
|
|
28
27
|
export * from './interfaces.js';
|
|
28
|
+
|
|
29
|
+
// Export factory functions that use dynamic imports internally
|
|
30
|
+
// These are async to support dynamic loading based on environment
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Create Node.js filesystem - only works in Node.js environment
|
|
34
|
+
* @returns Promise resolving to NodeFileSystem instance
|
|
35
|
+
*/
|
|
36
|
+
export async function createNodeFS(): Promise<ExtendedFileSystem> {
|
|
37
|
+
if (typeof window !== 'undefined') {
|
|
38
|
+
throw new Error('createNodeFS is only available in Node.js environment');
|
|
39
|
+
}
|
|
40
|
+
const module = await import('./node-fs.js');
|
|
41
|
+
return module.createNodeFS();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Create Lightning FS - works in browser environment
|
|
46
|
+
* @param options Optional configuration for Lightning FS
|
|
47
|
+
* @returns Promise resolving to LightningFileSystem instance
|
|
48
|
+
*/
|
|
49
|
+
export async function createLightningFS(options?: any): Promise<ExtendedFileSystem> {
|
|
50
|
+
const module = await import('./lightning-fs.js');
|
|
51
|
+
return module.createLightningFS(options);
|
|
52
|
+
}
|