@agentconnect/cli 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +58 -0
- package/dist/fs-utils.d.ts +9 -0
- package/dist/fs-utils.js +43 -0
- package/dist/host.d.ts +7 -0
- package/dist/host.js +663 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3020 -0
- package/dist/manifest.d.ts +10 -0
- package/dist/manifest.js +34 -0
- package/dist/observed.d.ts +7 -0
- package/dist/observed.js +69 -0
- package/dist/paths.d.ts +2 -0
- package/dist/paths.js +36 -0
- package/dist/providers/claude.d.ts +10 -0
- package/dist/providers/claude.js +672 -0
- package/dist/providers/codex.d.ts +9 -0
- package/dist/providers/codex.js +509 -0
- package/dist/providers/index.d.ts +5 -0
- package/dist/providers/index.js +90 -0
- package/dist/providers/local.d.ts +8 -0
- package/dist/providers/local.js +111 -0
- package/dist/providers/utils.d.ts +32 -0
- package/dist/providers/utils.js +256 -0
- package/dist/registry-validate.d.ts +6 -0
- package/dist/registry-validate.js +209 -0
- package/dist/registry.d.ts +17 -0
- package/dist/registry.js +66 -0
- package/dist/types.d.ts +225 -0
- package/dist/types.js +1 -0
- package/dist/zip.d.ts +9 -0
- package/dist/zip.js +71 -0
- package/package.json +45 -0
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# @agentconnect/cli
|
|
2
|
+
|
|
3
|
+
AgentConnect CLI host for local development and registry workflows.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
bun add -g @agentconnect/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install -g @agentconnect/cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pnpm add -g @agentconnect/cli
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Dev host
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
agentconnect dev --app . --ui http://localhost:5173
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Packaging
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
agentconnect pack --app . --out dist/app.zip
|
|
29
|
+
agentconnect verify --app dist/app.zip
|
|
30
|
+
agentconnect sign --app dist/app.zip --key /path/to/private.key
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Publishing
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
agentconnect publish --app dist/app.zip --registry /path/to/registry --signature dist/app.sig.json
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Provider commands
|
|
40
|
+
|
|
41
|
+
The CLI can install and log in to providers on demand. You can override commands with:
|
|
42
|
+
|
|
43
|
+
- `AGENTCONNECT_CLAUDE_COMMAND`
|
|
44
|
+
- `AGENTCONNECT_CLAUDE_INSTALL`
|
|
45
|
+
- `AGENTCONNECT_CLAUDE_LOGIN`
|
|
46
|
+
- `AGENTCONNECT_CLAUDE_STATUS`
|
|
47
|
+
- `AGENTCONNECT_CODEX_COMMAND`
|
|
48
|
+
- `AGENTCONNECT_CODEX_INSTALL`
|
|
49
|
+
- `AGENTCONNECT_CODEX_LOGIN`
|
|
50
|
+
- `AGENTCONNECT_CODEX_STATUS`
|
|
51
|
+
|
|
52
|
+
## Requirements
|
|
53
|
+
|
|
54
|
+
- Node 20+
|
|
55
|
+
|
|
56
|
+
## Docs
|
|
57
|
+
|
|
58
|
+
See `docs/SDK.md` in the repo for the full SDK reference and `SPEC.md` for the protocol contract.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CollectFilesOptions } from './types.js';
|
|
2
|
+
export interface CollectedFile {
|
|
3
|
+
fullPath: string;
|
|
4
|
+
rel: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function collectFiles(root: string, options?: CollectFilesOptions): Promise<CollectedFile[]>;
|
|
7
|
+
export declare function readJson<T = unknown>(filePath: string): Promise<T>;
|
|
8
|
+
export declare function writeJson(filePath: string, data: unknown): Promise<void>;
|
|
9
|
+
export declare function fileExists(filePath: string): Promise<boolean>;
|
package/dist/fs-utils.js
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import path from 'path';
|
|
2
|
+
import { promises as fs } from 'fs';
|
|
3
|
+
export async function collectFiles(root, options = {}) {
|
|
4
|
+
const ignoreNames = new Set(options.ignoreNames || []);
|
|
5
|
+
const ignorePaths = new Set(options.ignorePaths || []);
|
|
6
|
+
const files = [];
|
|
7
|
+
async function walk(dir) {
|
|
8
|
+
const entries = await fs.readdir(dir, { withFileTypes: true });
|
|
9
|
+
for (const entry of entries) {
|
|
10
|
+
if (ignoreNames.has(entry.name))
|
|
11
|
+
continue;
|
|
12
|
+
const fullPath = path.join(dir, entry.name);
|
|
13
|
+
const rel = path.relative(root, fullPath);
|
|
14
|
+
if (ignorePaths.has(rel))
|
|
15
|
+
continue;
|
|
16
|
+
if (entry.isDirectory()) {
|
|
17
|
+
await walk(fullPath);
|
|
18
|
+
}
|
|
19
|
+
else if (entry.isFile()) {
|
|
20
|
+
files.push({ fullPath, rel });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
await walk(root);
|
|
25
|
+
return files.sort((a, b) => a.rel.localeCompare(b.rel));
|
|
26
|
+
}
|
|
27
|
+
export async function readJson(filePath) {
|
|
28
|
+
const raw = await fs.readFile(filePath, 'utf8');
|
|
29
|
+
return JSON.parse(raw);
|
|
30
|
+
}
|
|
31
|
+
export async function writeJson(filePath, data) {
|
|
32
|
+
await fs.mkdir(path.dirname(filePath), { recursive: true });
|
|
33
|
+
await fs.writeFile(filePath, JSON.stringify(data, null, 2), 'utf8');
|
|
34
|
+
}
|
|
35
|
+
export async function fileExists(filePath) {
|
|
36
|
+
try {
|
|
37
|
+
await fs.stat(filePath);
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
catch {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
}
|