@neta-art/cohub-cli 1.7.0 → 1.8.0
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/README.md +2 -0
- package/dist/auth.d.ts +3 -1
- package/dist/auth.js +2 -2
- package/dist/commands/auth.js +68 -13
- package/dist/commands/channels.js +3 -3
- package/dist/commands/cron-jobs.js +5 -3
- package/dist/commands/generations.js +40 -10
- package/dist/commands/models.js +93 -5
- package/dist/commands/profile.js +2 -2
- package/dist/commands/prompts.js +2 -2
- package/dist/commands/search.js +2 -2
- package/dist/commands/session-access.js +12 -4
- package/dist/commands/spaces.js +144 -107
- package/dist/commands/tasks.js +3 -3
- package/dist/output.d.ts +3 -0
- package/dist/output.js +3 -0
- package/dist/space.d.ts +2 -0
- package/dist/space.js +14 -0
- package/package.json +2 -2
package/dist/commands/tasks.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createClient } from "../client.js";
|
|
2
|
-
import { table, json as outJson, handleHttp } from "../output.js";
|
|
2
|
+
import { table, json as outJson, jsonRequested, handleHttp } from "../output.js";
|
|
3
3
|
export function registerTasks(program) {
|
|
4
4
|
const cmd = program.command("tasks", { hidden: true }).description("Task runs");
|
|
5
5
|
cmd
|
|
@@ -18,7 +18,7 @@ export function registerTasks(program) {
|
|
|
18
18
|
if (opts.space)
|
|
19
19
|
filters.spaceId = opts.space;
|
|
20
20
|
const result = await client.tasks.list(filters);
|
|
21
|
-
if (opts
|
|
21
|
+
if (jsonRequested(opts))
|
|
22
22
|
return outJson(result);
|
|
23
23
|
if (result.runs.length === 0)
|
|
24
24
|
return console.log(" (empty)");
|
|
@@ -41,7 +41,7 @@ export function registerTasks(program) {
|
|
|
41
41
|
const client = createClient();
|
|
42
42
|
try {
|
|
43
43
|
const result = await client.tasks.get(id);
|
|
44
|
-
if (opts
|
|
44
|
+
if (jsonRequested(opts))
|
|
45
45
|
return outJson(result);
|
|
46
46
|
table([result.run], [
|
|
47
47
|
{ key: "id", label: "ID" },
|
package/dist/output.d.ts
CHANGED
|
@@ -4,6 +4,9 @@ export declare function table(rows: Row[], columns: {
|
|
|
4
4
|
label: string;
|
|
5
5
|
}[]): void;
|
|
6
6
|
export declare function json(data: unknown): void;
|
|
7
|
+
export declare function jsonRequested(opts?: {
|
|
8
|
+
json?: boolean;
|
|
9
|
+
}): boolean;
|
|
7
10
|
export declare function ok(msg: string): void;
|
|
8
11
|
export declare function error(msg: string, detail?: string): never;
|
|
9
12
|
export declare function handleHttp(e: unknown): never;
|
package/dist/output.js
CHANGED
|
@@ -35,6 +35,9 @@ export function table(rows, columns) {
|
|
|
35
35
|
export function json(data) {
|
|
36
36
|
console.log(JSON.stringify(data, null, 2));
|
|
37
37
|
}
|
|
38
|
+
export function jsonRequested(opts) {
|
|
39
|
+
return Boolean(opts?.json || process.argv.includes("--json"));
|
|
40
|
+
}
|
|
38
41
|
export function ok(msg) {
|
|
39
42
|
console.log(`\n ✓ ${msg}\n`);
|
|
40
43
|
}
|
package/dist/space.d.ts
ADDED
package/dist/space.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { error } from "./output.js";
|
|
2
|
+
export function resolveSpace(program) {
|
|
3
|
+
let current = program;
|
|
4
|
+
while (current) {
|
|
5
|
+
const opts = current.opts();
|
|
6
|
+
if (typeof opts.space === "string" && opts.space.trim())
|
|
7
|
+
return opts.space.trim();
|
|
8
|
+
current = current.parent ?? null;
|
|
9
|
+
}
|
|
10
|
+
const envSpace = process.env.COHUB_SPACE_ID?.trim();
|
|
11
|
+
if (envSpace)
|
|
12
|
+
return envSpace;
|
|
13
|
+
return error("Missing required space", "Add -s, --space <id> or set COHUB_SPACE_ID.");
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neta-art/cohub-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "CLI for Cohub — spaces, sessions, and agent collaboration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"commander": "^13.1.0",
|
|
17
17
|
"sharp": "^0.34.5",
|
|
18
|
-
"@neta-art/cohub": "1.
|
|
18
|
+
"@neta-art/cohub": "1.16.0"
|
|
19
19
|
},
|
|
20
20
|
"publishConfig": {
|
|
21
21
|
"access": "public"
|