@archildata/just-bash 0.8.18 → 0.8.19

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/dist/index.d.cts CHANGED
@@ -1,59 +1,51 @@
1
- import * as _archildata_native from '@archildata/native';
2
- import { ArchilClient, UnixUser } from '@archildata/native';
3
- import * as just_bash from 'just-bash';
4
-
5
- /**
6
- * Archil filesystem adapter for just-bash
7
- *
8
- * Implements the IFileSystem interface from just-bash using the ArchilClient
9
- * from @archildata/native for direct protocol access to Archil distributed filesystems.
10
- */
1
+ import { ArchilClient, UnixUser } from "@archildata/native";
11
2
 
3
+ //#region src/ArchilFs.d.ts
12
4
  type BufferEncoding = "utf8" | "utf-8" | "ascii" | "binary" | "base64" | "hex" | "latin1";
13
5
  type FileContent = string | Uint8Array;
14
6
  interface FsStat {
15
- isFile: boolean;
16
- isDirectory: boolean;
17
- isSymbolicLink: boolean;
18
- mode: number;
19
- size: number;
20
- mtime: Date;
7
+ isFile: boolean;
8
+ isDirectory: boolean;
9
+ isSymbolicLink: boolean;
10
+ mode: number;
11
+ size: number;
12
+ mtime: Date;
21
13
  }
22
14
  interface DirentEntry {
23
- name: string;
24
- isFile: boolean;
25
- isDirectory: boolean;
26
- isSymbolicLink: boolean;
15
+ name: string;
16
+ isFile: boolean;
17
+ isDirectory: boolean;
18
+ isSymbolicLink: boolean;
27
19
  }
28
20
  interface IFileSystem {
29
- readFile(path: string, encoding?: BufferEncoding): Promise<string>;
30
- readFileBuffer(path: string): Promise<Uint8Array>;
31
- readdir(path: string): Promise<string[]>;
32
- readdirWithFileTypes?(path: string): Promise<DirentEntry[]>;
33
- stat(path: string): Promise<FsStat>;
34
- lstat(path: string): Promise<FsStat>;
35
- exists(path: string): Promise<boolean>;
36
- readlink(path: string): Promise<string>;
37
- realpath(path: string): Promise<string>;
38
- writeFile(path: string, content: FileContent): Promise<void>;
39
- appendFile(path: string, content: FileContent): Promise<void>;
40
- mkdir(path: string, options?: {
41
- recursive?: boolean;
42
- }): Promise<void>;
43
- rm(path: string, options?: {
44
- recursive?: boolean;
45
- force?: boolean;
46
- }): Promise<void>;
47
- cp(src: string, dest: string, options?: {
48
- recursive?: boolean;
49
- }): Promise<void>;
50
- mv(src: string, dest: string): Promise<void>;
51
- symlink(target: string, path: string): Promise<void>;
52
- link(existingPath: string, newPath: string): Promise<void>;
53
- chmod(path: string, mode: number): Promise<void>;
54
- utimes(path: string, atime: Date, mtime: Date): Promise<void>;
55
- resolvePath(base: string, ...paths: string[]): string;
56
- getAllPaths?(): string[];
21
+ readFile(path: string, encoding?: BufferEncoding): Promise<string>;
22
+ readFileBuffer(path: string): Promise<Uint8Array>;
23
+ readdir(path: string): Promise<string[]>;
24
+ readdirWithFileTypes?(path: string): Promise<DirentEntry[]>;
25
+ stat(path: string): Promise<FsStat>;
26
+ lstat(path: string): Promise<FsStat>;
27
+ exists(path: string): Promise<boolean>;
28
+ readlink(path: string): Promise<string>;
29
+ realpath(path: string): Promise<string>;
30
+ writeFile(path: string, content: FileContent): Promise<void>;
31
+ appendFile(path: string, content: FileContent): Promise<void>;
32
+ mkdir(path: string, options?: {
33
+ recursive?: boolean;
34
+ }): Promise<void>;
35
+ rm(path: string, options?: {
36
+ recursive?: boolean;
37
+ force?: boolean;
38
+ }): Promise<void>;
39
+ cp(src: string, dest: string, options?: {
40
+ recursive?: boolean;
41
+ }): Promise<void>;
42
+ mv(src: string, dest: string): Promise<void>;
43
+ symlink(target: string, path: string): Promise<void>;
44
+ link(existingPath: string, newPath: string): Promise<void>;
45
+ chmod(path: string, mode: number): Promise<void>;
46
+ utimes(path: string, atime: Date, mtime: Date): Promise<void>;
47
+ resolvePath(base: string, ...paths: string[]): string;
48
+ getAllPaths?(): string[];
57
49
  }
