@aigne/afs-cli 1.11.0-beta.5 → 1.11.0-beta.7
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/cli.cjs +25 -328
- package/dist/cli.d.cts +2 -1
- package/dist/cli.d.mts +2 -1
- package/dist/cli.mjs +26 -328
- package/dist/cli.mjs.map +1 -1
- package/dist/config/afs-loader.cjs +123 -0
- package/dist/config/afs-loader.d.cts +14 -0
- package/dist/config/afs-loader.d.cts.map +1 -0
- package/dist/config/afs-loader.d.mts +14 -0
- package/dist/config/afs-loader.d.mts.map +1 -0
- package/dist/config/afs-loader.mjs +122 -0
- package/dist/config/afs-loader.mjs.map +1 -0
- package/dist/config/loader.cjs +14 -3
- package/dist/config/loader.mjs +14 -3
- package/dist/config/loader.mjs.map +1 -1
- package/dist/{commands/mount.cjs → config/mount-commands.cjs} +13 -49
- package/dist/config/mount-commands.d.cts +20 -0
- package/dist/config/mount-commands.d.cts.map +1 -0
- package/dist/config/mount-commands.d.mts +20 -0
- package/dist/config/mount-commands.d.mts.map +1 -0
- package/dist/{commands/mount.mjs → config/mount-commands.mjs} +14 -49
- package/dist/config/mount-commands.mjs.map +1 -0
- package/dist/config/schema.cjs +9 -1
- package/dist/config/schema.mjs +9 -1
- package/dist/config/schema.mjs.map +1 -1
- package/dist/core/commands/delete.cjs +41 -0
- package/dist/core/commands/delete.d.cts +18 -0
- package/dist/core/commands/delete.d.cts.map +1 -0
- package/dist/core/commands/delete.d.mts +18 -0
- package/dist/core/commands/delete.d.mts.map +1 -0
- package/dist/core/commands/delete.mjs +42 -0
- package/dist/core/commands/delete.mjs.map +1 -0
- package/dist/core/commands/exec.cjs +95 -0
- package/dist/core/commands/exec.d.cts +26 -0
- package/dist/core/commands/exec.d.cts.map +1 -0
- package/dist/core/commands/exec.d.mts +26 -0
- package/dist/core/commands/exec.d.mts.map +1 -0
- package/dist/core/commands/exec.mjs +96 -0
- package/dist/core/commands/exec.mjs.map +1 -0
- package/dist/core/commands/explain.cjs +254 -0
- package/dist/core/commands/explain.d.cts +25 -0
- package/dist/core/commands/explain.d.cts.map +1 -0
- package/dist/core/commands/explain.d.mts +25 -0
- package/dist/core/commands/explain.d.mts.map +1 -0
- package/dist/core/commands/explain.mjs +255 -0
- package/dist/core/commands/explain.mjs.map +1 -0
- package/dist/core/commands/explore.cjs +30 -0
- package/dist/core/commands/explore.d.mts +2 -0
- package/dist/core/commands/explore.mjs +31 -0
- package/dist/core/commands/explore.mjs.map +1 -0
- package/dist/core/commands/index.cjs +36 -0
- package/dist/core/commands/index.d.cts +21 -0
- package/dist/core/commands/index.d.cts.map +1 -0
- package/dist/core/commands/index.d.mts +24 -0
- package/dist/core/commands/index.d.mts.map +1 -0
- package/dist/core/commands/index.mjs +37 -0
- package/dist/core/commands/index.mjs.map +1 -0
- package/dist/core/commands/ls.cjs +57 -0
- package/dist/core/commands/ls.d.cts +21 -0
- package/dist/core/commands/ls.d.cts.map +1 -0
- package/dist/core/commands/ls.d.mts +21 -0
- package/dist/core/commands/ls.d.mts.map +1 -0
- package/dist/core/commands/ls.mjs +58 -0
- package/dist/core/commands/ls.mjs.map +1 -0
- package/dist/core/commands/mount.cjs +139 -0
- package/dist/core/commands/mount.d.cts +33 -0
- package/dist/core/commands/mount.d.cts.map +1 -0
- package/dist/core/commands/mount.d.mts +33 -0
- package/dist/core/commands/mount.d.mts.map +1 -0
- package/dist/core/commands/mount.mjs +140 -0
- package/dist/core/commands/mount.mjs.map +1 -0
- package/dist/core/commands/read.cjs +48 -0
- package/dist/core/commands/read.d.cts +17 -0
- package/dist/core/commands/read.d.cts.map +1 -0
- package/dist/core/commands/read.d.mts +17 -0
- package/dist/core/commands/read.d.mts.map +1 -0
- package/dist/core/commands/read.mjs +49 -0
- package/dist/core/commands/read.mjs.map +1 -0
- package/dist/core/commands/search.cjs +40 -0
- package/dist/core/commands/search.d.mts +2 -0
- package/dist/core/commands/search.mjs +41 -0
- package/dist/core/commands/search.mjs.map +1 -0
- package/dist/core/commands/serve.cjs +242 -0
- package/dist/core/commands/serve.d.mts +2 -0
- package/dist/core/commands/serve.mjs +242 -0
- package/dist/core/commands/serve.mjs.map +1 -0
- package/dist/core/commands/stat.cjs +53 -0
- package/dist/core/commands/stat.d.cts +17 -0
- package/dist/core/commands/stat.d.cts.map +1 -0
- package/dist/core/commands/stat.d.mts +17 -0
- package/dist/core/commands/stat.d.mts.map +1 -0
- package/dist/core/commands/stat.mjs +54 -0
- package/dist/core/commands/stat.mjs.map +1 -0
- package/dist/core/commands/types.cjs +13 -0
- package/dist/core/commands/types.d.cts +54 -0
- package/dist/core/commands/types.d.cts.map +1 -0
- package/dist/core/commands/types.d.mts +54 -0
- package/dist/core/commands/types.d.mts.map +1 -0
- package/dist/core/commands/types.mjs +14 -0
- package/dist/core/commands/types.mjs.map +1 -0
- package/dist/core/commands/write.cjs +70 -0
- package/dist/core/commands/write.d.cts +20 -0
- package/dist/core/commands/write.d.cts.map +1 -0
- package/dist/core/commands/write.d.mts +20 -0
- package/dist/core/commands/write.d.mts.map +1 -0
- package/dist/core/commands/write.mjs +71 -0
- package/dist/core/commands/write.mjs.map +1 -0
- package/dist/core/executor/index.cjs +196 -0
- package/dist/core/executor/index.d.cts +77 -0
- package/dist/core/executor/index.d.cts.map +1 -0
- package/dist/core/executor/index.d.mts +77 -0
- package/dist/core/executor/index.d.mts.map +1 -0
- package/dist/core/executor/index.mjs +195 -0
- package/dist/core/executor/index.mjs.map +1 -0
- package/dist/core/formatters/delete.cjs +37 -0
- package/dist/core/formatters/delete.d.cts +18 -0
- package/dist/core/formatters/delete.d.cts.map +1 -0
- package/dist/core/formatters/delete.d.mts +18 -0
- package/dist/core/formatters/delete.d.mts.map +1 -0
- package/dist/core/formatters/delete.mjs +37 -0
- package/dist/core/formatters/delete.mjs.map +1 -0
- package/dist/core/formatters/exec.cjs +60 -0
- package/dist/core/formatters/exec.d.cts +18 -0
- package/dist/core/formatters/exec.d.cts.map +1 -0
- package/dist/core/formatters/exec.d.mts +18 -0
- package/dist/core/formatters/exec.d.mts.map +1 -0
- package/dist/core/formatters/exec.mjs +60 -0
- package/dist/core/formatters/exec.mjs.map +1 -0
- package/dist/core/formatters/explain.cjs +97 -0
- package/dist/core/formatters/explain.d.cts +11 -0
- package/dist/core/formatters/explain.d.cts.map +1 -0
- package/dist/core/formatters/explain.d.mts +11 -0
- package/dist/core/formatters/explain.d.mts.map +1 -0
- package/dist/core/formatters/explain.mjs +96 -0
- package/dist/core/formatters/explain.mjs.map +1 -0
- package/dist/core/formatters/index.d.mts +9 -0
- package/dist/core/formatters/ls.cjs +179 -0
- package/dist/core/formatters/ls.d.cts +20 -0
- package/dist/core/formatters/ls.d.cts.map +1 -0
- package/dist/core/formatters/ls.d.mts +20 -0
- package/dist/core/formatters/ls.d.mts.map +1 -0
- package/dist/core/formatters/ls.mjs +179 -0
- package/dist/core/formatters/ls.mjs.map +1 -0
- package/dist/core/formatters/mount.cjs +55 -0
- package/dist/core/formatters/mount.d.cts +15 -0
- package/dist/core/formatters/mount.d.cts.map +1 -0
- package/dist/core/formatters/mount.d.mts +15 -0
- package/dist/core/formatters/mount.d.mts.map +1 -0
- package/dist/core/formatters/mount.mjs +55 -0
- package/dist/core/formatters/mount.mjs.map +1 -0
- package/dist/core/formatters/read.cjs +100 -0
- package/dist/core/formatters/read.d.cts +22 -0
- package/dist/core/formatters/read.d.cts.map +1 -0
- package/dist/core/formatters/read.d.mts +22 -0
- package/dist/core/formatters/read.d.mts.map +1 -0
- package/dist/core/formatters/read.mjs +100 -0
- package/dist/core/formatters/read.mjs.map +1 -0
- package/dist/core/formatters/search.cjs +44 -0
- package/dist/core/formatters/search.d.mts +1 -0
- package/dist/core/formatters/search.mjs +44 -0
- package/dist/core/formatters/search.mjs.map +1 -0
- package/dist/core/formatters/stat.cjs +155 -0
- package/dist/core/formatters/stat.d.cts +15 -0
- package/dist/core/formatters/stat.d.cts.map +1 -0
- package/dist/core/formatters/stat.d.mts +15 -0
- package/dist/core/formatters/stat.d.mts.map +1 -0
- package/dist/core/formatters/stat.mjs +155 -0
- package/dist/core/formatters/stat.mjs.map +1 -0
- package/dist/core/formatters/write.cjs +51 -0
- package/dist/core/formatters/write.d.cts +22 -0
- package/dist/core/formatters/write.d.cts.map +1 -0
- package/dist/core/formatters/write.d.mts +22 -0
- package/dist/core/formatters/write.d.mts.map +1 -0
- package/dist/core/formatters/write.mjs +51 -0
- package/dist/core/formatters/write.mjs.map +1 -0
- package/dist/core/helpers/exec-args.cjs +142 -0
- package/dist/core/helpers/exec-args.d.cts +46 -0
- package/dist/core/helpers/exec-args.d.cts.map +1 -0
- package/dist/core/helpers/exec-args.d.mts +46 -0
- package/dist/core/helpers/exec-args.d.mts.map +1 -0
- package/dist/core/helpers/exec-args.mjs +139 -0
- package/dist/core/helpers/exec-args.mjs.map +1 -0
- package/dist/core/helpers/stdin.cjs +41 -0
- package/dist/core/helpers/stdin.d.cts +15 -0
- package/dist/core/helpers/stdin.d.cts.map +1 -0
- package/dist/core/helpers/stdin.d.mts +15 -0
- package/dist/core/helpers/stdin.d.mts.map +1 -0
- package/dist/core/helpers/stdin.mjs +41 -0
- package/dist/core/helpers/stdin.mjs.map +1 -0
- package/dist/core/index.cjs +49 -0
- package/dist/core/index.d.cts +24 -0
- package/dist/core/index.d.mts +25 -0
- package/dist/core/index.mjs +24 -0
- package/dist/core/path-utils.cjs +1 -0
- package/dist/core/path-utils.mjs +3 -0
- package/dist/core/types.d.cts +24 -0
- package/dist/core/types.d.cts.map +1 -0
- package/dist/core/types.d.mts +24 -0
- package/dist/core/types.d.mts.map +1 -0
- package/dist/errors.cjs +0 -11
- package/dist/errors.mjs +1 -11
- package/dist/errors.mjs.map +1 -1
- package/dist/explorer/actions.cjs +113 -48
- package/dist/explorer/actions.mjs +113 -48
- package/dist/explorer/actions.mjs.map +1 -1
- package/dist/explorer/components/dialog.cjs +287 -10
- package/dist/explorer/components/dialog.mjs +287 -10
- package/dist/explorer/components/dialog.mjs.map +1 -1
- package/dist/explorer/components/file-list.mjs.map +1 -1
- package/dist/explorer/components/metadata-panel.cjs +121 -24
- package/dist/explorer/components/metadata-panel.mjs +121 -24
- package/dist/explorer/components/metadata-panel.mjs.map +1 -1
- package/dist/explorer/screen.cjs +72 -21
- package/dist/explorer/screen.d.cts +23 -0
- package/dist/explorer/screen.d.cts.map +1 -0
- package/dist/explorer/screen.d.mts +23 -0
- package/dist/explorer/screen.d.mts.map +1 -0
- package/dist/explorer/screen.mjs +73 -22
- package/dist/explorer/screen.mjs.map +1 -1
- package/dist/explorer/theme.cjs +4 -2
- package/dist/explorer/theme.mjs +4 -2
- package/dist/explorer/theme.mjs.map +1 -1
- package/dist/index.cjs +7 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.mts +4 -1
- package/dist/index.mjs +4 -1
- package/dist/mcp/http-transport.cjs +68 -0
- package/dist/mcp/http-transport.mjs +68 -0
- package/dist/mcp/http-transport.mjs.map +1 -0
- package/dist/mcp/prompts.cjs +48 -0
- package/dist/mcp/prompts.mjs +48 -0
- package/dist/mcp/prompts.mjs.map +1 -0
- package/dist/mcp/resources.cjs +25 -0
- package/dist/mcp/resources.mjs +25 -0
- package/dist/mcp/resources.mjs.map +1 -0
- package/dist/mcp/server.cjs +30 -0
- package/dist/mcp/server.mjs +30 -0
- package/dist/mcp/server.mjs.map +1 -0
- package/dist/mcp/tools.cjs +196 -0
- package/dist/mcp/tools.mjs +196 -0
- package/dist/mcp/tools.mjs.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.cts +10 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.mts +10 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/index.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.cts +46 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.cts.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.mts +46 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/types.d.mts.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.cjs +902 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.mjs +902 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/dist/urlpattern.mjs.map +1 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.cjs +6 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.mjs +8 -0
- package/dist/node_modules/.pnpm/urlpattern-polyfill@10.1.0/node_modules/urlpattern-polyfill/index.mjs.map +1 -0
- package/dist/path-utils.cjs +2 -1
- package/dist/path-utils.d.cts +50 -0
- package/dist/path-utils.d.cts.map +1 -0
- package/dist/path-utils.d.mts +50 -0
- package/dist/path-utils.d.mts.map +1 -0
- package/dist/path-utils.mjs +1 -1
- package/dist/repl.cjs +485 -0
- package/dist/repl.d.cts +15 -0
- package/dist/repl.d.cts.map +1 -0
- package/dist/repl.d.mts +16 -0
- package/dist/repl.d.mts.map +1 -0
- package/dist/repl.mjs +485 -0
- package/dist/repl.mjs.map +1 -0
- package/dist/serve.cjs +146 -0
- package/dist/serve.d.cts +41 -0
- package/dist/serve.d.cts.map +1 -0
- package/dist/serve.d.mts +41 -0
- package/dist/serve.d.mts.map +1 -0
- package/dist/serve.mjs +146 -0
- package/dist/serve.mjs.map +1 -0
- package/dist/ui/header.cjs +1 -49
- package/dist/ui/header.mjs +1 -47
- package/dist/ui/header.mjs.map +1 -1
- package/dist/ui/index.cjs +2 -11
- package/dist/ui/index.mjs +2 -8
- package/dist/ui/index.mjs.map +1 -1
- package/dist/ui/terminal.cjs +1 -10
- package/dist/ui/terminal.mjs +1 -8
- package/dist/ui/terminal.mjs.map +1 -1
- package/package.json +32 -9
- package/dist/commands/exec.cjs +0 -46
- package/dist/commands/exec.mjs +0 -45
- package/dist/commands/exec.mjs.map +0 -1
- package/dist/commands/explain.cjs +0 -244
- package/dist/commands/explain.mjs +0 -242
- package/dist/commands/explain.mjs.map +0 -1
- package/dist/commands/index.cjs +0 -8
- package/dist/commands/index.mjs +0 -10
- package/dist/commands/ls.cjs +0 -143
- package/dist/commands/ls.mjs +0 -143
- package/dist/commands/ls.mjs.map +0 -1
- package/dist/commands/mount.mjs.map +0 -1
- package/dist/commands/read.cjs +0 -65
- package/dist/commands/read.mjs +0 -64
- package/dist/commands/read.mjs.map +0 -1
- package/dist/commands/serve.cjs +0 -144
- package/dist/commands/serve.mjs +0 -143
- package/dist/commands/serve.mjs.map +0 -1
- package/dist/commands/stat.cjs +0 -113
- package/dist/commands/stat.mjs +0 -112
- package/dist/commands/stat.mjs.map +0 -1
- package/dist/commands/write.cjs +0 -52
- package/dist/commands/write.mjs +0 -51
- package/dist/commands/write.mjs.map +0 -1
- package/dist/config/provider-factory.cjs +0 -93
- package/dist/config/provider-factory.mjs +0 -94
- package/dist/config/provider-factory.mjs.map +0 -1
- package/dist/config/uri-parser.cjs +0 -92
- package/dist/config/uri-parser.mjs +0 -92
- package/dist/config/uri-parser.mjs.map +0 -1
- package/dist/runtime.cjs +0 -96
- package/dist/runtime.mjs +0 -96
- package/dist/runtime.mjs.map +0 -1
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
const require_uri_parser = require('./uri-parser.cjs');
|
|
2
|
-
|
|
3
|
-
//#region src/config/provider-factory.ts
|
|
4
|
-
/**
|
|
5
|
-
* Create an AFS provider from a mount configuration
|
|
6
|
-
*
|
|
7
|
-
* @param mount - Mount configuration with URI and options
|
|
8
|
-
* @returns Provider instance
|
|
9
|
-
* @throws Error if scheme is unknown or not implemented
|
|
10
|
-
*/
|
|
11
|
-
async function createProvider(mount) {
|
|
12
|
-
const parsed = require_uri_parser.parseURI(mount.uri);
|
|
13
|
-
switch (parsed.scheme) {
|
|
14
|
-
case "fs": return createAFSFSProvider(mount, parsed.path);
|
|
15
|
-
case "git": return createGitProvider(mount, parsed.path, parsed.params, parsed.host);
|
|
16
|
-
case "sqlite": return createSQLiteProvider(mount, parsed.path);
|
|
17
|
-
case "json": return createJSONProvider(mount, parsed.path);
|
|
18
|
-
case "http":
|
|
19
|
-
case "https": return createHttpProvider(mount);
|
|
20
|
-
default: throw new Error(`Unknown URI scheme: ${parsed.scheme}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
async function createAFSFSProvider(mount, localPath) {
|
|
24
|
-
const { AFSFS } = await import("@aigne/afs-fs");
|
|
25
|
-
return new AFSFS({
|
|
26
|
-
localPath,
|
|
27
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "fs",
|
|
28
|
-
description: mount.description,
|
|
29
|
-
accessMode: mount.access_mode,
|
|
30
|
-
...mount.options
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
async function createGitProvider(mount, repoPath, params, host) {
|
|
34
|
-
const { AFSGit } = await import("@aigne/afs-git");
|
|
35
|
-
if (host) return new AFSGit({
|
|
36
|
-
remoteUrl: `git@${host}:${repoPath}`,
|
|
37
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "git",
|
|
38
|
-
description: mount.description,
|
|
39
|
-
accessMode: mount.access_mode ?? "readonly",
|
|
40
|
-
branches: params.branch ? [params.branch] : void 0,
|
|
41
|
-
...mount.options
|
|
42
|
-
});
|
|
43
|
-
if (repoPath.startsWith("https://") || repoPath.startsWith("http://")) return new AFSGit({
|
|
44
|
-
remoteUrl: repoPath,
|
|
45
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "git",
|
|
46
|
-
description: mount.description,
|
|
47
|
-
accessMode: mount.access_mode ?? "readonly",
|
|
48
|
-
branches: params.branch ? [params.branch] : void 0,
|
|
49
|
-
...mount.options
|
|
50
|
-
});
|
|
51
|
-
return new AFSGit({
|
|
52
|
-
repoPath,
|
|
53
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "git",
|
|
54
|
-
description: mount.description,
|
|
55
|
-
accessMode: mount.access_mode ?? "readonly",
|
|
56
|
-
branches: params.branch ? [params.branch] : void 0,
|
|
57
|
-
...mount.options
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
async function createSQLiteProvider(mount, dbPath) {
|
|
61
|
-
const { SQLiteAFS } = await import("@aigne/afs-sqlite");
|
|
62
|
-
return new SQLiteAFS({
|
|
63
|
-
url: `file:${dbPath}`,
|
|
64
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "sqlite",
|
|
65
|
-
description: mount.description,
|
|
66
|
-
accessMode: mount.access_mode,
|
|
67
|
-
...mount.options
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
async function createJSONProvider(mount, jsonPath) {
|
|
71
|
-
const { AFSJSON } = await import("@aigne/afs-json");
|
|
72
|
-
return new AFSJSON({
|
|
73
|
-
jsonPath,
|
|
74
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "json",
|
|
75
|
-
description: mount.description,
|
|
76
|
-
accessMode: mount.access_mode,
|
|
77
|
-
...mount.options
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
async function createHttpProvider(mount) {
|
|
81
|
-
const { AFSHttpClient } = await import("@aigne/afs-http");
|
|
82
|
-
return new AFSHttpClient({
|
|
83
|
-
url: mount.uri,
|
|
84
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "http",
|
|
85
|
-
description: mount.description,
|
|
86
|
-
accessMode: mount.access_mode,
|
|
87
|
-
token: mount.token,
|
|
88
|
-
...mount.options
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
//#endregion
|
|
93
|
-
exports.createProvider = createProvider;
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { parseURI } from "./uri-parser.mjs";
|
|
2
|
-
|
|
3
|
-
//#region src/config/provider-factory.ts
|
|
4
|
-
/**
|
|
5
|
-
* Create an AFS provider from a mount configuration
|
|
6
|
-
*
|
|
7
|
-
* @param mount - Mount configuration with URI and options
|
|
8
|
-
* @returns Provider instance
|
|
9
|
-
* @throws Error if scheme is unknown or not implemented
|
|
10
|
-
*/
|
|
11
|
-
async function createProvider(mount) {
|
|
12
|
-
const parsed = parseURI(mount.uri);
|
|
13
|
-
switch (parsed.scheme) {
|
|
14
|
-
case "fs": return createAFSFSProvider(mount, parsed.path);
|
|
15
|
-
case "git": return createGitProvider(mount, parsed.path, parsed.params, parsed.host);
|
|
16
|
-
case "sqlite": return createSQLiteProvider(mount, parsed.path);
|
|
17
|
-
case "json": return createJSONProvider(mount, parsed.path);
|
|
18
|
-
case "http":
|
|
19
|
-
case "https": return createHttpProvider(mount);
|
|
20
|
-
default: throw new Error(`Unknown URI scheme: ${parsed.scheme}`);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
async function createAFSFSProvider(mount, localPath) {
|
|
24
|
-
const { AFSFS } = await import("@aigne/afs-fs");
|
|
25
|
-
return new AFSFS({
|
|
26
|
-
localPath,
|
|
27
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "fs",
|
|
28
|
-
description: mount.description,
|
|
29
|
-
accessMode: mount.access_mode,
|
|
30
|
-
...mount.options
|
|
31
|
-
});
|
|
32
|
-
}
|
|
33
|
-
async function createGitProvider(mount, repoPath, params, host) {
|
|
34
|
-
const { AFSGit } = await import("@aigne/afs-git");
|
|
35
|
-
if (host) return new AFSGit({
|
|
36
|
-
remoteUrl: `git@${host}:${repoPath}`,
|
|
37
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "git",
|
|
38
|
-
description: mount.description,
|
|
39
|
-
accessMode: mount.access_mode ?? "readonly",
|
|
40
|
-
branches: params.branch ? [params.branch] : void 0,
|
|
41
|
-
...mount.options
|
|
42
|
-
});
|
|
43
|
-
if (repoPath.startsWith("https://") || repoPath.startsWith("http://")) return new AFSGit({
|
|
44
|
-
remoteUrl: repoPath,
|
|
45
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "git",
|
|
46
|
-
description: mount.description,
|
|
47
|
-
accessMode: mount.access_mode ?? "readonly",
|
|
48
|
-
branches: params.branch ? [params.branch] : void 0,
|
|
49
|
-
...mount.options
|
|
50
|
-
});
|
|
51
|
-
return new AFSGit({
|
|
52
|
-
repoPath,
|
|
53
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "git",
|
|
54
|
-
description: mount.description,
|
|
55
|
-
accessMode: mount.access_mode ?? "readonly",
|
|
56
|
-
branches: params.branch ? [params.branch] : void 0,
|
|
57
|
-
...mount.options
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
async function createSQLiteProvider(mount, dbPath) {
|
|
61
|
-
const { SQLiteAFS } = await import("@aigne/afs-sqlite");
|
|
62
|
-
return new SQLiteAFS({
|
|
63
|
-
url: `file:${dbPath}`,
|
|
64
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "sqlite",
|
|
65
|
-
description: mount.description,
|
|
66
|
-
accessMode: mount.access_mode,
|
|
67
|
-
...mount.options
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
async function createJSONProvider(mount, jsonPath) {
|
|
71
|
-
const { AFSJSON } = await import("@aigne/afs-json");
|
|
72
|
-
return new AFSJSON({
|
|
73
|
-
jsonPath,
|
|
74
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "json",
|
|
75
|
-
description: mount.description,
|
|
76
|
-
accessMode: mount.access_mode,
|
|
77
|
-
...mount.options
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
async function createHttpProvider(mount) {
|
|
81
|
-
const { AFSHttpClient } = await import("@aigne/afs-http");
|
|
82
|
-
return new AFSHttpClient({
|
|
83
|
-
url: mount.uri,
|
|
84
|
-
name: mount.path.slice(1).replace(/\//g, "-") || "http",
|
|
85
|
-
description: mount.description,
|
|
86
|
-
accessMode: mount.access_mode,
|
|
87
|
-
token: mount.token,
|
|
88
|
-
...mount.options
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
//#endregion
|
|
93
|
-
export { createProvider };
|
|
94
|
-
//# sourceMappingURL=provider-factory.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"provider-factory.mjs","names":[],"sources":["../../src/config/provider-factory.ts"],"sourcesContent":["import type { AFSModule } from \"@aigne/afs\";\nimport type { MountConfig } from \"./schema.js\";\nimport { parseURI } from \"./uri-parser.js\";\n\n/**\n * Create an AFS provider from a mount configuration\n *\n * @param mount - Mount configuration with URI and options\n * @returns Provider instance\n * @throws Error if scheme is unknown or not implemented\n */\nexport async function createProvider(mount: MountConfig): Promise<AFSModule> {\n const parsed = parseURI(mount.uri);\n\n switch (parsed.scheme) {\n case \"fs\":\n return createAFSFSProvider(mount, parsed.path);\n\n case \"git\":\n return createGitProvider(mount, parsed.path, parsed.params, parsed.host);\n\n case \"sqlite\":\n return createSQLiteProvider(mount, parsed.path);\n\n case \"json\":\n return createJSONProvider(mount, parsed.path);\n\n case \"http\":\n case \"https\":\n return createHttpProvider(mount);\n\n default:\n throw new Error(`Unknown URI scheme: ${parsed.scheme}`);\n }\n}\n\nasync function createAFSFSProvider(mount: MountConfig, localPath: string): Promise<AFSModule> {\n const { AFSFS } = await import(\"@aigne/afs-fs\");\n\n return new AFSFS({\n localPath,\n name: mount.path.slice(1).replace(/\\//g, \"-\") || \"fs\",\n description: mount.description,\n accessMode: mount.access_mode,\n ...mount.options,\n });\n}\n\nasync function createGitProvider(\n mount: MountConfig,\n repoPath: string,\n params: Record<string, string>,\n host?: string,\n): Promise<AFSModule> {\n const { AFSGit } = await import(\"@aigne/afs-git\");\n\n // For remote repos (SSH-style or https), use remoteUrl\n // For local repos, use repoPath directly\n if (host) {\n const remoteUrl = `git@${host}:${repoPath}`;\n return new AFSGit({\n remoteUrl,\n name: mount.path.slice(1).replace(/\\//g, \"-\") || \"git\",\n description: mount.description,\n accessMode: mount.access_mode ?? \"readonly\",\n branches: params.branch ? [params.branch] : undefined,\n ...mount.options,\n });\n }\n\n // Check if repoPath is actually a remote URL (https:// or http://)\n if (repoPath.startsWith(\"https://\") || repoPath.startsWith(\"http://\")) {\n return new AFSGit({\n remoteUrl: repoPath,\n name: mount.path.slice(1).replace(/\\//g, \"-\") || \"git\",\n description: mount.description,\n accessMode: mount.access_mode ?? \"readonly\",\n branches: params.branch ? [params.branch] : undefined,\n ...mount.options,\n });\n }\n\n return new AFSGit({\n repoPath,\n name: mount.path.slice(1).replace(/\\//g, \"-\") || \"git\",\n description: mount.description,\n accessMode: mount.access_mode ?? \"readonly\",\n branches: params.branch ? [params.branch] : undefined,\n ...mount.options,\n });\n}\n\nasync function createSQLiteProvider(mount: MountConfig, dbPath: string): Promise<AFSModule> {\n const { SQLiteAFS } = await import(\"@aigne/afs-sqlite\");\n\n // SQLiteAFS auto-initializes via onMount when mounted to AFS\n return new SQLiteAFS({\n url: `file:${dbPath}`,\n name: mount.path.slice(1).replace(/\\//g, \"-\") || \"sqlite\",\n description: mount.description,\n accessMode: mount.access_mode,\n ...mount.options,\n });\n}\n\nasync function createJSONProvider(mount: MountConfig, jsonPath: string): Promise<AFSModule> {\n const { AFSJSON } = await import(\"@aigne/afs-json\");\n\n return new AFSJSON({\n jsonPath,\n name: mount.path.slice(1).replace(/\\//g, \"-\") || \"json\",\n description: mount.description,\n accessMode: mount.access_mode,\n ...mount.options,\n });\n}\n\nasync function createHttpProvider(mount: MountConfig): Promise<AFSModule> {\n const { AFSHttpClient } = await import(\"@aigne/afs-http\");\n\n return new AFSHttpClient({\n url: mount.uri,\n name: mount.path.slice(1).replace(/\\//g, \"-\") || \"http\",\n description: mount.description,\n accessMode: mount.access_mode,\n token: mount.token,\n ...mount.options,\n });\n}\n"],"mappings":";;;;;;;;;;AAWA,eAAsB,eAAe,OAAwC;CAC3E,MAAM,SAAS,SAAS,MAAM,IAAI;AAElC,SAAQ,OAAO,QAAf;EACE,KAAK,KACH,QAAO,oBAAoB,OAAO,OAAO,KAAK;EAEhD,KAAK,MACH,QAAO,kBAAkB,OAAO,OAAO,MAAM,OAAO,QAAQ,OAAO,KAAK;EAE1E,KAAK,SACH,QAAO,qBAAqB,OAAO,OAAO,KAAK;EAEjD,KAAK,OACH,QAAO,mBAAmB,OAAO,OAAO,KAAK;EAE/C,KAAK;EACL,KAAK,QACH,QAAO,mBAAmB,MAAM;EAElC,QACE,OAAM,IAAI,MAAM,uBAAuB,OAAO,SAAS;;;AAI7D,eAAe,oBAAoB,OAAoB,WAAuC;CAC5F,MAAM,EAAE,UAAU,MAAM,OAAO;AAE/B,QAAO,IAAI,MAAM;EACf;EACA,MAAM,MAAM,KAAK,MAAM,EAAE,CAAC,QAAQ,OAAO,IAAI,IAAI;EACjD,aAAa,MAAM;EACnB,YAAY,MAAM;EAClB,GAAG,MAAM;EACV,CAAC;;AAGJ,eAAe,kBACb,OACA,UACA,QACA,MACoB;CACpB,MAAM,EAAE,WAAW,MAAM,OAAO;AAIhC,KAAI,KAEF,QAAO,IAAI,OAAO;EAChB,WAFgB,OAAO,KAAK,GAAG;EAG/B,MAAM,MAAM,KAAK,MAAM,EAAE,CAAC,QAAQ,OAAO,IAAI,IAAI;EACjD,aAAa,MAAM;EACnB,YAAY,MAAM,eAAe;EACjC,UAAU,OAAO,SAAS,CAAC,OAAO,OAAO,GAAG;EAC5C,GAAG,MAAM;EACV,CAAC;AAIJ,KAAI,SAAS,WAAW,WAAW,IAAI,SAAS,WAAW,UAAU,CACnE,QAAO,IAAI,OAAO;EAChB,WAAW;EACX,MAAM,MAAM,KAAK,MAAM,EAAE,CAAC,QAAQ,OAAO,IAAI,IAAI;EACjD,aAAa,MAAM;EACnB,YAAY,MAAM,eAAe;EACjC,UAAU,OAAO,SAAS,CAAC,OAAO,OAAO,GAAG;EAC5C,GAAG,MAAM;EACV,CAAC;AAGJ,QAAO,IAAI,OAAO;EAChB;EACA,MAAM,MAAM,KAAK,MAAM,EAAE,CAAC,QAAQ,OAAO,IAAI,IAAI;EACjD,aAAa,MAAM;EACnB,YAAY,MAAM,eAAe;EACjC,UAAU,OAAO,SAAS,CAAC,OAAO,OAAO,GAAG;EAC5C,GAAG,MAAM;EACV,CAAC;;AAGJ,eAAe,qBAAqB,OAAoB,QAAoC;CAC1F,MAAM,EAAE,cAAc,MAAM,OAAO;AAGnC,QAAO,IAAI,UAAU;EACnB,KAAK,QAAQ;EACb,MAAM,MAAM,KAAK,MAAM,EAAE,CAAC,QAAQ,OAAO,IAAI,IAAI;EACjD,aAAa,MAAM;EACnB,YAAY,MAAM;EAClB,GAAG,MAAM;EACV,CAAC;;AAGJ,eAAe,mBAAmB,OAAoB,UAAsC;CAC1F,MAAM,EAAE,YAAY,MAAM,OAAO;AAEjC,QAAO,IAAI,QAAQ;EACjB;EACA,MAAM,MAAM,KAAK,MAAM,EAAE,CAAC,QAAQ,OAAO,IAAI,IAAI;EACjD,aAAa,MAAM;EACnB,YAAY,MAAM;EAClB,GAAG,MAAM;EACV,CAAC;;AAGJ,eAAe,mBAAmB,OAAwC;CACxE,MAAM,EAAE,kBAAkB,MAAM,OAAO;AAEvC,QAAO,IAAI,cAAc;EACvB,KAAK,MAAM;EACX,MAAM,MAAM,KAAK,MAAM,EAAE,CAAC,QAAQ,OAAO,IAAI,IAAI;EACjD,aAAa,MAAM;EACnB,YAAY,MAAM;EAClB,OAAO,MAAM;EACb,GAAG,MAAM;EACV,CAAC"}
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/config/uri-parser.ts
|
|
3
|
-
const SUPPORTED_SCHEMES = new Set([
|
|
4
|
-
"fs",
|
|
5
|
-
"git",
|
|
6
|
-
"sqlite",
|
|
7
|
-
"json",
|
|
8
|
-
"http",
|
|
9
|
-
"https"
|
|
10
|
-
]);
|
|
11
|
-
/**
|
|
12
|
-
* Parse an AFS URI into components
|
|
13
|
-
*
|
|
14
|
-
* Supported formats:
|
|
15
|
-
* - fs:///path/to/dir
|
|
16
|
-
* - git:///path/to/repo?branch=main
|
|
17
|
-
* - git@github.com:user/repo.git (SSH-style)
|
|
18
|
-
* - sqlite:///path/to/db.sqlite
|
|
19
|
-
* - json:///path/to/config.json
|
|
20
|
-
* - http://host:port/path
|
|
21
|
-
* - https://host:port/path
|
|
22
|
-
*/
|
|
23
|
-
function parseURI(uri) {
|
|
24
|
-
if (!uri || uri.trim() === "") throw new Error("URI cannot be empty");
|
|
25
|
-
const sshGitMatch = uri.match(/^git@([^:]+):(.+)$/);
|
|
26
|
-
if (sshGitMatch?.[1] && sshGitMatch[2]) return {
|
|
27
|
-
scheme: "git",
|
|
28
|
-
host: sshGitMatch[1],
|
|
29
|
-
path: sshGitMatch[2],
|
|
30
|
-
params: {}
|
|
31
|
-
};
|
|
32
|
-
const schemeMatch = uri.match(/^([a-z]+):\/\//i);
|
|
33
|
-
if (!schemeMatch?.[1]) throw new Error(`Invalid URI format: ${uri}`);
|
|
34
|
-
const scheme = schemeMatch[1].toLowerCase();
|
|
35
|
-
if (!SUPPORTED_SCHEMES.has(scheme)) throw new Error(`Unknown URI scheme: ${scheme}`);
|
|
36
|
-
if (scheme === "http" || scheme === "https") return parseHttpURI(uri, scheme);
|
|
37
|
-
return parseLocalURI(uri, scheme);
|
|
38
|
-
}
|
|
39
|
-
function parseHttpURI(uri, scheme) {
|
|
40
|
-
const url = new URL(uri);
|
|
41
|
-
const params = {};
|
|
42
|
-
url.searchParams.forEach((value, key) => {
|
|
43
|
-
params[key] = value;
|
|
44
|
-
});
|
|
45
|
-
return {
|
|
46
|
-
scheme,
|
|
47
|
-
host: url.hostname,
|
|
48
|
-
port: url.port ? Number.parseInt(url.port, 10) : void 0,
|
|
49
|
-
path: url.pathname || "/",
|
|
50
|
-
params
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
function parseLocalURI(uri, scheme) {
|
|
54
|
-
const withoutScheme = uri.slice(scheme.length + 3);
|
|
55
|
-
if (scheme === "git") {
|
|
56
|
-
const sshMatch = withoutScheme.match(/^([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+):(.+)$/);
|
|
57
|
-
if (sshMatch?.[1] && sshMatch[2]) {
|
|
58
|
-
const atIndex = sshMatch[1].indexOf("@");
|
|
59
|
-
return {
|
|
60
|
-
scheme: "git",
|
|
61
|
-
host: sshMatch[1].slice(atIndex + 1),
|
|
62
|
-
path: sshMatch[2],
|
|
63
|
-
params: {}
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
if (withoutScheme.startsWith("https://") || withoutScheme.startsWith("http://")) return {
|
|
67
|
-
scheme: "git",
|
|
68
|
-
path: withoutScheme,
|
|
69
|
-
params: {}
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
const queryIndex = withoutScheme.indexOf("?");
|
|
73
|
-
let path;
|
|
74
|
-
let queryString;
|
|
75
|
-
if (queryIndex >= 0) {
|
|
76
|
-
path = withoutScheme.slice(0, queryIndex);
|
|
77
|
-
queryString = withoutScheme.slice(queryIndex + 1);
|
|
78
|
-
} else path = withoutScheme;
|
|
79
|
-
path = decodeURIComponent(path);
|
|
80
|
-
const params = {};
|
|
81
|
-
if (queryString) new URLSearchParams(queryString).forEach((value, key) => {
|
|
82
|
-
params[key] = value;
|
|
83
|
-
});
|
|
84
|
-
return {
|
|
85
|
-
scheme,
|
|
86
|
-
path,
|
|
87
|
-
params
|
|
88
|
-
};
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
//#endregion
|
|
92
|
-
exports.parseURI = parseURI;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
//#region src/config/uri-parser.ts
|
|
2
|
-
const SUPPORTED_SCHEMES = new Set([
|
|
3
|
-
"fs",
|
|
4
|
-
"git",
|
|
5
|
-
"sqlite",
|
|
6
|
-
"json",
|
|
7
|
-
"http",
|
|
8
|
-
"https"
|
|
9
|
-
]);
|
|
10
|
-
/**
|
|
11
|
-
* Parse an AFS URI into components
|
|
12
|
-
*
|
|
13
|
-
* Supported formats:
|
|
14
|
-
* - fs:///path/to/dir
|
|
15
|
-
* - git:///path/to/repo?branch=main
|
|
16
|
-
* - git@github.com:user/repo.git (SSH-style)
|
|
17
|
-
* - sqlite:///path/to/db.sqlite
|
|
18
|
-
* - json:///path/to/config.json
|
|
19
|
-
* - http://host:port/path
|
|
20
|
-
* - https://host:port/path
|
|
21
|
-
*/
|
|
22
|
-
function parseURI(uri) {
|
|
23
|
-
if (!uri || uri.trim() === "") throw new Error("URI cannot be empty");
|
|
24
|
-
const sshGitMatch = uri.match(/^git@([^:]+):(.+)$/);
|
|
25
|
-
if (sshGitMatch?.[1] && sshGitMatch[2]) return {
|
|
26
|
-
scheme: "git",
|
|
27
|
-
host: sshGitMatch[1],
|
|
28
|
-
path: sshGitMatch[2],
|
|
29
|
-
params: {}
|
|
30
|
-
};
|
|
31
|
-
const schemeMatch = uri.match(/^([a-z]+):\/\//i);
|
|
32
|
-
if (!schemeMatch?.[1]) throw new Error(`Invalid URI format: ${uri}`);
|
|
33
|
-
const scheme = schemeMatch[1].toLowerCase();
|
|
34
|
-
if (!SUPPORTED_SCHEMES.has(scheme)) throw new Error(`Unknown URI scheme: ${scheme}`);
|
|
35
|
-
if (scheme === "http" || scheme === "https") return parseHttpURI(uri, scheme);
|
|
36
|
-
return parseLocalURI(uri, scheme);
|
|
37
|
-
}
|
|
38
|
-
function parseHttpURI(uri, scheme) {
|
|
39
|
-
const url = new URL(uri);
|
|
40
|
-
const params = {};
|
|
41
|
-
url.searchParams.forEach((value, key) => {
|
|
42
|
-
params[key] = value;
|
|
43
|
-
});
|
|
44
|
-
return {
|
|
45
|
-
scheme,
|
|
46
|
-
host: url.hostname,
|
|
47
|
-
port: url.port ? Number.parseInt(url.port, 10) : void 0,
|
|
48
|
-
path: url.pathname || "/",
|
|
49
|
-
params
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
function parseLocalURI(uri, scheme) {
|
|
53
|
-
const withoutScheme = uri.slice(scheme.length + 3);
|
|
54
|
-
if (scheme === "git") {
|
|
55
|
-
const sshMatch = withoutScheme.match(/^([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+):(.+)$/);
|
|
56
|
-
if (sshMatch?.[1] && sshMatch[2]) {
|
|
57
|
-
const atIndex = sshMatch[1].indexOf("@");
|
|
58
|
-
return {
|
|
59
|
-
scheme: "git",
|
|
60
|
-
host: sshMatch[1].slice(atIndex + 1),
|
|
61
|
-
path: sshMatch[2],
|
|
62
|
-
params: {}
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
if (withoutScheme.startsWith("https://") || withoutScheme.startsWith("http://")) return {
|
|
66
|
-
scheme: "git",
|
|
67
|
-
path: withoutScheme,
|
|
68
|
-
params: {}
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
const queryIndex = withoutScheme.indexOf("?");
|
|
72
|
-
let path;
|
|
73
|
-
let queryString;
|
|
74
|
-
if (queryIndex >= 0) {
|
|
75
|
-
path = withoutScheme.slice(0, queryIndex);
|
|
76
|
-
queryString = withoutScheme.slice(queryIndex + 1);
|
|
77
|
-
} else path = withoutScheme;
|
|
78
|
-
path = decodeURIComponent(path);
|
|
79
|
-
const params = {};
|
|
80
|
-
if (queryString) new URLSearchParams(queryString).forEach((value, key) => {
|
|
81
|
-
params[key] = value;
|
|
82
|
-
});
|
|
83
|
-
return {
|
|
84
|
-
scheme,
|
|
85
|
-
path,
|
|
86
|
-
params
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
//#endregion
|
|
91
|
-
export { parseURI };
|
|
92
|
-
//# sourceMappingURL=uri-parser.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"uri-parser.mjs","names":[],"sources":["../../src/config/uri-parser.ts"],"sourcesContent":["/**\n * Supported URI schemes\n */\nexport type URIScheme = \"fs\" | \"git\" | \"sqlite\" | \"json\" | \"http\" | \"https\";\n\n/**\n * Parsed URI result\n */\nexport interface ParsedURI {\n /** URI scheme */\n scheme: URIScheme;\n /** Path component (decoded) */\n path: string;\n /** Query parameters */\n params: Record<string, string>;\n /** Host (for http/https only) */\n host?: string;\n /** Port (for http/https only) */\n port?: number;\n}\n\nconst SUPPORTED_SCHEMES = new Set<string>([\"fs\", \"git\", \"sqlite\", \"json\", \"http\", \"https\"]);\n\n/**\n * Parse an AFS URI into components\n *\n * Supported formats:\n * - fs:///path/to/dir\n * - git:///path/to/repo?branch=main\n * - git@github.com:user/repo.git (SSH-style)\n * - sqlite:///path/to/db.sqlite\n * - json:///path/to/config.json\n * - http://host:port/path\n * - https://host:port/path\n */\nexport function parseURI(uri: string): ParsedURI {\n if (!uri || uri.trim() === \"\") {\n throw new Error(\"URI cannot be empty\");\n }\n\n // Handle SSH-style git URLs: git@host:path\n const sshGitMatch = uri.match(/^git@([^:]+):(.+)$/);\n if (sshGitMatch?.[1] && sshGitMatch[2]) {\n return {\n scheme: \"git\",\n host: sshGitMatch[1],\n path: sshGitMatch[2],\n params: {},\n };\n }\n\n // Extract scheme\n const schemeMatch = uri.match(/^([a-z]+):\\/\\//i);\n if (!schemeMatch?.[1]) {\n throw new Error(`Invalid URI format: ${uri}`);\n }\n\n const scheme = schemeMatch[1].toLowerCase();\n if (!SUPPORTED_SCHEMES.has(scheme)) {\n throw new Error(`Unknown URI scheme: ${scheme}`);\n }\n\n // For http/https, use URL API for proper parsing\n if (scheme === \"http\" || scheme === \"https\") {\n return parseHttpURI(uri, scheme as \"http\" | \"https\");\n }\n\n // For local schemes (fs, git, sqlite, json)\n return parseLocalURI(uri, scheme as \"fs\" | \"git\" | \"sqlite\" | \"json\");\n}\n\nfunction parseHttpURI(uri: string, scheme: \"http\" | \"https\"): ParsedURI {\n const url = new URL(uri);\n\n const params: Record<string, string> = {};\n url.searchParams.forEach((value, key) => {\n params[key] = value;\n });\n\n return {\n scheme,\n host: url.hostname,\n port: url.port ? Number.parseInt(url.port, 10) : undefined,\n path: url.pathname || \"/\",\n params,\n };\n}\n\nfunction parseLocalURI(uri: string, scheme: \"fs\" | \"git\" | \"sqlite\" | \"json\"): ParsedURI {\n // Remove scheme prefix (e.g., \"fs://\")\n const withoutScheme = uri.slice(scheme.length + 3);\n\n // For git:// scheme, check if the path is actually an SSH-style URL (git@host:path)\n if (scheme === \"git\") {\n const sshMatch = withoutScheme.match(/^([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+):(.+)$/);\n if (sshMatch?.[1] && sshMatch[2]) {\n // Extract host from user@host format\n const atIndex = sshMatch[1].indexOf(\"@\");\n const host = sshMatch[1].slice(atIndex + 1);\n return {\n scheme: \"git\",\n host,\n path: sshMatch[2],\n params: {},\n };\n }\n\n // Also handle embedded https:// URLs (git://https://github.com/user/repo.git)\n if (withoutScheme.startsWith(\"https://\") || withoutScheme.startsWith(\"http://\")) {\n return {\n scheme: \"git\",\n path: withoutScheme, // Store full URL as path, provider will handle it\n params: {},\n };\n }\n }\n\n // Split path and query\n const queryIndex = withoutScheme.indexOf(\"?\");\n let path: string;\n let queryString: string | undefined;\n\n if (queryIndex >= 0) {\n path = withoutScheme.slice(0, queryIndex);\n queryString = withoutScheme.slice(queryIndex + 1);\n } else {\n path = withoutScheme;\n }\n\n // Decode URI components\n path = decodeURIComponent(path);\n\n // Parse query params\n const params: Record<string, string> = {};\n if (queryString) {\n const searchParams = new URLSearchParams(queryString);\n searchParams.forEach((value, key) => {\n params[key] = value;\n });\n }\n\n return {\n scheme,\n path,\n params,\n };\n}\n"],"mappings":";AAqBA,MAAM,oBAAoB,IAAI,IAAY;CAAC;CAAM;CAAO;CAAU;CAAQ;CAAQ;CAAQ,CAAC;;;;;;;;;;;;;AAc3F,SAAgB,SAAS,KAAwB;AAC/C,KAAI,CAAC,OAAO,IAAI,MAAM,KAAK,GACzB,OAAM,IAAI,MAAM,sBAAsB;CAIxC,MAAM,cAAc,IAAI,MAAM,qBAAqB;AACnD,KAAI,cAAc,MAAM,YAAY,GAClC,QAAO;EACL,QAAQ;EACR,MAAM,YAAY;EAClB,MAAM,YAAY;EAClB,QAAQ,EAAE;EACX;CAIH,MAAM,cAAc,IAAI,MAAM,kBAAkB;AAChD,KAAI,CAAC,cAAc,GACjB,OAAM,IAAI,MAAM,uBAAuB,MAAM;CAG/C,MAAM,SAAS,YAAY,GAAG,aAAa;AAC3C,KAAI,CAAC,kBAAkB,IAAI,OAAO,CAChC,OAAM,IAAI,MAAM,uBAAuB,SAAS;AAIlD,KAAI,WAAW,UAAU,WAAW,QAClC,QAAO,aAAa,KAAK,OAA2B;AAItD,QAAO,cAAc,KAAK,OAA2C;;AAGvE,SAAS,aAAa,KAAa,QAAqC;CACtE,MAAM,MAAM,IAAI,IAAI,IAAI;CAExB,MAAM,SAAiC,EAAE;AACzC,KAAI,aAAa,SAAS,OAAO,QAAQ;AACvC,SAAO,OAAO;GACd;AAEF,QAAO;EACL;EACA,MAAM,IAAI;EACV,MAAM,IAAI,OAAO,OAAO,SAAS,IAAI,MAAM,GAAG,GAAG;EACjD,MAAM,IAAI,YAAY;EACtB;EACD;;AAGH,SAAS,cAAc,KAAa,QAAqD;CAEvF,MAAM,gBAAgB,IAAI,MAAM,OAAO,SAAS,EAAE;AAGlD,KAAI,WAAW,OAAO;EACpB,MAAM,WAAW,cAAc,MAAM,2CAA2C;AAChF,MAAI,WAAW,MAAM,SAAS,IAAI;GAEhC,MAAM,UAAU,SAAS,GAAG,QAAQ,IAAI;AAExC,UAAO;IACL,QAAQ;IACR,MAHW,SAAS,GAAG,MAAM,UAAU,EAAE;IAIzC,MAAM,SAAS;IACf,QAAQ,EAAE;IACX;;AAIH,MAAI,cAAc,WAAW,WAAW,IAAI,cAAc,WAAW,UAAU,CAC7E,QAAO;GACL,QAAQ;GACR,MAAM;GACN,QAAQ,EAAE;GACX;;CAKL,MAAM,aAAa,cAAc,QAAQ,IAAI;CAC7C,IAAI;CACJ,IAAI;AAEJ,KAAI,cAAc,GAAG;AACnB,SAAO,cAAc,MAAM,GAAG,WAAW;AACzC,gBAAc,cAAc,MAAM,aAAa,EAAE;OAEjD,QAAO;AAIT,QAAO,mBAAmB,KAAK;CAG/B,MAAM,SAAiC,EAAE;AACzC,KAAI,YAEF,CADqB,IAAI,gBAAgB,YAAY,CACxC,SAAS,OAAO,QAAQ;AACnC,SAAO,OAAO;GACd;AAGJ,QAAO;EACL;EACA;EACA;EACD"}
|
package/dist/runtime.cjs
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
-
const require_loader = require('./config/loader.cjs');
|
|
3
|
-
const require_provider_factory = require('./config/provider-factory.cjs');
|
|
4
|
-
const require_path_utils = require('./path-utils.cjs');
|
|
5
|
-
let _aigne_afs = require("@aigne/afs");
|
|
6
|
-
|
|
7
|
-
//#region src/runtime.ts
|
|
8
|
-
/**
|
|
9
|
-
* AFS Runtime wrapper that provides namespace and CLI path support
|
|
10
|
-
*
|
|
11
|
-
* This runtime:
|
|
12
|
-
* - Supports mounting modules with namespaces
|
|
13
|
-
* - Accepts CLI UX paths (/path, @namespace/path) and converts to canonical
|
|
14
|
-
* - Passes through canonical paths ($afs/path, $afs:namespace/path)
|
|
15
|
-
*/
|
|
16
|
-
var AFSRuntime = class {
|
|
17
|
-
afs;
|
|
18
|
-
constructor() {
|
|
19
|
-
this.afs = new _aigne_afs.AFS();
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Mount a provider at a path in a namespace
|
|
23
|
-
*
|
|
24
|
-
* @param provider - The provider module to mount
|
|
25
|
-
* @param mountPath - The path to mount at
|
|
26
|
-
* @param options - Mount options including namespace
|
|
27
|
-
*/
|
|
28
|
-
async mount(provider, mountPath, options) {
|
|
29
|
-
const namespace = options?.namespace ?? null;
|
|
30
|
-
this.afs.mount(provider, mountPath, { namespace });
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* Get all mounts, optionally filtered by namespace
|
|
34
|
-
*/
|
|
35
|
-
getMounts(namespace) {
|
|
36
|
-
return this.afs.getMounts(namespace);
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Get all defined namespaces
|
|
40
|
-
*/
|
|
41
|
-
getNamespaces() {
|
|
42
|
-
return this.afs.getNamespaces();
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Check if a path is mounted in a namespace
|
|
46
|
-
*/
|
|
47
|
-
isMounted(path, namespace) {
|
|
48
|
-
return this.afs.isMounted(path, namespace);
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Translate CLI path to canonical path
|
|
52
|
-
* Supports: /path, @namespace/path, $afs/path, $afs:namespace/path
|
|
53
|
-
*/
|
|
54
|
-
translatePath(cliPath) {
|
|
55
|
-
return require_path_utils.cliPathToCanonical(cliPath);
|
|
56
|
-
}
|
|
57
|
-
async list(path, options) {
|
|
58
|
-
const canonicalPath = this.translatePath(path);
|
|
59
|
-
return this.afs.list(canonicalPath, options);
|
|
60
|
-
}
|
|
61
|
-
async read(path, options) {
|
|
62
|
-
const canonicalPath = this.translatePath(path);
|
|
63
|
-
return this.afs.read(canonicalPath, options);
|
|
64
|
-
}
|
|
65
|
-
async write(path, content, options) {
|
|
66
|
-
const canonicalPath = this.translatePath(path);
|
|
67
|
-
return this.afs.write(canonicalPath, content, options);
|
|
68
|
-
}
|
|
69
|
-
async search(path, query, options) {
|
|
70
|
-
const canonicalPath = this.translatePath(path);
|
|
71
|
-
return this.afs.search(canonicalPath, query, options);
|
|
72
|
-
}
|
|
73
|
-
async delete(path, options) {
|
|
74
|
-
const canonicalPath = this.translatePath(path);
|
|
75
|
-
return this.afs.delete(canonicalPath, options);
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
/**
|
|
79
|
-
* Create an AFS runtime from configuration
|
|
80
|
-
*
|
|
81
|
-
* @param cwd - Working directory to load config from
|
|
82
|
-
* @param options - Runtime options
|
|
83
|
-
* @returns Configured AFS runtime
|
|
84
|
-
*/
|
|
85
|
-
async function createRuntime(cwd = process.cwd(), options = {}) {
|
|
86
|
-
const config = await (options.configLoader ?? new require_loader.ConfigLoader()).load(cwd);
|
|
87
|
-
const runtime = new AFSRuntime();
|
|
88
|
-
for (const mount of config.mounts) {
|
|
89
|
-
const provider = await require_provider_factory.createProvider(mount);
|
|
90
|
-
await runtime.mount(provider, mount.path, { namespace: mount.namespace });
|
|
91
|
-
}
|
|
92
|
-
return runtime;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
//#endregion
|
|
96
|
-
exports.createRuntime = createRuntime;
|
package/dist/runtime.mjs
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { ConfigLoader } from "./config/loader.mjs";
|
|
2
|
-
import { createProvider } from "./config/provider-factory.mjs";
|
|
3
|
-
import { cliPathToCanonical } from "./path-utils.mjs";
|
|
4
|
-
import { AFS } from "@aigne/afs";
|
|
5
|
-
|
|
6
|
-
//#region src/runtime.ts
|
|
7
|
-
/**
|
|
8
|
-
* AFS Runtime wrapper that provides namespace and CLI path support
|
|
9
|
-
*
|
|
10
|
-
* This runtime:
|
|
11
|
-
* - Supports mounting modules with namespaces
|
|
12
|
-
* - Accepts CLI UX paths (/path, @namespace/path) and converts to canonical
|
|
13
|
-
* - Passes through canonical paths ($afs/path, $afs:namespace/path)
|
|
14
|
-
*/
|
|
15
|
-
var AFSRuntime = class {
|
|
16
|
-
afs;
|
|
17
|
-
constructor() {
|
|
18
|
-
this.afs = new AFS();
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Mount a provider at a path in a namespace
|
|
22
|
-
*
|
|
23
|
-
* @param provider - The provider module to mount
|
|
24
|
-
* @param mountPath - The path to mount at
|
|
25
|
-
* @param options - Mount options including namespace
|
|
26
|
-
*/
|
|
27
|
-
async mount(provider, mountPath, options) {
|
|
28
|
-
const namespace = options?.namespace ?? null;
|
|
29
|
-
this.afs.mount(provider, mountPath, { namespace });
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Get all mounts, optionally filtered by namespace
|
|
33
|
-
*/
|
|
34
|
-
getMounts(namespace) {
|
|
35
|
-
return this.afs.getMounts(namespace);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Get all defined namespaces
|
|
39
|
-
*/
|
|
40
|
-
getNamespaces() {
|
|
41
|
-
return this.afs.getNamespaces();
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Check if a path is mounted in a namespace
|
|
45
|
-
*/
|
|
46
|
-
isMounted(path, namespace) {
|
|
47
|
-
return this.afs.isMounted(path, namespace);
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Translate CLI path to canonical path
|
|
51
|
-
* Supports: /path, @namespace/path, $afs/path, $afs:namespace/path
|
|
52
|
-
*/
|
|
53
|
-
translatePath(cliPath) {
|
|
54
|
-
return cliPathToCanonical(cliPath);
|
|
55
|
-
}
|
|
56
|
-
async list(path, options) {
|
|
57
|
-
const canonicalPath = this.translatePath(path);
|
|
58
|
-
return this.afs.list(canonicalPath, options);
|
|
59
|
-
}
|
|
60
|
-
async read(path, options) {
|
|
61
|
-
const canonicalPath = this.translatePath(path);
|
|
62
|
-
return this.afs.read(canonicalPath, options);
|
|
63
|
-
}
|
|
64
|
-
async write(path, content, options) {
|
|
65
|
-
const canonicalPath = this.translatePath(path);
|
|
66
|
-
return this.afs.write(canonicalPath, content, options);
|
|
67
|
-
}
|
|
68
|
-
async search(path, query, options) {
|
|
69
|
-
const canonicalPath = this.translatePath(path);
|
|
70
|
-
return this.afs.search(canonicalPath, query, options);
|
|
71
|
-
}
|
|
72
|
-
async delete(path, options) {
|
|
73
|
-
const canonicalPath = this.translatePath(path);
|
|
74
|
-
return this.afs.delete(canonicalPath, options);
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Create an AFS runtime from configuration
|
|
79
|
-
*
|
|
80
|
-
* @param cwd - Working directory to load config from
|
|
81
|
-
* @param options - Runtime options
|
|
82
|
-
* @returns Configured AFS runtime
|
|
83
|
-
*/
|
|
84
|
-
async function createRuntime(cwd = process.cwd(), options = {}) {
|
|
85
|
-
const config = await (options.configLoader ?? new ConfigLoader()).load(cwd);
|
|
86
|
-
const runtime = new AFSRuntime();
|
|
87
|
-
for (const mount of config.mounts) {
|
|
88
|
-
const provider = await createProvider(mount);
|
|
89
|
-
await runtime.mount(provider, mount.path, { namespace: mount.namespace });
|
|
90
|
-
}
|
|
91
|
-
return runtime;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
//#endregion
|
|
95
|
-
export { createRuntime };
|
|
96
|
-
//# sourceMappingURL=runtime.mjs.map
|
package/dist/runtime.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.mjs","names":[],"sources":["../src/runtime.ts"],"sourcesContent":["import type {\n AFSDeleteOptions,\n AFSListOptions,\n AFSModule,\n AFSReadOptions,\n AFSRoot,\n AFSSearchOptions,\n AFSWriteEntryPayload,\n AFSWriteOptions,\n MountInfo,\n} from \"@aigne/afs\";\nimport { AFS } from \"@aigne/afs\";\nimport { ConfigLoader } from \"./config/loader.js\";\nimport { createProvider } from \"./config/provider-factory.js\";\nimport { cliPathToCanonical } from \"./path-utils.js\";\n\nexport interface RuntimeOptions {\n /** Custom config loader (for testing) */\n configLoader?: ConfigLoader;\n}\n\nexport interface RuntimeMountOptions {\n /** Namespace to mount into (undefined for default namespace) */\n namespace?: string;\n}\n\n/**\n * AFS Runtime wrapper that provides namespace and CLI path support\n *\n * This runtime:\n * - Supports mounting modules with namespaces\n * - Accepts CLI UX paths (/path, @namespace/path) and converts to canonical\n * - Passes through canonical paths ($afs/path, $afs:namespace/path)\n */\nexport class AFSRuntime implements Pick<AFSRoot, \"list\" | \"read\" | \"write\" | \"search\" | \"delete\"> {\n private afs: AFS;\n\n constructor() {\n this.afs = new AFS();\n }\n\n /**\n * Mount a provider at a path in a namespace\n *\n * @param provider - The provider module to mount\n * @param mountPath - The path to mount at\n * @param options - Mount options including namespace\n */\n async mount(\n provider: AFSModule,\n mountPath: string,\n options?: RuntimeMountOptions,\n ): Promise<void> {\n // Convert undefined namespace to null for AFS core\n const namespace = options?.namespace ?? null;\n this.afs.mount(provider, mountPath, { namespace });\n }\n\n /**\n * Get all mounts, optionally filtered by namespace\n */\n getMounts(namespace?: string | null): MountInfo[] {\n return this.afs.getMounts(namespace);\n }\n\n /**\n * Get all defined namespaces\n */\n getNamespaces(): (string | null)[] {\n return this.afs.getNamespaces();\n }\n\n /**\n * Check if a path is mounted in a namespace\n */\n isMounted(path: string, namespace?: string | null): boolean {\n return this.afs.isMounted(path, namespace);\n }\n\n /**\n * Translate CLI path to canonical path\n * Supports: /path, @namespace/path, $afs/path, $afs:namespace/path\n */\n private translatePath(cliPath: string): string {\n return cliPathToCanonical(cliPath);\n }\n\n async list(path: string, options?: AFSListOptions) {\n const canonicalPath = this.translatePath(path);\n return this.afs.list(canonicalPath, options);\n }\n\n async read(path: string, options?: AFSReadOptions) {\n const canonicalPath = this.translatePath(path);\n return this.afs.read(canonicalPath, options);\n }\n\n async write(path: string, content: AFSWriteEntryPayload, options?: AFSWriteOptions) {\n const canonicalPath = this.translatePath(path);\n return this.afs.write(canonicalPath, content, options);\n }\n\n async search(path: string, query: string, options?: AFSSearchOptions) {\n const canonicalPath = this.translatePath(path);\n return this.afs.search(canonicalPath, query, options);\n }\n\n async delete(path: string, options?: AFSDeleteOptions) {\n const canonicalPath = this.translatePath(path);\n return this.afs.delete(canonicalPath, options);\n }\n}\n\n/**\n * Create an AFS runtime from configuration\n *\n * @param cwd - Working directory to load config from\n * @param options - Runtime options\n * @returns Configured AFS runtime\n */\nexport async function createRuntime(\n cwd: string = process.cwd(),\n options: RuntimeOptions = {},\n): Promise<AFSRuntime> {\n const loader = options.configLoader ?? new ConfigLoader();\n const config = await loader.load(cwd);\n\n const runtime = new AFSRuntime();\n\n for (const mount of config.mounts) {\n const provider = await createProvider(mount);\n await runtime.mount(provider, mount.path, { namespace: mount.namespace });\n }\n\n return runtime;\n}\n"],"mappings":";;;;;;;;;;;;;;AAkCA,IAAa,aAAb,MAAkG;CAChG,AAAQ;CAER,cAAc;AACZ,OAAK,MAAM,IAAI,KAAK;;;;;;;;;CAUtB,MAAM,MACJ,UACA,WACA,SACe;EAEf,MAAM,YAAY,SAAS,aAAa;AACxC,OAAK,IAAI,MAAM,UAAU,WAAW,EAAE,WAAW,CAAC;;;;;CAMpD,UAAU,WAAwC;AAChD,SAAO,KAAK,IAAI,UAAU,UAAU;;;;;CAMtC,gBAAmC;AACjC,SAAO,KAAK,IAAI,eAAe;;;;;CAMjC,UAAU,MAAc,WAAoC;AAC1D,SAAO,KAAK,IAAI,UAAU,MAAM,UAAU;;;;;;CAO5C,AAAQ,cAAc,SAAyB;AAC7C,SAAO,mBAAmB,QAAQ;;CAGpC,MAAM,KAAK,MAAc,SAA0B;EACjD,MAAM,gBAAgB,KAAK,cAAc,KAAK;AAC9C,SAAO,KAAK,IAAI,KAAK,eAAe,QAAQ;;CAG9C,MAAM,KAAK,MAAc,SAA0B;EACjD,MAAM,gBAAgB,KAAK,cAAc,KAAK;AAC9C,SAAO,KAAK,IAAI,KAAK,eAAe,QAAQ;;CAG9C,MAAM,MAAM,MAAc,SAA+B,SAA2B;EAClF,MAAM,gBAAgB,KAAK,cAAc,KAAK;AAC9C,SAAO,KAAK,IAAI,MAAM,eAAe,SAAS,QAAQ;;CAGxD,MAAM,OAAO,MAAc,OAAe,SAA4B;EACpE,MAAM,gBAAgB,KAAK,cAAc,KAAK;AAC9C,SAAO,KAAK,IAAI,OAAO,eAAe,OAAO,QAAQ;;CAGvD,MAAM,OAAO,MAAc,SAA4B;EACrD,MAAM,gBAAgB,KAAK,cAAc,KAAK;AAC9C,SAAO,KAAK,IAAI,OAAO,eAAe,QAAQ;;;;;;;;;;AAWlD,eAAsB,cACpB,MAAc,QAAQ,KAAK,EAC3B,UAA0B,EAAE,EACP;CAErB,MAAM,SAAS,OADA,QAAQ,gBAAgB,IAAI,cAAc,EAC7B,KAAK,IAAI;CAErC,MAAM,UAAU,IAAI,YAAY;AAEhC,MAAK,MAAM,SAAS,OAAO,QAAQ;EACjC,MAAM,WAAW,MAAM,eAAe,MAAM;AAC5C,QAAM,QAAQ,MAAM,UAAU,MAAM,MAAM,EAAE,WAAW,MAAM,WAAW,CAAC;;AAG3E,QAAO"}
|