@agentconnect/cli 0.2.0 → 0.2.2
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/package.json +2 -2
- package/dist/fs-utils.js +0 -43
- package/dist/host.d.ts +0 -7
- package/dist/host.js +0 -663
- package/dist/manifest.js +0 -34
- package/dist/observed.d.ts +0 -7
- package/dist/observed.js +0 -69
- package/dist/paths.js +0 -36
- package/dist/providers/claude.d.ts +0 -12
- package/dist/providers/claude.js +0 -672
- package/dist/providers/codex.d.ts +0 -11
- package/dist/providers/codex.js +0 -509
- package/dist/providers/cursor.d.ts +0 -11
- package/dist/providers/index.d.ts +0 -5
- package/dist/providers/index.js +0 -90
- package/dist/providers/local.d.ts +0 -9
- package/dist/providers/local.js +0 -111
- package/dist/providers/utils.d.ts +0 -33
- package/dist/providers/utils.js +0 -256
- package/dist/registry-validate.js +0 -209
- package/dist/registry.js +0 -66
- package/dist/types.d.ts +0 -252
- package/dist/types.js +0 -1
- package/dist/zip.js +0 -71
package/dist/observed.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ObservedTracker } from './types.js';
|
|
2
|
-
export interface ObservedTrackerOptions {
|
|
3
|
-
basePath: string;
|
|
4
|
-
appId: string;
|
|
5
|
-
requested?: string[];
|
|
6
|
-
}
|
|
7
|
-
export declare function createObservedTracker({ basePath, appId, requested, }: ObservedTrackerOptions): ObservedTracker;
|
package/dist/observed.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import fs from 'fs';
|
|
2
|
-
import path from 'path';
|
|
3
|
-
export function createObservedTracker({ basePath, appId, requested = [], }) {
|
|
4
|
-
const requestedList = Array.isArray(requested) ? requested.filter(Boolean) : [];
|
|
5
|
-
const dirPath = path.join(basePath, '.agentconnect');
|
|
6
|
-
const filePath = path.join(dirPath, 'observed-capabilities.json');
|
|
7
|
-
const observed = new Set();
|
|
8
|
-
let writeTimer = null;
|
|
9
|
-
function load() {
|
|
10
|
-
if (!fs.existsSync(filePath))
|
|
11
|
-
return;
|
|
12
|
-
try {
|
|
13
|
-
const raw = fs.readFileSync(filePath, 'utf8');
|
|
14
|
-
const parsed = JSON.parse(raw);
|
|
15
|
-
if (Array.isArray(parsed?.observed)) {
|
|
16
|
-
for (const entry of parsed.observed) {
|
|
17
|
-
if (typeof entry === 'string' && entry)
|
|
18
|
-
observed.add(entry);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
// ignore parse errors
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function snapshot() {
|
|
27
|
-
return {
|
|
28
|
-
appId,
|
|
29
|
-
requested: requestedList,
|
|
30
|
-
observed: Array.from(observed).sort(),
|
|
31
|
-
updatedAt: new Date().toISOString(),
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
function flush() {
|
|
35
|
-
if (writeTimer) {
|
|
36
|
-
clearTimeout(writeTimer);
|
|
37
|
-
writeTimer = null;
|
|
38
|
-
}
|
|
39
|
-
const payload = JSON.stringify(snapshot(), null, 2);
|
|
40
|
-
fs.mkdirSync(dirPath, { recursive: true });
|
|
41
|
-
fs.writeFileSync(filePath, payload);
|
|
42
|
-
}
|
|
43
|
-
function scheduleFlush() {
|
|
44
|
-
if (writeTimer)
|
|
45
|
-
return;
|
|
46
|
-
writeTimer = setTimeout(() => {
|
|
47
|
-
flush();
|
|
48
|
-
}, 400);
|
|
49
|
-
}
|
|
50
|
-
function record(capability) {
|
|
51
|
-
const value = typeof capability === 'string' ? capability.trim() : '';
|
|
52
|
-
if (!value)
|
|
53
|
-
return;
|
|
54
|
-
if (observed.has(value))
|
|
55
|
-
return;
|
|
56
|
-
observed.add(value);
|
|
57
|
-
scheduleFlush();
|
|
58
|
-
}
|
|
59
|
-
function list() {
|
|
60
|
-
return Array.from(observed).sort();
|
|
61
|
-
}
|
|
62
|
-
load();
|
|
63
|
-
return {
|
|
64
|
-
record,
|
|
65
|
-
list,
|
|
66
|
-
snapshot,
|
|
67
|
-
flush,
|
|
68
|
-
};
|
|
69
|
-
}
|
package/dist/paths.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import path from 'path';
|
|
2
|
-
import { fileURLToPath } from 'url';
|
|
3
|
-
import { promises as fs } from 'fs';
|
|
4
|
-
async function exists(target) {
|
|
5
|
-
try {
|
|
6
|
-
await fs.stat(target);
|
|
7
|
-
return true;
|
|
8
|
-
}
|
|
9
|
-
catch {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
export function resolveAppPath(input) {
|
|
14
|
-
const candidate = input ? path.resolve(input) : process.cwd();
|
|
15
|
-
return candidate;
|
|
16
|
-
}
|
|
17
|
-
export async function findSchemaDir() {
|
|
18
|
-
const envDir = process.env.AGENTCONNECT_SCHEMA_DIR;
|
|
19
|
-
if (envDir && (await exists(envDir)))
|
|
20
|
-
return envDir;
|
|
21
|
-
const start = path.dirname(fileURLToPath(import.meta.url));
|
|
22
|
-
const roots = [start, process.cwd()];
|
|
23
|
-
for (const root of roots) {
|
|
24
|
-
let current = root;
|
|
25
|
-
for (let i = 0; i < 8; i += 1) {
|
|
26
|
-
const candidate = path.join(current, 'schemas');
|
|
27
|
-
if (await exists(candidate))
|
|
28
|
-
return candidate;
|
|
29
|
-
const parent = path.dirname(current);
|
|
30
|
-
if (parent === current)
|
|
31
|
-
break;
|
|
32
|
-
current = parent;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ProviderStatus, RunPromptOptions, RunPromptResult, InstallResult, ProviderLoginOptions, ModelInfo } from '../types.js';
|
|
2
|
-
export declare function getClaudeCommand(): string;
|
|
3
|
-
export declare function listClaudeModels(): Promise<ModelInfo[]>;
|
|
4
|
-
export declare function listClaudeRecentModels(): Promise<ModelInfo[]>;
|
|
5
|
-
export declare function ensureClaudeInstalled(): Promise<InstallResult>;
|
|
6
|
-
export declare function getClaudeStatus(): Promise<ProviderStatus>;
|
|
7
|
-
export declare function getClaudeFastStatus(): Promise<ProviderStatus>;
|
|
8
|
-
export declare function updateClaude(): Promise<ProviderStatus>;
|
|
9
|
-
export declare function loginClaude(options?: ProviderLoginOptions): Promise<{
|
|
10
|
-
loggedIn: boolean;
|
|
11
|
-
}>;
|
|
12
|
-
export declare function runClaudePrompt({ prompt, resumeSessionId, model, cwd, providerDetailLevel, onEvent, signal, }: RunPromptOptions): Promise<RunPromptResult>;
|