@aigne/afs-explorer 1.0.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.
- package/CHANGELOG.md +22 -0
- package/LICENSE.md +93 -0
- package/README.md +133 -0
- package/dist/assets/index-viceiJOt.js +271 -0
- package/dist/index.html +13 -0
- package/lib/cjs/index.d.ts +10 -0
- package/lib/cjs/index.js +17 -0
- package/lib/cjs/package.json +3 -0
- package/lib/cjs/server.d.ts +21 -0
- package/lib/cjs/server.js +107 -0
- package/lib/dts/index.d.ts +10 -0
- package/lib/dts/server.d.ts +21 -0
- package/lib/esm/index.d.ts +10 -0
- package/lib/esm/index.js +13 -0
- package/lib/esm/package.json +3 -0
- package/lib/esm/server.d.ts +21 -0
- package/lib/esm/server.js +100 -0
- package/package.json +102 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.0 (2026-01-16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **afs:** add explorer for AFS ([97ebe2d](https://github.com/AIGNE-io/aigne-framework/commit/97ebe2de59fb4ac4a5e5dea51b027a02ee69638d))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @aigne/afs bumped to 1.4.0-beta.10
|
|
16
|
+
* @aigne/core bumped to 1.72.0-beta.24
|
|
17
|
+
* devDependencies
|
|
18
|
+
* @aigne/afs-git bumped to 1.0.0
|
|
19
|
+
* @aigne/afs-history bumped to 1.2.0-beta.11
|
|
20
|
+
* @aigne/afs-json bumped to 1.0.0
|
|
21
|
+
* @aigne/afs-local-fs bumped to 1.4.0-beta.25
|
|
22
|
+
* @aigne/test-utils bumped to 0.5.69-beta.24
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Elastic License 2.0
|
|
2
|
+
|
|
3
|
+
URL: https://www.elastic.co/licensing/elastic-license
|
|
4
|
+
|
|
5
|
+
## Acceptance
|
|
6
|
+
|
|
7
|
+
By using the software, you agree to all of the terms and conditions below.
|
|
8
|
+
|
|
9
|
+
## Copyright License
|
|
10
|
+
|
|
11
|
+
The licensor grants you a non-exclusive, royalty-free, worldwide,
|
|
12
|
+
non-sublicensable, non-transferable license to use, copy, distribute, make
|
|
13
|
+
available, and prepare derivative works of the software, in each case subject to
|
|
14
|
+
the limitations and conditions below.
|
|
15
|
+
|
|
16
|
+
## Limitations
|
|
17
|
+
|
|
18
|
+
You may not provide the software to third parties as a hosted or managed
|
|
19
|
+
service, where the service provides users with access to any substantial set of
|
|
20
|
+
the features or functionality of the software.
|
|
21
|
+
|
|
22
|
+
You may not move, change, disable, or circumvent the license key functionality
|
|
23
|
+
in the software, and you may not remove or obscure any functionality in the
|
|
24
|
+
software that is protected by the license key.
|
|
25
|
+
|
|
26
|
+
You may not alter, remove, or obscure any licensing, copyright, or other notices
|
|
27
|
+
of the licensor in the software. Any use of the licensorβs trademarks is subject
|
|
28
|
+
to applicable law.
|
|
29
|
+
|
|
30
|
+
## Patents
|
|
31
|
+
|
|
32
|
+
The licensor grants you a license, under any patent claims the licensor can
|
|
33
|
+
license, or becomes able to license, to make, have made, use, sell, offer for
|
|
34
|
+
sale, import and have imported the software, in each case subject to the
|
|
35
|
+
limitations and conditions in this license. This license does not cover any
|
|
36
|
+
patent claims that you cause to be infringed by modifications or additions to
|
|
37
|
+
the software. If you or your company make any written claim that the software
|
|
38
|
+
infringes or contributes to infringement of any patent, your patent license for
|
|
39
|
+
the software granted under these terms ends immediately. If your company makes
|
|
40
|
+
such a claim, your patent license ends immediately for work on behalf of your
|
|
41
|
+
company.
|
|
42
|
+
|
|
43
|
+
## Notices
|
|
44
|
+
|
|
45
|
+
You must ensure that anyone who gets a copy of any part of the software from you
|
|
46
|
+
also gets a copy of these terms.
|
|
47
|
+
|
|
48
|
+
If you modify the software, you must include in any modified copies of the
|
|
49
|
+
software prominent notices stating that you have modified the software.
|
|
50
|
+
|
|
51
|
+
## No Other Rights
|
|
52
|
+
|
|
53
|
+
These terms do not imply any licenses other than those expressly granted in
|
|
54
|
+
these terms.
|
|
55
|
+
|
|
56
|
+
## Termination
|
|
57
|
+
|
|
58
|
+
If you use the software in violation of these terms, such use is not licensed,
|
|
59
|
+
and your licenses will automatically terminate. If the licensor provides you
|
|
60
|
+
with a notice of your violation, and you cease all violation of this license no
|
|
61
|
+
later than 30 days after you receive that notice, your licenses will be
|
|
62
|
+
reinstated retroactively. However, if you violate these terms after such
|
|
63
|
+
reinstatement, any additional violation of these terms will cause your licenses
|
|
64
|
+
to terminate automatically and permanently.
|
|
65
|
+
|
|
66
|
+
## No Liability
|
|
67
|
+
|
|
68
|
+
*As far as the law allows, the software comes as is, without any warranty or
|
|
69
|
+
condition, and the licensor will not be liable to you for any damages arising
|
|
70
|
+
out of these terms or the use or nature of the software, under any kind of
|
|
71
|
+
legal claim.*
|
|
72
|
+
|
|
73
|
+
## Definitions
|
|
74
|
+
|
|
75
|
+
The **licensor** is the entity offering these terms, and the **software** is the
|
|
76
|
+
software the licensor makes available under these terms, including any portion
|
|
77
|
+
of it.
|
|
78
|
+
|
|
79
|
+
**you** refers to the individual or entity agreeing to these terms.
|
|
80
|
+
|
|
81
|
+
**your company** is any legal entity, sole proprietorship, or other kind of
|
|
82
|
+
organization that you work for, plus all organizations that have control over,
|
|
83
|
+
are under the control of, or are under common control with that
|
|
84
|
+
organization. **control** means ownership of substantially all the assets of an
|
|
85
|
+
entity, or the power to direct its management and policies by vote, contract, or
|
|
86
|
+
otherwise. Control can be direct or indirect.
|
|
87
|
+
|
|
88
|
+
**your licenses** are all the licenses granted to you for the software under
|
|
89
|
+
these terms.
|
|
90
|
+
|
|
91
|
+
**use** means anything you do with the software requiring one of your licenses.
|
|
92
|
+
|
|
93
|
+
**trademark** means trademarks, service marks, and similar rights.
|
package/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# @aigne/afs-explorer
|
|
2
|
+
|
|
3
|
+
AFS Explorer is a web-based file system explorer for the AIGNE Framework's Agentic File System (AFS). It provides a beautiful, user-friendly interface built with React, TypeScript, and Material-UI to browse, search, and view files in your AFS instances.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- π Browse AFS file systems with an intuitive folder/file interface
|
|
8
|
+
- π² **File tree navigation** - Explore directories in a collapsible tree view (left sidebar)
|
|
9
|
+
- π **URL-based routing** - Each directory has its own URL for easy bookmarking and sharing
|
|
10
|
+
- π Search files and directories across all mounted modules
|
|
11
|
+
- ποΈ View file contents with syntax highlighting for JSON/YAML
|
|
12
|
+
- π Display file metadata (size, type, timestamps)
|
|
13
|
+
- π¨ Modern, responsive UI built with Material-UI
|
|
14
|
+
- π± Mobile-friendly with responsive drawer navigation
|
|
15
|
+
- β‘ Fast and efficient API based on Express
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pnpm add @aigne/afs-explorer
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Usage
|
|
24
|
+
|
|
25
|
+
### Basic Example
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { AFS } from "@aigne/afs";
|
|
29
|
+
import { AFSHistory } from "@aigne/afs-history";
|
|
30
|
+
import { LocalFS } from "@aigne/afs-local-fs";
|
|
31
|
+
import { startExplorer } from "@aigne/afs-explorer";
|
|
32
|
+
|
|
33
|
+
// Create and configure your AFS instance
|
|
34
|
+
const afs = new AFS();
|
|
35
|
+
afs.mount(new AFSHistory({ storage: { url: "file:./memory.sqlite3" } }));
|
|
36
|
+
afs.mount(new LocalFS({ localPath: "./docs" }));
|
|
37
|
+
|
|
38
|
+
// Start the explorer server
|
|
39
|
+
const server = await startExplorer(afs, {
|
|
40
|
+
port: 3000,
|
|
41
|
+
host: "localhost",
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
console.log("AFS Explorer is running at http://localhost:3000");
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Custom Configuration
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
import { ExplorerServer } from "@aigne/afs-explorer";
|
|
51
|
+
import { fileURLToPath } from "node:url";
|
|
52
|
+
import path from "node:path";
|
|
53
|
+
|
|
54
|
+
// For production: specify the path to the built frontend
|
|
55
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
56
|
+
const distPath = path.resolve(__dirname, "node_modules/@aigne/afs-explorer/dist");
|
|
57
|
+
|
|
58
|
+
const server = new ExplorerServer(afs, {
|
|
59
|
+
port: 8080,
|
|
60
|
+
host: "0.0.0.0", // Listen on all interfaces
|
|
61
|
+
distPath, // Path to the built frontend files
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
await server.start();
|
|
65
|
+
|
|
66
|
+
// Later, stop the server
|
|
67
|
+
await server.stop();
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Note:** The `distPath` option is optional. If not provided, only the API endpoints will be available. In development, you can run the Vite dev server separately and use a proxy to access the API.
|
|
71
|
+
|
|
72
|
+
## Development
|
|
73
|
+
|
|
74
|
+
### Build the Frontend
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
pnpm build:web
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
This builds the React application into the `dist` directory.
|
|
81
|
+
|
|
82
|
+
### Build the Library
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pnpm build:lib
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
This compiles the TypeScript server code.
|
|
89
|
+
|
|
90
|
+
### Build Everything
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pnpm build
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Development Mode
|
|
97
|
+
|
|
98
|
+
For development, you can run the Vite dev server separately:
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
pnpm dev
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
This will start the Vite dev server on port 5173 with hot module replacement.
|
|
105
|
+
|
|
106
|
+
## API Endpoints
|
|
107
|
+
|
|
108
|
+
The explorer provides the following REST API endpoints:
|
|
109
|
+
|
|
110
|
+
- `GET /api/list?path={path}&maxDepth={depth}` - List directory contents (start from root `/`)
|
|
111
|
+
- `GET /api/read?path={path}` - Read file contents
|
|
112
|
+
- `GET /api/search?path={path}&query={query}` - Search files and directories
|
|
113
|
+
|
|
114
|
+
## Architecture
|
|
115
|
+
|
|
116
|
+
### Backend
|
|
117
|
+
|
|
118
|
+
The backend is built with Express and provides:
|
|
119
|
+
- RESTful API for AFS operations
|
|
120
|
+
- Static file serving for the React frontend
|
|
121
|
+
- CORS support for development
|
|
122
|
+
|
|
123
|
+
### Frontend
|
|
124
|
+
|
|
125
|
+
The frontend is a React application built with:
|
|
126
|
+
- **React 19** - Modern React with hooks
|
|
127
|
+
- **TypeScript** - Type-safe development
|
|
128
|
+
- **Material-UI (MUI)** - Professional UI components
|
|
129
|
+
- **Vite** - Fast build tool and dev server
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
Elastic-2.0
|