@neta-art/cohub-cli 1.6.0 → 1.6.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/dist/commands/spaces.js +6 -4
- package/package.json +2 -2
package/dist/commands/spaces.js
CHANGED
|
@@ -14,6 +14,8 @@ function requireSpace(program) {
|
|
|
14
14
|
}
|
|
15
15
|
return error("Missing required option", "Add -s, --space <id> to target a space");
|
|
16
16
|
}
|
|
17
|
+
const cliEnv = (process.env.ENV === "prod" ? "prod" : "dev");
|
|
18
|
+
const defaultIdleTtlSeconds = cliEnv === "prod" ? 12 * 60 * 60 : 10 * 60;
|
|
17
19
|
const parseAutoDestroy = (opts) => {
|
|
18
20
|
const mode = opts.autoDestroy ?? (opts.idleTtl ? "idle" : undefined);
|
|
19
21
|
if (!mode)
|
|
@@ -22,7 +24,7 @@ const parseAutoDestroy = (opts) => {
|
|
|
22
24
|
return { mode: "never" };
|
|
23
25
|
if (mode !== "idle")
|
|
24
26
|
return error("Invalid auto destroy mode", "Use --auto-destroy idle or --auto-destroy never");
|
|
25
|
-
const ttlSeconds = Number.parseInt(opts.idleTtl ??
|
|
27
|
+
const ttlSeconds = Number.parseInt(opts.idleTtl ?? String(defaultIdleTtlSeconds), 10);
|
|
26
28
|
if (!Number.isSafeInteger(ttlSeconds) || ttlSeconds < 60 || ttlSeconds > 30 * 24 * 60 * 60) {
|
|
27
29
|
return error("Invalid idle TTL", "--idle-ttl must be an integer between 60 and 2592000 seconds");
|
|
28
30
|
}
|
|
@@ -30,7 +32,7 @@ const parseAutoDestroy = (opts) => {
|
|
|
30
32
|
};
|
|
31
33
|
const formatAutoDestroy = (policy) => {
|
|
32
34
|
if (!policy)
|
|
33
|
-
return "
|
|
35
|
+
return `${cliEnv === "prod" ? "12h" : "10m"} (default)`;
|
|
34
36
|
if (policy.mode === "never")
|
|
35
37
|
return "never";
|
|
36
38
|
if (policy.ttlSeconds % 86400 === 0)
|
|
@@ -95,7 +97,7 @@ async function uploadFiles(command, paths, opts) {
|
|
|
95
97
|
try {
|
|
96
98
|
const files = await collectUploadFiles(paths);
|
|
97
99
|
const plan = await client.space(spaceId).files.createUpload({
|
|
98
|
-
targetDir: opts.dir,
|
|
100
|
+
destination: { kind: "workspace", targetDir: opts.dir },
|
|
99
101
|
entries: files.map((file) => ({
|
|
100
102
|
id: file.id,
|
|
101
103
|
name: file.name,
|
|
@@ -116,7 +118,7 @@ async function uploadFiles(command, paths, opts) {
|
|
|
116
118
|
});
|
|
117
119
|
if (opts.json)
|
|
118
120
|
return outJson({ ...result, uploadId: plan.uploadId, files: files.length });
|
|
119
|
-
ok(`Uploaded ${files.length} file${files.length === 1 ? "" : "s"}
|
|
121
|
+
ok(`Uploaded ${files.length} file${files.length === 1 ? "" : "s"}`);
|
|
120
122
|
}
|
|
121
123
|
catch (e) {
|
|
122
124
|
handleHttp(e);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neta-art/cohub-cli",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.2",
|
|
4
4
|
"description": "CLI for Cohub — spaces, sessions, and agent collaboration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"commander": "^13.1.0",
|
|
17
|
-
"@neta-art/cohub": "1.13.
|
|
17
|
+
"@neta-art/cohub": "1.13.1"
|
|
18
18
|
},
|
|
19
19
|
"publishConfig": {
|
|
20
20
|
"access": "public"
|