@aigne/afs-git 1.1.0 → 1.11.0-beta.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/LICENSE.md CHANGED
@@ -1,93 +1,26 @@
1
- Elastic License 2.0
1
+ # Proprietary License
2
2
 
3
- URL: https://www.elastic.co/licensing/elastic-license
3
+ Copyright (c) 2024-2025 ArcBlock, Inc. All Rights Reserved.
4
4
 
5
- ## Acceptance
5
+ This software and associated documentation files (the "Software") are proprietary
6
+ and confidential. Unauthorized copying, modification, distribution, or use of
7
+ this Software, via any medium, is strictly prohibited.
6
8
 
7
- By using the software, you agree to all of the terms and conditions below.
9
+ The Software is provided for internal use only within ArcBlock, Inc. and its
10
+ authorized affiliates.
8
11
 
9
- ## Copyright License
12
+ ## No License Granted
10
13
 
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.
14
+ No license, express or implied, is granted to any party for any purpose.
15
+ All rights are reserved by ArcBlock, Inc.
15
16
 
16
- ## Limitations
17
+ ## Public Artifact Distribution
17
18
 
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.
19
+ Portions of this Software may be released publicly under separate open-source
20
+ licenses (such as MIT License) through designated public repositories. Such
21
+ public releases are governed by their respective licenses and do not affect
22
+ the proprietary nature of this repository.
21
23
 
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.
24
+ ## Contact
25
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.
26
+ For licensing inquiries, contact: legal@arcblock.io
package/README.md CHANGED
@@ -29,10 +29,12 @@ import { AFSGit } from "@aigne/afs-git";
29
29
  const afs = new AFS();
30
30
 
31
31
  // Mount a git repository in read-only mode
32
- afs.mount(new AFSGit({
33
- repoPath: '/path/to/repo',
34
- accessMode: 'readonly' // default
35
- }));
32
+ afs.mount(
33
+ new AFSGit({
34
+ repoPath: "/path/to/repo",
35
+ accessMode: "readonly", // default
36
+ }),
37
+ );
36
38
  ```
37
39
 
38
40
  ### Path Structure
@@ -54,22 +56,22 @@ afs.mount(new AFSGit({
54
56
 
55
57
  ```typescript
56
58
  // List all branches
57
- const branches = await afs.list('/modules/git');
59
+ const branches = await afs.list("/modules/git");
58
60
  // Returns: ['/main', '/develop', '/feature-auth']
59
61
 
60
62
  // List files in a branch
61
- const files = await afs.list('/modules/git/main');
63
+ const files = await afs.list("/modules/git/main");
62
64
  // Returns files at root of main branch
63
65
 
64
66
  // List files recursively
65
- const allFiles = await afs.list('/modules/git/main', { maxDepth: 10 });
67
+ const allFiles = await afs.list("/modules/git/main", { maxDepth: 10 });
66
68
 
67
69
  // Read file content
68
- const content = await afs.read('/modules/git/main/README.md');
70
+ const content = await afs.read("/modules/git/main/README.md");
69
71
  console.log(content.data?.content);
70
72
 
71
73
  // Search across branch
72
- const results = await afs.search('/modules/git/main', 'TODO');
74
+ const results = await afs.search("/modules/git/main", "TODO");
73
75
  // Uses git grep for fast searching
74
76
  ```
75
77
 
@@ -79,56 +81,56 @@ const results = await afs.search('/modules/git/main', 'TODO');
79
81
  import { AFSGit } from "@aigne/afs-git";
80
82
 
81
83
  const afsGit = new AFSGit({
82
- repoPath: '/path/to/repo',
83
- accessMode: 'readwrite',
84
+ repoPath: "/path/to/repo",
85
+ accessMode: "readwrite",
84
86
  autoCommit: true,
85
87
  commitAuthor: {
86
- name: 'AI Agent',
87
- email: 'agent@example.com'
88
- }
88
+ name: "AI Agent",
89
+ email: "agent@example.com",
90
+ },
89
91
  });
90
92
 
91
93
  afs.mount(afsGit);
92
94
 
93
95
  // Write a new file (creates worktree automatically)
94
- await afs.write('/modules/git/main/newfile.txt', {
95
- content: 'Hello World'
96
+ await afs.write("/modules/git/main/newfile.txt", {
97
+ content: "Hello World",
96
98
  });
97
99
  // Automatically committed with message "Update newfile.txt"
98
100
 
99
101
  // Update existing file
100
- await afs.write('/modules/git/main/src/index.ts', {
101
- content: updatedCode
102
+ await afs.write("/modules/git/main/src/index.ts", {
103
+ content: updatedCode,
102
104
  });
103
105
 
104
106
  // Delete file
105
- await afs.delete('/modules/git/main/oldfile.txt');
107
+ await afs.delete("/modules/git/main/oldfile.txt");
106
108
  // Automatically committed
107
109
 
108
110
  // Rename/move file
109
- await afs.rename('/modules/git/main/old.txt', '/modules/git/main/new.txt');
111
+ await afs.rename("/modules/git/main/old.txt", "/modules/git/main/new.txt");
110
112
  ```
