opencode-agents 1.0.10 → 1.0.12
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.js +17 -17
- package/dist/index.js.map +3 -3
- package/package.json +1 -1
- package/src/commands/add.ts +4 -5
package/package.json
CHANGED
package/src/commands/add.ts
CHANGED
|
@@ -7,7 +7,9 @@ import { discoverFromDirectory } from '../core/discover.js';
|
|
|
7
7
|
import { detectPlatforms } from '../utils/filesystem.js';
|
|
8
8
|
import { logger } from '../utils/logger.js';
|
|
9
9
|
import type { AgentPlatform, InstallOptions, AgentFile } from '../types/index.js';
|
|
10
|
-
import { basename } from 'path';
|
|
10
|
+
import { basename, join } from 'path';
|
|
11
|
+
import { mkdtempSync } from 'fs';
|
|
12
|
+
import degit from 'degit';
|
|
11
13
|
|
|
12
14
|
interface AddCommandOptions {
|
|
13
15
|
global: boolean | undefined;
|
|
@@ -53,9 +55,6 @@ async function promptSelectAgents(agents: AgentFile[]): Promise<AgentFile[]> {
|
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
async function fetchSource(source: string): Promise<string> {
|
|
56
|
-
const { mkdtempSync, join } = await import('path');
|
|
57
|
-
const degit = await import('degit');
|
|
58
|
-
|
|
59
58
|
const tempDir = mkdtempSync(join(tmpdir(), 'agents-cli-'));
|
|
60
59
|
|
|
61
60
|
const parts = source.split('/');
|
|
@@ -71,7 +70,7 @@ async function fetchSource(source: string): Promise<string> {
|
|
|
71
70
|
|
|
72
71
|
try {
|
|
73
72
|
const target = ref ? `${owner}/${repo}#${ref}` : `${owner}/${repo}`;
|
|
74
|
-
await degit
|
|
73
|
+
await degit(target).clone(tempDir);
|
|
75
74
|
return tempDir;
|
|
76
75
|
} catch (err) {
|
|
77
76
|
rmSync(tempDir, { recursive: true, force: true });
|