@open-agent-toolkit/cli 0.2.0 → 0.2.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"copy-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/shared/copy-helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"copy-helpers.d.ts","sourceRoot":"","sources":["../../../../../src/commands/init/tools/shared/copy-helpers.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAC1D,MAAM,MAAM,kBAAkB,GAAG,UAAU,GAAG,UAAU,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAwBD,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAE/D;AAED,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,UAAU,CAAC,CAiBrB;AAED,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,UAAU,CAAC,CAerB;AAED,wBAAsB,uBAAuB,CAC3C,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,UAAU,CAAC,CAyBrB"}
|
|
@@ -1,7 +1,26 @@
|
|
|
1
|
-
import { rm } from 'node:fs/promises';
|
|
1
|
+
import { chmod, readdir, rm } from 'node:fs/promises';
|
|
2
|
+
import { join } from 'node:path';
|
|
2
3
|
import { compareVersions } from '../../../init/tools/shared/version.js';
|
|
3
4
|
import { getSkillVersion } from '../../../shared/frontmatter.js';
|
|
4
5
|
import { copyDirectory, copySingleFile, dirExists, fileExists } from '../../../../fs/io.js';
|
|
6
|
+
async function chmodFilesExecutable(directory) {
|
|
7
|
+
const entries = await readdir(directory, { withFileTypes: true });
|
|
8
|
+
for (const entry of entries) {
|
|
9
|
+
const path = join(directory, entry.name);
|
|
10
|
+
if (entry.isDirectory()) {
|
|
11
|
+
await chmodFilesExecutable(path);
|
|
12
|
+
}
|
|
13
|
+
else if (entry.isFile()) {
|
|
14
|
+
await chmod(path, 0o755);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
async function ensureNestedScriptsExecutable(destination) {
|
|
19
|
+
const scriptsDirectory = join(destination, 'scripts');
|
|
20
|
+
if (await dirExists(scriptsDirectory)) {
|
|
21
|
+
await chmodFilesExecutable(scriptsDirectory);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
5
24
|
export async function pathExists(path) {
|
|
6
25
|
return (await fileExists(path)) || (await dirExists(path));
|
|
7
26
|
}
|
|
@@ -13,9 +32,11 @@ export async function copyDirWithStatus(source, destination, force) {
|
|
|
13
32
|
if (exists && force) {
|
|
14
33
|
await rm(destination, { recursive: true, force: true });
|
|
15
34
|
await copyDirectory(source, destination);
|
|
35
|
+
await ensureNestedScriptsExecutable(destination);
|
|
16
36
|
return 'updated';
|
|
17
37
|
}
|
|
18
38
|
await copyDirectory(source, destination);
|
|
39
|
+
await ensureNestedScriptsExecutable(destination);
|
|
19
40
|
return 'copied';
|
|
20
41
|
}
|
|
21
42
|
export async function copyFileWithStatus(source, destination, force) {
|
|
@@ -35,11 +56,13 @@ export async function copyDirWithVersionCheck(source, destination, force) {
|
|
|
35
56
|
const exists = await pathExists(destination);
|
|
36
57
|
if (!exists) {
|
|
37
58
|
await copyDirectory(source, destination);
|
|
59
|
+
await ensureNestedScriptsExecutable(destination);
|
|
38
60
|
return { status: 'copied' };
|
|
39
61
|
}
|
|
40
62
|
if (force) {
|
|
41
63
|
await rm(destination, { recursive: true, force: true });
|
|
42
64
|
await copyDirectory(source, destination);
|
|
65
|
+
await ensureNestedScriptsExecutable(destination);
|
|
43
66
|
return { status: 'updated' };
|
|
44
67
|
}
|
|
45
68
|
const bundledVersion = await getSkillVersion(source);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-agent-toolkit/cli",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Open Agent Toolkit CLI",
|
|
6
6
|
"homepage": "https://github.com/voxmedia/open-agent-toolkit/tree/main/packages/cli",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"ora": "^9.0.0",
|
|
35
35
|
"yaml": "2.8.2",
|
|
36
36
|
"zod": "^3.25.76",
|
|
37
|
-
"@open-agent-toolkit/control-plane": "0.2.
|
|
37
|
+
"@open-agent-toolkit/control-plane": "0.2.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/node": "^22.10.0",
|