opencode-agents 1.0.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/bin/agents.js +19 -0
- package/build.mjs +49 -0
- package/dist/agents.js +19 -0
- package/dist/index.cjs +26268 -0
- package/dist/index.cjs.map +7 -0
- package/dist/index.js +26273 -0
- package/dist/index.js.map +7 -0
- package/dist/templates/default-agent.md +35 -0
- package/package.json +38 -0
- package/src/commands/add.ts +44 -0
- package/src/commands/check.ts +11 -0
- package/src/commands/find.ts +25 -0
- package/src/commands/init.ts +84 -0
- package/src/commands/list.ts +42 -0
- package/src/commands/remove.ts +42 -0
- package/src/commands/update.ts +12 -0
- package/src/core/discover.ts +129 -0
- package/src/core/installer.ts +169 -0
- package/src/core/parser.ts +55 -0
- package/src/index.ts +64 -0
- package/src/types/index.ts +78 -0
- package/src/utils/filesystem.ts +177 -0
- package/src/utils/logger.ts +13 -0
- package/templates/default-agent.md +35 -0
- package/tsconfig.json +20 -0
package/bin/agents.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from 'child_process';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { dirname, join } from 'path';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
|
|
10
|
+
const distPath = join(__dirname, '..', 'dist', 'index.js');
|
|
11
|
+
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
const child = spawn('node', [distPath, ...args], {
|
|
14
|
+
stdio: 'inherit'
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
child.on('exit', (code) => {
|
|
18
|
+
process.exit(code || 0);
|
|
19
|
+
});
|
package/build.mjs
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import * as esbuild from 'esbuild';
|
|
2
|
+
import { copyFileSync, mkdirSync, existsSync } from 'fs';
|
|
3
|
+
import { dirname, join } from 'path';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
|
|
6
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
async function build() {
|
|
9
|
+
// Ensure dist directory exists
|
|
10
|
+
if (!existsSync(join(__dirname, 'dist'))) {
|
|
11
|
+
mkdirSync(join(__dirname, 'dist'), { recursive: true });
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// Build the main entry point
|
|
15
|
+
await esbuild.build({
|
|
16
|
+
entryPoints: [join(__dirname, 'src/index.ts')],
|
|
17
|
+
bundle: true,
|
|
18
|
+
platform: 'node',
|
|
19
|
+
format: 'esm',
|
|
20
|
+
outfile: join(__dirname, 'dist/index.js'),
|
|
21
|
+
banner: {
|
|
22
|
+
js: 'import { createRequire } from "module";const require = createRequire(import.meta.url);'
|
|
23
|
+
},
|
|
24
|
+
sourcemap: true,
|
|
25
|
+
minify: false,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
// Copy bin file
|
|
29
|
+
copyFileSync(
|
|
30
|
+
join(__dirname, 'bin/agents.js'),
|
|
31
|
+
join(__dirname, 'dist/agents.js')
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
// Copy templates
|
|
35
|
+
if (!existsSync(join(__dirname, 'dist/templates'))) {
|
|
36
|
+
mkdirSync(join(__dirname, 'dist/templates'), { recursive: true });
|
|
37
|
+
}
|
|
38
|
+
copyFileSync(
|
|
39
|
+
join(__dirname, 'templates/default-agent.md'),
|
|
40
|
+
join(__dirname, 'dist/templates/default-agent.md')
|
|
41
|
+
);
|
|
42
|
+
|
|
43
|
+
console.log('Build complete!');
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
build().catch((err) => {
|
|
47
|
+
console.error(err);
|
|
48
|
+
process.exit(1);
|
|
49
|
+
});
|
package/dist/agents.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { spawn } from 'child_process';
|
|
4
|
+
import { fileURLToPath } from 'url';
|
|
5
|
+
import { dirname, join } from 'path';
|
|
6
|
+
|
|
7
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
8
|
+
const __dirname = dirname(__filename);
|
|
9
|
+
|
|
10
|
+
const distPath = join(__dirname, '..', 'dist', 'index.js');
|
|
11
|
+
|
|
12
|
+
const args = process.argv.slice(2);
|
|
13
|
+
const child = spawn('node', [distPath, ...args], {
|
|
14
|
+
stdio: 'inherit'
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
child.on('exit', (code) => {
|
|
18
|
+
process.exit(code || 0);
|
|
19
|
+
});
|