58
50
  /**
59
51
  * ArchilFs implements the just-bash IFileSystem interface using Archil protocol.
@@ -83,89 +75,90 @@ interface IFileSystem {
83
75
  * ```
84
76
  */
85
77
  declare class ArchilFs implements IFileSystem {
86
- private client;
87
- private user?;
88
- private rootInodeId;
89
- private constructor();
90
- /**
91
- * Create an ArchilFs adapter, optionally rooted at a subdirectory.
92
- *
93
- * The subdirectory path is resolved eagerly: if any component does not
94
- * exist or is not a directory, this method throws immediately.
95
- *
96
- * @param client - Connected ArchilClient instance
97
- * @param options - Optional configuration
98
- * @param options.user - Unix user context for permission checks
99
- * @param options.subdirectory - Subdirectory to treat as the root of the filesystem
100
- */
101
- static create(client: ArchilClient, options?: {
102
- user?: UnixUser;
103
- subdirectory?: string;
104
- }): Promise<ArchilFs>;
105
- /**
106
- * Normalize a path (remove . and .., ensure leading /)
107
- */
108
- private normalizePath;
109
- private static readonly MAX_SYMLINKS;
110
- /**
111
- * Resolve a path to its inode ID, walking the directory tree.
112
- * Follows symlinks on intermediate components but NOT on the final
113
- * component (matching lstat/readlink semantics).
114
- */
115
- private resolve;
116
- /**
117
- * Resolve a path, following symlinks on ALL components including the
118
- * final one (like stat(2)). Use resolve() when you need lstat semantics.
119
- */
120
- private resolveFollow;
121
- /**
122
- * Resolve parent directory and get child name
123
- */
124
- private resolveParent;
125
- /**
126
- * Convert InodeAttributes to FsStat
127
- */
128
- private toStat;
129
- private static readonly DIR_PAGE_SIZE;
130
- /**
131
- * Read all directory entries using the paginated API.
132
- */
133
- private readAllDirectoryEntries;
134
- resolvePath(base: string, ...paths: string[]): string;
135
- readFile(path: string, encoding?: BufferEncoding): Promise<string>;
136
- readFileBuffer(path: string): Promise<Uint8Array>;
137
- readdir(path: string): Promise<string[]>;
138
- readdirWithFileTypes(path: string): Promise<DirentEntry[]>;
139
- stat(path: string): Promise<FsStat>;
140
- lstat(path: string): Promise<FsStat>;
141
- exists(path: string): Promise<boolean>;
142
- readlink(path: string): Promise<string>;
143
- realpath(path: string, symlinkDepth?: number): Promise<string>;
144
- writeFile(path: string, content: FileContent): Promise<void>;
145
- appendFile(path: string, content: FileContent): Promise<void>;
146
- mkdir(path: string, options?: {
147
- recursive?: boolean;
148
- }): Promise<void>;
149
- private mkdirSingle;
150
- rm(path: string, options?: {
151
- recursive?: boolean;
152
- force?: boolean;
153
- }): Promise<void>;
154
- cp(src: string, dest: string, options?: {
155
- recursive?: boolean;
156
- }): Promise<void>;
157
- mv(src: string, dest: string): Promise<void>;
158
- symlink(target: string, path: string): Promise<void>;
159
- link(existingPath: string, newPath: string): Promise<void>;
160
- chmod(path: string, mode: number): Promise<void>;
161
- utimes(path: string, atime: Date, mtime: Date): Promise<void>;
162
- getAllPaths(): string[];
163
- /**
164
- * Resolve a path to its inode ID (public wrapper for delegation operations)
165
- */
166
- resolveInodeId(path: string): Promise<number>;
78
+ private client;
79
+ private user?;
80
+ private rootInodeId;
81
+ private constructor();
82
+ /**
83
+ * Create an ArchilFs adapter, optionally rooted at a subdirectory.
84
+ *
85
+ * The subdirectory path is resolved eagerly: if any component does not
86
+ * exist or is not a directory, this method throws immediately.
87
+ *
88
+ * @param client - Connected ArchilClient instance
89
+ * @param options - Optional configuration
90
+ * @param options.user - Unix user context for permission checks
91
+ * @param options.subdirectory - Subdirectory to treat as the root of the filesystem
92
+ */
93
+ static create(client: ArchilClient, options?: {
94
+ user?: UnixUser;
95
+ subdirectory?: string;
96
+ }): Promise<ArchilFs>;
97
+ /**
98
+ * Normalize a path (remove . and .., ensure leading /)
99
+ */
100
+ private normalizePath;
101
+ private static readonly MAX_SYMLINKS;
102
+ /**
103
+ * Resolve a path to its inode ID, walking the directory tree.
104
+ * Follows symlinks on intermediate components but NOT on the final
105
+ * component (matching lstat/readlink semantics).
106
+ */
107
+ private resolve;
108
+ /**
109
+ * Resolve a path, following symlinks on ALL components including the
110
+ * final one (like stat(2)). Use resolve() when you need lstat semantics.
111
+ */
112
+ private resolveFollow;
113
+ /**
114
+ * Resolve parent directory and get child name
115
+ */
116
+ private resolveParent;
117
+ /**
118
+ * Convert InodeAttributes to FsStat
119
+ */
120
+ private toStat;
121
+ private static readonly DIR_PAGE_SIZE;
122
+ /**
123
+ * Read all directory entries using the paginated API.
124
+ */
125
+ private readAllDirectoryEntries;
126
+ resolvePath(base: string, ...paths: string[]): string;
127
+ readFile(path: string, encoding?: BufferEncoding): Promise<string>;
128
+ readFileBuffer(path: string): Promise<Uint8Array>;
129
+ readdir(path: string): Promise<string[]>;
130
+ readdirWithFileTypes(path: string): Promise<DirentEntry[]>;
131
+ stat(path: string): Promise<FsStat>;
132
+ lstat(path: string): Promise<FsStat>;
133
+ exists(path: string): Promise<boolean>;
134
+ readlink(path: string): Promise<string>;
135
+ realpath(path: string, symlinkDepth?: number): Promise<string>;
136
+ writeFile(path: string, content: FileContent): Promise<void>;
137
+ appendFile(path: string, content: FileContent): Promise<void>;
138
+ mkdir(path: string, options?: {
139
+ recursive?: boolean;
140
+ }): Promise<void>;
141
+ private mkdirSingle;
142
+ rm(path: string, options?: {
143
+ recursive?: boolean;
144
+ force?: boolean;
145
+ }): Promise<void>;
146
+ cp(src: string, dest: string, options?: {
147
+ recursive?: boolean;
148
+ }): Promise<void>;
149
+ mv(src: string, dest: string): Promise<void>;
150
+ symlink(target: string, path: string): Promise<void>;
151
+ link(existingPath: string, newPath: string): Promise<void>;
152
+ chmod(path: string, mode: number): Promise<void>;
153
+ utimes(path: string, atime: Date, mtime: Date): Promise<void>;
154
+ getAllPaths(): string[];
155
+ /**
156
+ * Resolve a path to its inode ID (public wrapper for delegation operations)
157
+ */
158
+ resolveInodeId(path: string): Promise<number>;
167
159
  }