111
113
 
112
114
  ### Advanced Configuration
113
115
 
114
116
  ```typescript
115
117
  const afsGit = new AFSGit({
116
- repoPath: '/path/to/repo',
117
- name: 'my-repo',
118
- description: 'My project repository',
118
+ repoPath: "/path/to/repo",
119
+ name: "my-repo",
120
+ description: "My project repository",
119
121
 
120
122
  // Limit accessible branches
121
- branches: ['main', 'develop'],
123
+ branches: ["main", "develop"],
122
124
 
123
125
  // Access control
124
- accessMode: 'readwrite',
126
+ accessMode: "readwrite",
125
127
 
126
128
  // Auto-commit settings
127
129
  autoCommit: true,
128
130
  commitAuthor: {
129
- name: 'AI Agent',
130
- email: 'agent@example.com'
131
- }
131
+ name: "AI Agent",
132
+ email: "agent@example.com",
133
+ },
132
134
  });
133
135
 
134
136
  // Cleanup worktrees when done
@@ -165,15 +167,16 @@ Worktrees are created in temporary directories and cleaned up when the module is
165
167
  ```typescript
166
168
  interface AFSGitOptions {
167
169
  // Required
168
- repoPath: string; // Path to git repository
170
+ repoPath: string; // Path to git repository
169
171
 
170
172
  // Optional
171
- name?: string; // Module name (default: repo basename)
172
- description?: string; // Module description
173
- branches?: string[]; // Limit accessible branches
174
- accessMode?: 'readonly' | 'readwrite'; // Default: 'readonly'
175
- autoCommit?: boolean; // Auto-commit changes (default: false)
176
- commitAuthor?: { // Author for commits
173
+ name?: string; // Module name (default: repo basename)
174
+ description?: string; // Module description
175
+ branches?: string[]; // Limit accessible branches
176
+ accessMode?: "readonly" | "readwrite"; // Default: 'readonly'
177
+ autoCommit?: boolean; // Auto-commit changes (default: false)
178
+ commitAuthor?: {
179
+ // Author for commits
177
180
  name: string;
178
181
  email: string;
179
182
  };
@@ -202,10 +205,12 @@ import { AFS } from "@aigne/afs";
202
205
  import { AFSGit } from "@aigne/afs-git";
203
206
 
204
207
  const afs = new AFS();
205
- afs.mount(new AFSGit({
206
- repoPath: process.cwd(),
207
- accessMode: 'readonly'
208
- }));
208
+ afs.mount(
209
+ new AFSGit({
210
+ repoPath: process.cwd(),
211
+ accessMode: "readonly",
212
+ }),
213
+ );
209
214
 
210
215
  const aigne = new AIGNE({});
211
216
 
@@ -213,15 +218,11 @@ const aigne = new AIGNE({});
213
218
  const agent = AIAgent.from({
214
219
  name: "CodeReviewer",
215
220
  instructions: "Review code and suggest improvements",
216
- afs
221
+ afs,
217
222
  });
218
223
 
219
224
  // Agent can list files, read code, search for patterns
220
225
  await aigne.invoke(agent, {
221
- message: "Review the authentication code in src/auth/"
226
+ message: "Review the authentication code in src/auth/",
222
227
  });
223
228
  ```
224
-
225
- ## License
226
-
227
- This project is licensed under the [Elastic-2.0](../../LICENSE.md) License.