@aigne/afs-cli 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/.turbo/turbo-build.log +18 -0
- package/.turbo/turbo-check-types.log +4 -0
- package/LICENSE.md +26 -0
- package/README.md +45 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +29 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.mjs +3 -0
- package/dist/version--p6A8sKX.mjs +5 -0
- package/package.json +29 -0
- package/src/cli.test.ts +8 -0
- package/src/cli.ts +29 -0
- package/src/index.ts +7 -0
- package/src/version.ts +1 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
> @aigne/afs-cli@1.11.0-beta.1 build /home/runner/work/afs/afs/packages/cli
|
|
3
|
+
> tsdown src/index.ts src/cli.ts --format esm --dts
|
|
4
|
+
|
|
5
|
+
[34mℹ[39m tsdown [2mv0.20.0-beta.3[22m powered by rolldown [2mv1.0.0-beta.60[22m
|
|
6
|
+
[34mℹ[39m entry: [34msrc/index.ts, src/cli.ts[39m
|
|
7
|
+
[34mℹ[39m tsconfig: [34mtsconfig.json[39m
|
|
8
|
+
[34mℹ[39m Build start
|
|
9
|
+
[34mℹ[39m Granting execute permission to [4mdist/cli.mjs[24m
|
|
10
|
+
[34mℹ[39m [2mdist/[22m[1mcli.mjs[22m [2m0.76 kB[22m [2m│ gzip: 0.54 kB[22m
|
|
11
|
+
[34mℹ[39m [2mdist/[22m[1mindex.mjs[22m [2m0.07 kB[22m [2m│ gzip: 0.08 kB[22m
|
|
12
|
+
[34mℹ[39m [2mdist/[22mversion--p6A8sKX.mjs [2m0.09 kB[22m [2m│ gzip: 0.10 kB[22m
|
|
13
|
+
[34mℹ[39m [2mdist/[22m[32m[1mindex.d.mts[22m[39m [2m0.10 kB[22m [2m│ gzip: 0.11 kB[22m
|
|
14
|
+
[34mℹ[39m [2mdist/[22m[32m[1mcli.d.mts[22m[39m [2m0.01 kB[22m [2m│ gzip: 0.03 kB[22m
|
|
15
|
+
[34mℹ[39m 5 files, total: 1.03 kB
|
|
16
|
+
[33m[PLUGIN_TIMINGS] Warning:[0m Your build spent significant time in plugin `rolldown-plugin-dts:generate`. See https://rolldown.rs/options/checks#plugintimings for more details.
|
|
17
|
+
|
|
18
|
+
[32m✔[39m Build complete in [32m7128ms[39m
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Proprietary License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024-2025 ArcBlock, Inc. All Rights Reserved.
|
|
4
|
+
|
|
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.
|
|
8
|
+
|
|
9
|
+
The Software is provided for internal use only within ArcBlock, Inc. and its
|
|
10
|
+
authorized affiliates.
|
|
11
|
+
|
|
12
|
+
## No License Granted
|
|
13
|
+
|
|
14
|
+
No license, express or implied, is granted to any party for any purpose.
|
|
15
|
+
All rights are reserved by ArcBlock, Inc.
|
|
16
|
+
|
|
17
|
+
## Public Artifact Distribution
|
|
18
|
+
|
|
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.
|
|
23
|
+
|
|
24
|
+
## Contact
|
|
25
|
+
|
|
26
|
+
For licensing inquiries, contact: legal@arcblock.io
|
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# @aigne/afs-cli
|
|
2
|
+
|
|
3
|
+
AFS 命令行工具
|
|
4
|
+
|
|
5
|
+
## 命令
|
|
6
|
+
|
|
7
|
+
| 命令 | 功能 |
|
|
8
|
+
|------|------|
|
|
9
|
+
| `afs ls [path]` | 列出目录内容 |
|
|
10
|
+
| `afs cat <path>` | 读取文件内容 |
|
|
11
|
+
| `afs write <path>` | 写入文件 |
|
|
12
|
+
| `afs search <path> <pattern>` | 搜索内容 |
|
|
13
|
+
| `afs exec <path> <action>` | 执行操作 |
|
|
14
|
+
| `afs explain <path>` | 语义解释 |
|
|
15
|
+
|
|
16
|
+
## 输出模式
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# 默认: Machine Truth (LLM/脚本友好)
|
|
20
|
+
afs ls /modules/local-fs
|
|
21
|
+
|
|
22
|
+
# JSON 结构化输出
|
|
23
|
+
afs ls /modules/local-fs --json
|
|
24
|
+
|
|
25
|
+
# LLM 优化输出
|
|
26
|
+
afs ls /modules/local-fs --view=llm
|
|
27
|
+
|
|
28
|
+
# 人类友好输出
|
|
29
|
+
afs ls /modules/local-fs --view=human
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## 运行模式
|
|
33
|
+
|
|
34
|
+
- **直接模式** (默认): 直接调用 `@aigne/afs` 库
|
|
35
|
+
- **daemon 模式** (`--daemon`): 通过 afsd 代理,支持状态持久化
|
|
36
|
+
|
|
37
|
+
## 退出码
|
|
38
|
+
|
|
39
|
+
| 码 | 含义 |
|
|
40
|
+
|----|------|
|
|
41
|
+
| 0 | 成功 |
|
|
42
|
+
| 1 | 一般错误 |
|
|
43
|
+
| 2 | 参数错误 |
|
|
44
|
+
| 3 | 资源未找到 |
|
|
45
|
+
| 4 | 权限拒绝 |
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { t as VERSION } from "./version--p6A8sKX.mjs";
|
|
3
|
+
|
|
4
|
+
//#region src/cli.ts
|
|
5
|
+
/**
|
|
6
|
+
* AFS CLI - Command Line Interface
|
|
7
|
+
*
|
|
8
|
+
* 命令:
|
|
9
|
+
* - afs ls [path] 列出目录
|
|
10
|
+
* - afs cat <path> 读取文件
|
|
11
|
+
* - afs write <path> 写入文件
|
|
12
|
+
* - afs search <path> <pattern> 搜索内容
|
|
13
|
+
* - afs exec <path> <action> 执行操作
|
|
14
|
+
* - afs explain <path> 语义解释
|
|
15
|
+
*
|
|
16
|
+
* 输出模式:
|
|
17
|
+
* - 默认: Machine Truth (LLM/脚本友好)
|
|
18
|
+
* - --json: 结构化 JSON
|
|
19
|
+
* - --view=llm: LLM 优化输出
|
|
20
|
+
* - --view=human: 人类友好格式
|
|
21
|
+
*
|
|
22
|
+
* 运行模式:
|
|
23
|
+
* - 直接模式 (默认): 直接调用 @aigne/afs
|
|
24
|
+
* - daemon 模式 (--daemon): 通过 afsd 代理
|
|
25
|
+
*/
|
|
26
|
+
console.log(`afs-cli v${VERSION}`);
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { };
|
package/dist/index.d.mts
ADDED
package/dist/index.mjs
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aigne/afs-cli",
|
|
3
|
+
"version": "1.11.0-beta.1",
|
|
4
|
+
"description": "AFS Command Line Interface",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"afs": "./dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@aigne/afs": "1.11.0-beta.1"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"tsdown": "^0.20.0-beta.3",
|
|
21
|
+
"typescript": "^5.9.0"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsdown src/index.ts src/cli.ts --format esm --dts",
|
|
25
|
+
"dev": "tsdown src/index.ts src/cli.ts --format esm --dts --watch",
|
|
26
|
+
"test": "bun test",
|
|
27
|
+
"check-types": "tsc --noEmit"
|
|
28
|
+
}
|
|
29
|
+
}
|
package/src/cli.test.ts
ADDED
package/src/cli.ts
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AFS CLI - Command Line Interface
|
|
5
|
+
*
|
|
6
|
+
* 命令:
|
|
7
|
+
* - afs ls [path] 列出目录
|
|
8
|
+
* - afs cat <path> 读取文件
|
|
9
|
+
* - afs write <path> 写入文件
|
|
10
|
+
* - afs search <path> <pattern> 搜索内容
|
|
11
|
+
* - afs exec <path> <action> 执行操作
|
|
12
|
+
* - afs explain <path> 语义解释
|
|
13
|
+
*
|
|
14
|
+
* 输出模式:
|
|
15
|
+
* - 默认: Machine Truth (LLM/脚本友好)
|
|
16
|
+
* - --json: 结构化 JSON
|
|
17
|
+
* - --view=llm: LLM 优化输出
|
|
18
|
+
* - --view=human: 人类友好格式
|
|
19
|
+
*
|
|
20
|
+
* 运行模式:
|
|
21
|
+
* - 直接模式 (默认): 直接调用 @aigne/afs
|
|
22
|
+
* - daemon 模式 (--daemon): 通过 afsd 代理
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
import { VERSION } from "./version.js";
|
|
26
|
+
|
|
27
|
+
console.log(`afs-cli v${VERSION}`);
|
|
28
|
+
|
|
29
|
+
// TODO: 实现 CLI
|
package/src/index.ts
ADDED
package/src/version.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VERSION = "1.11.0-beta";
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"rootDir": "./src",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true
|
|
13
|
+
},
|
|
14
|
+
"include": ["src/**/*"],
|
|
15
|
+
"exclude": ["node_modules", "dist"]
|
|
16
|
+
}
|