168
-
160
+ //#endregion
161
+ //#region src/commands.d.ts
169
162
  /**
170
163
  * Create the `archil` custom command for use with just-bash.
171
164
  *
@@ -189,8 +182,9 @@ declare class ArchilFs implements IFileSystem {
189
182
  * await bash.exec('archil checkin /mydir');
190
183
  * ```
191
184
  */
192
- declare function createArchilCommand(client: ArchilClient, fs: ArchilFs): just_bash.Command;
193
-
185
+ declare function createArchilCommand(client: ArchilClient, fs: ArchilFs): import("just-bash").Command;
186
+ //#endregion
187
+ //#region src/index.d.ts
194
188
  /**
195
189
  * Create an ArchilFs instance, optionally rooted at a subdirectory.
196
190
  *
@@ -207,9 +201,10 @@ declare function createArchilCommand(client: ArchilClient, fs: ArchilFs): just_b
207
201
  * const fs = await createArchilFs(client, { user: { uid: 1000, gid: 1000 } });
208
202
  * ```
209
203
  */
210
- declare function createArchilFs(client: _archildata_native.ArchilClient, options?: {
211
- user?: _archildata_native.UnixUser;
212
- subdirectory?: string;
204
+ declare function createArchilFs(client: import("@archildata/native").ArchilClient, options?: {
205
+ user?: import("@archildata/native").UnixUser;
206
+ subdirectory?: string;
213
207
  }): Promise<ArchilFs>;
214
-
208
+ //#endregion
215
209
  export { ArchilFs, type BufferEncoding, type DirentEntry, type FileContent, type FsStat, type IFileSystem, createArchilCommand, createArchilFs };
210
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/ArchilFs.ts","../src/commands.ts","../src/index.ts"],"mappings":";;;KAcY,cAAA;AAAA,KASA,WAAA,YAAuB,UAAU;AAAA,UAE5B,MAAA;EACf,MAAA;EACA,WAAA;EACA,cAAA;EACA,IAAA;EACA,IAAA;EACA,KAAA,EAAO,IAAI;AAAA;AAAA,UAGI,WAAA;EACf,IAAA;EACA,MAAA;EACA,WAAA;EACA,cAAA;AAAA;AAAA,UAGe,WAAA;EAEf,QAAA,CAAS,IAAA,UAAc,QAAA,GAAW,cAAA,GAAiB,OAAA;EACnD,cAAA,CAAe,IAAA,WAAe,OAAA,CAAQ,UAAA;EACtC,OAAA,CAAQ,IAAA,WAAe,OAAA;EACvB,oBAAA,EAAsB,IAAA,WAAe,OAAA,CAAQ,WAAA;EAC7C,IAAA,CAAK,IAAA,WAAe,OAAA,CAAQ,MAAA;EAC5B,KAAA,CAAM,IAAA,WAAe,OAAA,CAAQ,MAAA;EAC7B,MAAA,CAAO,IAAA,WAAe,OAAA;EACtB,QAAA,CAAS,IAAA,WAAe,OAAA;EACxB,QAAA,CAAS,IAAA,WAAe,OAAA;EAGxB,SAAA,CAAU,IAAA,UAAc,OAAA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AAc,EAAA,EAAI,QAAQ,uBAAA,OAAA;;;;ADUtD;AAGhB;;;;;;;;;;;;;;iBEmBsB,cAAA,CACpB,MAAA,+BAAqC,YAAA,EACrC,OAAA;EAAY,IAAA,gCAAoC,QAAA;EAAU,YAAA;AAAA,IACzD,OAAO,CAAC,QAAA"}
@@ -0,0 +1,210 @@
1
+ import { ArchilClient, UnixUser } from "@archildata/native";
2
+
3
+ //#region src/ArchilFs.d.ts
4
+ type BufferEncoding = "utf8" | "utf-8" | "ascii" | "binary" | "base64" | "hex" | "latin1";
5
+ type FileContent = string | Uint8Array;
6
+ interface FsStat {
7
+ isFile: boolean;
8
+ isDirectory: boolean;
9
+ isSymbolicLink: boolean;
10
+ mode: number;
11
+ size: number;
12
+ mtime: Date;
13
+ }
14
+ interface DirentEntry {
15
+ name: string;
16
+ isFile: boolean;
17
+ isDirectory: boolean;
18
+ isSymbolicLink: boolean;
19
+ }
20
+ interface IFileSystem {
21
+ readFile(path: string, encoding?: BufferEncoding): Promise<string>;
22
+ readFileBuffer(path: string): Promise<Uint8Array>;
23
+ readdir(path: string): Promise<string[]>;
24
+ readdirWithFileTypes?(path: string): Promise<DirentEntry[]>;
25
+ stat(path: string): Promise<FsStat>;
26
+ lstat(path: string): Promise<FsStat>;
27
+ exists(path: string): Promise<boolean>;
28
+ readlink(path: string): Promise<string>;
29
+ realpath(path: string): Promise<string>;
30
+ writeFile(path: string, content: FileContent): Promise<void>;
31
+ appendFile(path: string, content: FileContent): Promise<void>;
32
+ mkdir(path: string, options?: {
33
+ recursive?: boolean;
34
+ }): Promise<void>;
35
+ rm(path: string, options?: {
36
+ recursive?: boolean;
37
+ force?: boolean;
38
+ }): Promise<void>;
39
+ cp(src: string, dest: string, options?: {
40
+ recursive?: boolean;
41
+ }): Promise<void>;
42
+ mv(src: string, dest: string): Promise<void>;
43
+ symlink(target: string, path: string): Promise<void>;
44
+ link(existingPath: string, newPath: string): Promise<void>;
45
+ chmod(path: string, mode: number): Promise<void>;
46
+ utimes(path: string, atime: Date, mtime: Date): Promise<void>;
47
+ resolvePath(base: string, ...paths: string[]): string;
48
+ getAllPaths?(): string[];
49
+ }
50
+ /**
51
+ * ArchilFs implements the just-bash IFileSystem interface using Archil protocol.
52
+ *
53
+ * This adapter provides:
54
+ * - Path-to-inode resolution
55
+ * - Full filesystem operations via Archil protocol
56
+ * - Optional user context for permission checks
57
+ *
58
+ * @example
59
+ * ```typescript
60
+ * import { ArchilClient } from '@archildata/native';
61
+ * import { ArchilFs } from '@archildata/just-bash';
62
+ *
63
+ * const client = await ArchilClient.connect({
64
+ * region: 'aws-us-east-1',
65
+ * diskName: 'myaccount/mydisk',
66
+ * authToken: 'adt_xxx',
67
+ * });
68
+ *
69
+ * const fs = await ArchilFs.create(client);
70
+ *
71
+ * // Use with just-bash
72
+ * import { Bash } from 'just-bash';
73
+ * const bash = new Bash({ fs });
74
+ * await bash.run('ls -la /');
75
+ * ```
76
+ */
77
+ declare class ArchilFs implements IFileSystem {
78
+ private client;
79
+ private user?;
80
+ private rootInodeId;
81
+ private constructor();
82
+ /**
83
+ * Create an ArchilFs adapter, optionally rooted at a subdirectory.
84
+ *
85
+ * The subdirectory path is resolved eagerly: if any component does not
86
+ * exist or is not a directory, this method throws immediately.
87
+ *
88
+ * @param client - Connected ArchilClient instance
89
+ * @param options - Optional configuration
90
+ * @param options.user - Unix user context for permission checks
91
+ * @param options.subdirectory - Subdirectory to treat as the root of the filesystem
92
+ */
93
+ static create(client: ArchilClient, options?: {
94
+ user?: UnixUser;
95
+ subdirectory?: string;
96
+ }): Promise<ArchilFs>;
97
+ /**
98
+ * Normalize a path (remove . and .., ensure leading /)
99
+ */
100
+ private normalizePath;
101
+ private static readonly MAX_SYMLINKS;
102
+ /**
103
+ * Resolve a path to its inode ID, walking the directory tree.
104
+ * Follows symlinks on intermediate components but NOT on the final
105
+ * component (matching lstat/readlink semantics).
106
+ */
107
+ private resolve;
108
+ /**
109
+ * Resolve a path, following symlinks on ALL components including the
110
+ * final one (like stat(2)). Use resolve() when you need lstat semantics.
111
+ */
112
+ private resolveFollow;
113
+ /**
114
+ * Resolve parent directory and get child name
115
+ */
116
+ private resolveParent;
117
+ /**
118
+ * Convert InodeAttributes to FsStat
119
+ */
120
+ private toStat;
121
+ private static readonly DIR_PAGE_SIZE;
122
+ /**
123
+ * Read all directory entries using the paginated API.
124
+ */
125
+ private readAllDirectoryEntries;
126
+ resolvePath(base: string, ...paths: string[]): string;
127
+ readFile(path: string, encoding?: BufferEncoding): Promise<string>;
128
+ readFileBuffer(path: string): Promise<Uint8Array>;
129
+ readdir(path: string): Promise<string[]>;
130
+ readdirWithFileTypes(path: string): Promise<DirentEntry[]>;
131
+ stat(path: string): Promise<FsStat>;
132
+ lstat(path: string): Promise<FsStat>;
133
+ exists(path: string): Promise<boolean>;
134
+ readlink(path: string): Promise<string>;
135
+ realpath(path: string, symlinkDepth?: number): Promise<string>;
136
+ writeFile(path: string, content: FileContent): Promise<void>;
137
+ appendFile(path: string, content: FileContent): Promise<void>;
138
+ mkdir(path: string, options?: {
139
+ recursive?: boolean;
140
+ }): Promise<void>;
141
+ private mkdirSingle;
142
+ rm(path: string, options?: {
143
+ recursive?: boolean;
144
+ force?: boolean;
145
+ }): Promise<void>;
146
+ cp(src: string, dest: string, options?: {
147
+ recursive?: boolean;
148
+ }): Promise<void>;
149
+ mv(src: string, dest: string): Promise<void>;
150
+ symlink(target: string, path: string): Promise<void>;
151
+ link(existingPath: string, newPath: string): Promise<void>;
152
+ chmod(path: string, mode: number): Promise<void>;
153
+ utimes(path: string, atime: Date, mtime: Date): Promise<void>;
154
+ getAllPaths(): string[];
155
+ /**
156
+ * Resolve a path to its inode ID (public wrapper for delegation operations)
157
+ */
158
+ resolveInodeId(path: string): Promise<number>;
159
+ }
160
+ //#endregion
161
+ //#region src/commands.d.ts
162
+ /**
163
+ * Create the `archil` custom command for use with just-bash.
164
+ *
165
+ * Provides checkout/checkin delegation management, delegation listing, and
166
+ * cache control (invalidate-cache, set-cache-expiry) as a shell command that
167
+ * works in scripts, pipes, and interactive use.
168
+ *
169
+ * @example
170
+ * ```typescript
171
+ * import { Bash } from 'just-bash';
172
+ * import { ArchilFs, createArchilCommand } from '@archildata/just-bash';
173
+ *
174
+ * const fs = await ArchilFs.create(client);
175
+ * const bash = new Bash({
176
+ * fs,
177
+ * customCommands: [createArchilCommand(client, fs)],
178
+ * });
179
+ *
180
+ * await bash.exec('archil checkout /mydir');
181
+ * await bash.exec('echo "hello" > /mydir/file.txt');
182
+ * await bash.exec('archil checkin /mydir');
183
+ * ```
184
+ */
185
+ declare function createArchilCommand(client: ArchilClient, fs: ArchilFs): import("just-bash").Command;
186
+ //#endregion
187
+ //#region src/index.d.ts
188
+ /**
189
+ * Create an ArchilFs instance, optionally rooted at a subdirectory.
190
+ *
191
+ * @param client - Connected ArchilClient instance
192
+ * @param options - Optional configuration
193
+ * @returns Configured ArchilFs instance
194
+ *
195
+ * @example
196
+ * ```typescript
197
+ * import { ArchilClient } from '@archildata/native';
198
+ * import { createArchilFs } from '@archildata/just-bash';
199
+ *
200
+ * const client = await ArchilClient.connectAuthenticated({...});
201
+ * const fs = await createArchilFs(client, { user: { uid: 1000, gid: 1000 } });
202
+ * ```
203
+ */
204
+ declare function createArchilFs(client: import("@archildata/native").ArchilClient, options?: {
205
+ user?: import("@archildata/native").UnixUser;
206
+ subdirectory?: string;
207
+ }): Promise<ArchilFs>;
208
+ //#endregion
209
+ export { ArchilFs, type BufferEncoding, type DirentEntry, type FileContent, type FsStat, type IFileSystem, createArchilCommand, createArchilFs };
210
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/ArchilFs.ts","../src/commands.ts","../src/index.ts"],"mappings":";;;KAcY,cAAA;AAAA,KASA,WAAA,YAAuB,UAAU;AAAA,UAE5B,MAAA;EACf,MAAA;EACA,WAAA;EACA,cAAA;EACA,IAAA;EACA,IAAA;EACA,KAAA,EAAO,IAAI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