@neta-art/cohub-cli 10.23.0 → 10.25.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 +18 -5
- package/bin/cohub.js +4 -1
- package/dist/board-gpu/page.js +1566 -71230
- package/dist/bootstrap.js +67 -27
- package/dist/build.json +1 -1
- package/dist/{board-kernel/FilterPipe.js → chunks/Geometry.js} +10447 -10469
- package/dist/chunks/about.js +102 -0
- package/dist/chunks/app-realtime.js +2216 -0
- package/dist/chunks/app-realtime2.js +2 -0
- package/dist/chunks/app-ref.js +88 -0
- package/dist/chunks/apps.js +1423 -0
- package/dist/chunks/auth.js +175 -0
- package/dist/chunks/avatar.js +146 -0
- package/dist/chunks/board-export-resources.js +232 -0
- package/dist/chunks/board-export.js +874 -0
- package/dist/chunks/board-export2.js +2 -0
- package/dist/{board-kernel.js → chunks/board-kernel.js} +18032 -28512
- package/dist/chunks/board-kernel2.js +4 -0
- package/dist/chunks/board-profile.js +69 -0
- package/dist/chunks/board-simulate.js +315 -0
- package/dist/chunks/board-time.js +34 -0
- package/dist/chunks/boards.js +1943 -0
- package/dist/{board-kernel → chunks}/browserAll.js +9 -8
- package/dist/chunks/channels.js +64 -0
- package/dist/chunks/client.js +12606 -0
- package/dist/chunks/command-input.js +17 -0
- package/dist/chunks/commander.js +2962 -0
- package/dist/chunks/cron-jobs.js +163 -0
- package/dist/chunks/daemon.js +545 -0
- package/dist/chunks/daemon2.js +2 -0
- package/dist/chunks/desktop.js +172 -0
- package/dist/chunks/endpoint-options.js +26 -0
- package/dist/chunks/env-proxy.js +35 -0
- package/dist/chunks/environment.js +154 -0
- package/dist/chunks/feedback.js +120 -0
- package/dist/chunks/generations.js +379 -0
- package/dist/chunks/host.js +9 -0
- package/dist/chunks/http-put.js +131 -0
- package/dist/chunks/id.js +2416 -0
- package/dist/{board-kernel → chunks}/init.js +1 -1
- package/dist/chunks/install.js +11959 -0
- package/dist/chunks/launch.js +374 -0
- package/dist/chunks/local-media.js +47 -0
- package/dist/chunks/me.js +134 -0
- package/dist/chunks/media.js +315 -0
- package/dist/chunks/models.js +242 -0
- package/dist/chunks/operands.js +46 -0
- package/dist/chunks/package-paths.js +13 -0
- package/dist/chunks/policy.js +221 -0
- package/dist/chunks/preferences.js +29 -0
- package/dist/chunks/profile.js +64 -0
- package/dist/chunks/prompts.js +41 -0
- package/dist/chunks/public.js +2 -0
- package/dist/chunks/public2.js +244 -0
- package/dist/chunks/references.js +197 -0
- package/dist/chunks/referrals.js +90 -0
- package/dist/chunks/rolldown-runtime.js +26 -0
- package/dist/chunks/rooms-connect.js +2 -0
- package/dist/chunks/rooms-connect2.js +151 -0
- package/dist/chunks/rooms-rtc.js +309 -0
- package/dist/chunks/rooms.js +211 -0
- package/dist/chunks/run.js +220 -0
- package/dist/chunks/runtime.js +638 -0
- package/dist/chunks/runtime2.js +286 -0
- package/dist/chunks/runtimes.js +48 -0
- package/dist/chunks/safe-remote-image.js +198 -0
- package/dist/chunks/schemas.js +6017 -0
- package/dist/chunks/search.js +113 -0
- package/dist/chunks/self-update.js +238 -0
- package/dist/chunks/serve.js +1246 -0
- package/dist/chunks/session-status.js +24 -0
- package/dist/chunks/skills.js +35 -0
- package/dist/chunks/spaces.js +5080 -0
- package/dist/chunks/src.js +405 -0
- package/dist/chunks/supervisor.js +2511 -0
- package/dist/chunks/supervisor2.js +2 -0
- package/dist/chunks/tasks.js +82 -0
- package/dist/chunks/themes.js +2898 -0
- package/dist/chunks/version.js +2 -0
- package/dist/chunks/version2.js +22 -0
- package/dist/chunks/version3.js +18 -0
- package/dist/chunks/web.js +7 -0
- package/dist/{board-kernel → chunks}/webworkerAll.js +1 -1
- package/dist/runtime/native/pi-extension.js +174 -166
- package/dist/runtime/worker.js +27 -16
- package/package.json +8 -9
- package/dist/about.d.ts +0 -2
- package/dist/about.js +0 -71
- package/dist/app-download.d.ts +0 -11
- package/dist/app-download.js +0 -252
- package/dist/app-ref.d.ts +0 -5
- package/dist/app-ref.js +0 -8
- package/dist/app-target.d.ts +0 -26
- package/dist/app-target.js +0 -55
- package/dist/auth.d.ts +0 -45
- package/dist/auth.js +0 -307
- package/dist/avatar.d.ts +0 -55
- package/dist/avatar.js +0 -104
- package/dist/board-command-support.d.ts +0 -6
- package/dist/board-command-support.js +0 -88
- package/dist/board-export-resources.d.ts +0 -12
- package/dist/board-export-resources.js +0 -51
- package/dist/board-export.d.ts +0 -110
- package/dist/board-export.js +0 -592
- package/dist/board-fonts.d.ts +0 -11
- package/dist/board-fonts.js +0 -10
- package/dist/board-gpu/daemon.d.ts +0 -11
- package/dist/board-gpu/daemon.js +0 -295
- package/dist/board-gpu/index.d.ts +0 -33
- package/dist/board-gpu/index.js +0 -189
- package/dist/board-gpu/protocol.d.ts +0 -77
- package/dist/board-gpu/protocol.js +0 -1
- package/dist/board-kernel.d.ts +0 -5
- package/dist/board-media-export.d.ts +0 -17
- package/dist/board-media-export.js +0 -164
- package/dist/board-media.d.ts +0 -5
- package/dist/board-media.js +0 -66
- package/dist/board-profile.d.ts +0 -21
- package/dist/board-profile.js +0 -67
- package/dist/board-simulate.d.ts +0 -67
- package/dist/board-simulate.js +0 -259
- package/dist/board-time.d.ts +0 -3
- package/dist/board-time.js +0 -34
- package/dist/bootstrap.d.ts +0 -2
- package/dist/client.d.ts +0 -5
- package/dist/client.js +0 -24
- package/dist/command-input.d.ts +0 -4
- package/dist/command-input.js +0 -16
- package/dist/commands/app-commerce.d.ts +0 -2
- package/dist/commands/app-commerce.js +0 -228
- package/dist/commands/app-domains.d.ts +0 -2
- package/dist/commands/app-domains.js +0 -133
- package/dist/commands/apps.d.ts +0 -4
- package/dist/commands/apps.js +0 -827
- package/dist/commands/auth.d.ts +0 -2
- package/dist/commands/auth.js +0 -186
- package/dist/commands/boards/authoring.d.ts +0 -2
- package/dist/commands/boards/authoring.js +0 -166
- package/dist/commands/boards/examples.d.ts +0 -10
- package/dist/commands/boards/examples.js +0 -118
- package/dist/commands/boards.d.ts +0 -13
- package/dist/commands/boards.js +0 -836
- package/dist/commands/channels.d.ts +0 -2
- package/dist/commands/channels.js +0 -74
- package/dist/commands/cron-jobs.d.ts +0 -2
- package/dist/commands/cron-jobs.js +0 -155
- package/dist/commands/decision.d.ts +0 -4
- package/dist/commands/decision.js +0 -113
- package/dist/commands/desktop.d.ts +0 -10
- package/dist/commands/desktop.js +0 -233
- package/dist/commands/feedback.d.ts +0 -2
- package/dist/commands/feedback.js +0 -131
- package/dist/commands/generations.d.ts +0 -2
- package/dist/commands/generations.js +0 -427
- package/dist/commands/host.d.ts +0 -2
- package/dist/commands/host.js +0 -11
- package/dist/commands/me.d.ts +0 -2
- package/dist/commands/me.js +0 -118
- package/dist/commands/models.d.ts +0 -28
- package/dist/commands/models.js +0 -271
- package/dist/commands/profile.d.ts +0 -2
- package/dist/commands/profile.js +0 -81
- package/dist/commands/prompts.d.ts +0 -2
- package/dist/commands/prompts.js +0 -37
- package/dist/commands/public.d.ts +0 -20
- package/dist/commands/public.js +0 -291
- package/dist/commands/references.d.ts +0 -2
- package/dist/commands/references.js +0 -193
- package/dist/commands/referrals.d.ts +0 -2
- package/dist/commands/referrals.js +0 -88
- package/dist/commands/rooms-connect.d.ts +0 -17
- package/dist/commands/rooms-connect.js +0 -140
- package/dist/commands/rooms-rtc-binary.d.ts +0 -2
- package/dist/commands/rooms-rtc-binary.js +0 -107
- package/dist/commands/rooms-rtc.d.ts +0 -21
- package/dist/commands/rooms-rtc.js +0 -171
- package/dist/commands/rooms.d.ts +0 -3
- package/dist/commands/rooms.js +0 -277
- package/dist/commands/run.d.ts +0 -13
- package/dist/commands/run.js +0 -246
- package/dist/commands/runtime.d.ts +0 -3
- package/dist/commands/runtime.js +0 -320
- package/dist/commands/sandboxd-binary.d.ts +0 -11
- package/dist/commands/sandboxd-binary.js +0 -238
- package/dist/commands/search.d.ts +0 -2
- package/dist/commands/search.js +0 -114
- package/dist/commands/session-access.d.ts +0 -2
- package/dist/commands/session-access.js +0 -70
- package/dist/commands/skills.d.ts +0 -2
- package/dist/commands/skills.js +0 -34
- package/dist/commands/space-activity.d.ts +0 -26
- package/dist/commands/space-activity.js +0 -147
- package/dist/commands/space-commerce.d.ts +0 -2
- package/dist/commands/space-commerce.js +0 -514
- package/dist/commands/space-displays.d.ts +0 -2
- package/dist/commands/space-displays.js +0 -620
- package/dist/commands/space-files.d.ts +0 -5
- package/dist/commands/space-files.js +0 -215
- package/dist/commands/space-invitations.d.ts +0 -29
- package/dist/commands/space-invitations.js +0 -189
- package/dist/commands/space-turns.d.ts +0 -49
- package/dist/commands/space-turns.js +0 -205
- package/dist/commands/space-wallet.d.ts +0 -2
- package/dist/commands/space-wallet.js +0 -64
- package/dist/commands/space-webhooks.d.ts +0 -7
- package/dist/commands/space-webhooks.js +0 -73
- package/dist/commands/spaces.d.ts +0 -25
- package/dist/commands/spaces.js +0 -2139
- package/dist/commands/tasks.d.ts +0 -8
- package/dist/commands/tasks.js +0 -80
- package/dist/commands/version.d.ts +0 -2
- package/dist/commands/version.js +0 -21
- package/dist/endpoint-options.d.ts +0 -4
- package/dist/endpoint-options.js +0 -26
- package/dist/env-proxy.d.ts +0 -5
- package/dist/env-proxy.js +0 -20
- package/dist/help-path.d.ts +0 -18
- package/dist/help-path.js +0 -223
- package/dist/host/auth.d.ts +0 -20
- package/dist/host/auth.js +0 -119
- package/dist/host/login-env.d.ts +0 -1
- package/dist/host/login-env.js +0 -31
- package/dist/host/runtime.d.ts +0 -35
- package/dist/host/runtime.js +0 -395
- package/dist/host/runtimes.d.ts +0 -9
- package/dist/host/runtimes.js +0 -42
- package/dist/host/serve.d.ts +0 -2
- package/dist/host/serve.js +0 -117
- package/dist/host/workspaces.d.ts +0 -2
- package/dist/host/workspaces.js +0 -18
- package/dist/http-put.d.ts +0 -25
- package/dist/http-put.js +0 -132
- package/dist/index.d.ts +0 -2
- package/dist/index.js +0 -129
- package/dist/launcher.d.ts +0 -4
- package/dist/launcher.js +0 -38
- package/dist/local-media.d.ts +0 -2
- package/dist/local-media.js +0 -30
- package/dist/network-error.d.ts +0 -3
- package/dist/network-error.js +0 -22
- package/dist/output.d.ts +0 -46
- package/dist/output.js +0 -244
- package/dist/runtime/archive-store.d.ts +0 -54
- package/dist/runtime/archive-store.js +0 -379
- package/dist/runtime/cli-path.d.ts +0 -5
- package/dist/runtime/cli-path.js +0 -27
- package/dist/runtime/codex-usage.d.ts +0 -7
- package/dist/runtime/codex-usage.js +0 -11
- package/dist/runtime/connection.d.ts +0 -42
- package/dist/runtime/connection.js +0 -789
- package/dist/runtime/diagnostics.d.ts +0 -107
- package/dist/runtime/diagnostics.js +0 -392
- package/dist/runtime/harnesses/chained-projection.d.ts +0 -40
- package/dist/runtime/harnesses/chained-projection.js +0 -95
- package/dist/runtime/harnesses/chained-transcript.d.ts +0 -24
- package/dist/runtime/harnesses/chained-transcript.js +0 -62
- package/dist/runtime/harnesses/claude-approval.d.ts +0 -34
- package/dist/runtime/harnesses/claude-approval.js +0 -124
- package/dist/runtime/harnesses/claude-transcript.d.ts +0 -8
- package/dist/runtime/harnesses/claude-transcript.js +0 -138
- package/dist/runtime/harnesses/claude.d.ts +0 -8
- package/dist/runtime/harnesses/claude.js +0 -225
- package/dist/runtime/harnesses/codex-approval.d.ts +0 -25
- package/dist/runtime/harnesses/codex-approval.js +0 -69
- package/dist/runtime/harnesses/codex.d.ts +0 -4
- package/dist/runtime/harnesses/codex.js +0 -269
- package/dist/runtime/harnesses/cursor-transcript.d.ts +0 -37
- package/dist/runtime/harnesses/cursor-transcript.js +0 -183
- package/dist/runtime/harnesses/cursor.d.ts +0 -24
- package/dist/runtime/harnesses/cursor.js +0 -620
- package/dist/runtime/harnesses/index.d.ts +0 -16
- package/dist/runtime/harnesses/index.js +0 -73
- package/dist/runtime/harnesses/pi.d.ts +0 -4
- package/dist/runtime/harnesses/pi.js +0 -247
- package/dist/runtime/harnesses/process.d.ts +0 -31
- package/dist/runtime/harnesses/process.js +0 -75
- package/dist/runtime/harnesses/stream-json.d.ts +0 -48
- package/dist/runtime/harnesses/stream-json.js +0 -336
- package/dist/runtime/harnesses/types.d.ts +0 -117
- package/dist/runtime/harnesses/types.js +0 -1
- package/dist/runtime/harnesses/workbuddy-transcript.d.ts +0 -8
- package/dist/runtime/harnesses/workbuddy-transcript.js +0 -127
- package/dist/runtime/harnesses/workbuddy.d.ts +0 -21
- package/dist/runtime/harnesses/workbuddy.js +0 -123
- package/dist/runtime/instance.d.ts +0 -20
- package/dist/runtime/instance.js +0 -247
- package/dist/runtime/json-rpc.d.ts +0 -53
- package/dist/runtime/json-rpc.js +0 -212
- package/dist/runtime/launch.d.ts +0 -25
- package/dist/runtime/launch.js +0 -247
- package/dist/runtime/local-workspace.d.ts +0 -15
- package/dist/runtime/local-workspace.js +0 -52
- package/dist/runtime/model-catalog.d.ts +0 -12
- package/dist/runtime/model-catalog.js +0 -84
- package/dist/runtime/native/adapters.d.ts +0 -15
- package/dist/runtime/native/adapters.js +0 -11
- package/dist/runtime/native/approvals.d.ts +0 -18
- package/dist/runtime/native/approvals.js +0 -54
- package/dist/runtime/native/archive.d.ts +0 -19
- package/dist/runtime/native/archive.js +0 -142
- package/dist/runtime/native/attach.d.ts +0 -36
- package/dist/runtime/native/attach.js +0 -128
- package/dist/runtime/native/codex-link.d.ts +0 -60
- package/dist/runtime/native/codex-link.js +0 -322
- package/dist/runtime/native/config.d.ts +0 -16
- package/dist/runtime/native/config.js +0 -24
- package/dist/runtime/native/daemon.d.ts +0 -92
- package/dist/runtime/native/daemon.js +0 -380
- package/dist/runtime/native/execution.d.ts +0 -26
- package/dist/runtime/native/execution.js +0 -34
- package/dist/runtime/native/identity.d.ts +0 -9
- package/dist/runtime/native/identity.js +0 -15
- package/dist/runtime/native/ingest.d.ts +0 -263
- package/dist/runtime/native/ingest.js +0 -884
- package/dist/runtime/native/install.d.ts +0 -9
- package/dist/runtime/native/install.js +0 -113
- package/dist/runtime/native/paths.d.ts +0 -2
- package/dist/runtime/native/paths.js +0 -7
- package/dist/runtime/native/pi-extension.d.ts +0 -36
- package/dist/runtime/native/pi-link.d.ts +0 -69
- package/dist/runtime/native/pi-link.js +0 -269
- package/dist/runtime/native/results.d.ts +0 -41
- package/dist/runtime/native/results.js +0 -128
- package/dist/runtime/native/sessions.d.ts +0 -45
- package/dist/runtime/native/sessions.js +0 -87
- package/dist/runtime/native/transcript.d.ts +0 -89
- package/dist/runtime/native/transcript.js +0 -656
- package/dist/runtime/native/translate.d.ts +0 -46
- package/dist/runtime/native/translate.js +0 -299
- package/dist/runtime/native/transport.d.ts +0 -7
- package/dist/runtime/native/transport.js +0 -16
- package/dist/runtime/native/version.d.ts +0 -5
- package/dist/runtime/native/version.js +0 -21
- package/dist/runtime/preferences.d.ts +0 -7
- package/dist/runtime/preferences.js +0 -22
- package/dist/runtime/presentation.d.ts +0 -32
- package/dist/runtime/presentation.js +0 -124
- package/dist/runtime/process-group.d.ts +0 -5
- package/dist/runtime/process-group.js +0 -161
- package/dist/runtime/projection-store.d.ts +0 -27
- package/dist/runtime/projection-store.js +0 -30
- package/dist/runtime/space-binding.d.ts +0 -48
- package/dist/runtime/space-binding.js +0 -342
- package/dist/runtime/supervisor.d.ts +0 -19
- package/dist/runtime/supervisor.js +0 -441
- package/dist/runtime/turn-projection.d.ts +0 -41
- package/dist/runtime/turn-projection.js +0 -120
- package/dist/runtime/worker.d.ts +0 -1
- package/dist/safe-remote-image.d.ts +0 -36
- package/dist/safe-remote-image.js +0 -191
- package/dist/self-update.d.ts +0 -7
- package/dist/self-update.js +0 -202
- package/dist/session-status.d.ts +0 -6
- package/dist/session-status.js +0 -16
- package/dist/space-files/limit.d.ts +0 -2
- package/dist/space-files/limit.js +0 -16
- package/dist/space-files/operands.d.ts +0 -17
- package/dist/space-files/operands.js +0 -33
- package/dist/space-files/transfer.d.ts +0 -53
- package/dist/space-files/transfer.js +0 -297
- package/dist/space-files/upload.d.ts +0 -17
- package/dist/space-files/upload.js +0 -76
- package/dist/space.d.ts +0 -44
- package/dist/space.js +0 -192
- package/dist/version.d.ts +0 -2
- package/dist/version.js +0 -17
- package/dist/web.d.ts +0 -1
- package/dist/web.js +0 -4
- /package/dist/{board-kernel → chunks}/lexer.js +0 -0
package/dist/commands/me.js
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import { createClient } from "../client.js";
|
|
2
|
-
import { formatLocalDateTime, handleHttp, json as outJson, jsonRequested, table } from "../output.js";
|
|
3
|
-
import { SESSION_STATUS_COLUMN } from "../session-status.js";
|
|
4
|
-
function parseInteger(value, name, min) {
|
|
5
|
-
const parsed = Number.parseInt(value, 10);
|
|
6
|
-
if (!Number.isSafeInteger(parsed) || parsed < min) {
|
|
7
|
-
process.stderr.write(`\n ✗ Invalid ${name}\n ${name} must be an integer ≥ ${min}\n\n`);
|
|
8
|
-
process.exit(1);
|
|
9
|
-
}
|
|
10
|
-
return parsed;
|
|
11
|
-
}
|
|
12
|
-
export function registerMe(program) {
|
|
13
|
-
const meCmd = program.command("me").description("Account-level data across your spaces");
|
|
14
|
-
meCmd
|
|
15
|
-
.command("sessions")
|
|
16
|
-
.alias("list-sessions")
|
|
17
|
-
.description("List sessions you created across all spaces")
|
|
18
|
-
.option("--limit <n>", "Maximum number of sessions (default 20)")
|
|
19
|
-
.option("--cursor <cursor>", "Pagination cursor from a previous result")
|
|
20
|
-
.option("--json", "Output as JSON")
|
|
21
|
-
.action(async (opts) => {
|
|
22
|
-
const client = createClient();
|
|
23
|
-
try {
|
|
24
|
-
const result = await client.user.listSessions({
|
|
25
|
-
limit: opts.limit ? parseInteger(opts.limit, "limit", 1) : undefined,
|
|
26
|
-
cursor: opts.cursor ?? null,
|
|
27
|
-
});
|
|
28
|
-
if (jsonRequested(opts))
|
|
29
|
-
return outJson(result);
|
|
30
|
-
if (result.sessions.length === 0) {
|
|
31
|
-
console.log(" (empty)");
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
table(result.sessions, [
|
|
35
|
-
{ key: "id", label: "ID" },
|
|
36
|
-
{ key: "spaceId", label: "Space" },
|
|
37
|
-
{ key: "title", label: "Title" },
|
|
38
|
-
SESSION_STATUS_COLUMN,
|
|
39
|
-
{ key: "totalMessages", label: "Messages" },
|
|
40
|
-
{ key: "createdAt", label: "Created" },
|
|
41
|
-
]);
|
|
42
|
-
}
|
|
43
|
-
catch (e) {
|
|
44
|
-
handleHttp(e);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
meCmd
|
|
48
|
-
.command("billing-activity")
|
|
49
|
-
.description("List your personal wallet activity, including generation reserves and refunds")
|
|
50
|
-
.option("--page <n>", "Page number (default 1)")
|
|
51
|
-
.option("--json", "Output as JSON")
|
|
52
|
-
.action(async (opts) => {
|
|
53
|
-
const client = createClient();
|
|
54
|
-
try {
|
|
55
|
-
const { activities } = await client.billing.getBalanceActivities({
|
|
56
|
-
page: opts.page ? parseInteger(opts.page, "page", 1) : undefined,
|
|
57
|
-
});
|
|
58
|
-
if (jsonRequested(opts))
|
|
59
|
-
return outJson(activities);
|
|
60
|
-
if (activities.items.length === 0) {
|
|
61
|
-
console.log(" (empty)");
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
table(activities.items, [
|
|
65
|
-
{ key: "title", label: "Activity" },
|
|
66
|
-
{ key: "amountUsd", label: "Amount (USD)" },
|
|
67
|
-
{ key: "operationId", label: "Operation" },
|
|
68
|
-
{ key: "createdAt", label: "Date" },
|
|
69
|
-
]);
|
|
70
|
-
if (activities.pagination.hasMore)
|
|
71
|
-
console.log(` More: --page ${activities.page + 1}`);
|
|
72
|
-
}
|
|
73
|
-
catch (e) {
|
|
74
|
-
handleHttp(e);
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
meCmd
|
|
78
|
-
.command("activity")
|
|
79
|
-
.description("Show your activity across all spaces")
|
|
80
|
-
.option("--days <n>", "Show the last N days (default: 30)")
|
|
81
|
-
.option("--from <date>", "Start at this ISO 8601 date")
|
|
82
|
-
.option("--to <date>", "Stop before this ISO 8601 date")
|
|
83
|
-
.option("--json", "Output as JSON")
|
|
84
|
-
.addHelpText("after", "\nExamples:\n $ cohub me activity --days 7\n $ cohub me activity --from 2026-01-01 --to 2026-02-01")
|
|
85
|
-
.action(async (opts) => {
|
|
86
|
-
if (opts.days && (opts.from || opts.to)) {
|
|
87
|
-
process.stderr.write("\n ✗ Invalid range\n --days cannot be combined with --from or --to\n\n");
|
|
88
|
-
process.exitCode = 1;
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (opts.to && !opts.from) {
|
|
92
|
-
process.stderr.write("\n ✗ Invalid range\n --from is required when --to is provided\n\n");
|
|
93
|
-
process.exitCode = 1;
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
const client = createClient();
|
|
97
|
-
try {
|
|
98
|
-
const activity = await client.user.getActivity({
|
|
99
|
-
days: opts.days ? parseInteger(opts.days, "days", 1) : undefined,
|
|
100
|
-
from: opts.from,
|
|
101
|
-
to: opts.to,
|
|
102
|
-
});
|
|
103
|
-
if (jsonRequested(opts))
|
|
104
|
-
return outJson(activity);
|
|
105
|
-
console.log(`\n ${formatLocalDateTime(activity.range.from)} → ${formatLocalDateTime(activity.range.to)}`);
|
|
106
|
-
table([activity.totals], [
|
|
107
|
-
{ key: "totalTokens", label: "Tokens" },
|
|
108
|
-
{ key: "costTotal", label: "Cost ($)" },
|
|
109
|
-
{ key: "requestCount", label: "Requests" },
|
|
110
|
-
{ key: "successCount", label: "Success" },
|
|
111
|
-
{ key: "errorCount", label: "Errors" },
|
|
112
|
-
]);
|
|
113
|
-
}
|
|
114
|
-
catch (e) {
|
|
115
|
-
handleHttp(e);
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import type { Command } from "commander";
|
|
2
|
-
import { type PublicGenerationDeclaration } from "@neta-art/cohub";
|
|
3
|
-
type MultimodalModelSummary = Pick<PublicGenerationDeclaration, "model" | "title" | "description" | "pricing">;
|
|
4
|
-
export declare function toMultimodalModelSummary(model: PublicGenerationDeclaration): MultimodalModelSummary;
|
|
5
|
-
export type GenerationModelPricing = NonNullable<PublicGenerationDeclaration["pricing"]>;
|
|
6
|
-
/**
|
|
7
|
-
* Render a display-only unit price, e.g. `$0.04 / image` or `$0.10–$0.50 / second`,
|
|
8
|
-
* optionally suffixed with a qualifier note.
|
|
9
|
-
*
|
|
10
|
-
* The raw `pricing` object is preserved in `--json` for machines; this string
|
|
11
|
-
* targets humans and agents reading the table output.
|
|
12
|
-
*/
|
|
13
|
-
export declare function formatGenerationPrice(pricing: GenerationModelPricing): string;
|
|
14
|
-
/**
|
|
15
|
-
* Render per-million-token LLM cost, e.g. `$3 /M input · $15 /M output`,
|
|
16
|
-
* appending cache rates only when the model declares them.
|
|
17
|
-
*/
|
|
18
|
-
export declare function formatLlmModelCost(model: Record<string, unknown>): string;
|
|
19
|
-
/**
|
|
20
|
-
* Drop hidden models from LLM discovery, mirroring generation models and the web
|
|
21
|
-
* picker. Providers left with no visible model are removed so the catalog shape
|
|
22
|
-
* matches what is actually shown. Explicit `true` is the only hidden signal.
|
|
23
|
-
*/
|
|
24
|
-
export declare function filterHiddenLlmModels<T extends {
|
|
25
|
-
model: Record<string, unknown>;
|
|
26
|
-
}>(catalog: Record<string, T[]>): Record<string, T[]>;
|
|
27
|
-
export declare function registerModels(program: Command): void;
|
|
28
|
-
export {};
|
package/dist/commands/models.js
DELETED
|
@@ -1,271 +0,0 @@
|
|
|
1
|
-
import { filterDiscoverableGenerationModels, filterGenerationDeclarationsByPolicy, getAllowedGenerationModelIds, parseGenerationPolicyFromEnv, } from "@neta-art/cohub";
|
|
2
|
-
import { createClient } from "../client.js";
|
|
3
|
-
import { explicitSpace, failSpaceTarget, resolveSpaceRef } from "../space.js";
|
|
4
|
-
import { table, json as outJson, jsonRequested, error, handleHttp } from "../output.js";
|
|
5
|
-
export function toMultimodalModelSummary(model) {
|
|
6
|
-
return {
|
|
7
|
-
model: model.model,
|
|
8
|
-
...(model.title ? { title: model.title } : {}),
|
|
9
|
-
...(model.description ? { description: model.description } : {}),
|
|
10
|
-
// Keep pricing structured for `--json`; the human table formats it separately.
|
|
11
|
-
...(model.pricing ? { pricing: model.pricing } : {}),
|
|
12
|
-
};
|
|
13
|
-
}
|
|
14
|
-
function printSection(title, lines) {
|
|
15
|
-
if (lines.length === 0)
|
|
16
|
-
return;
|
|
17
|
-
console.log(`\n${title}`);
|
|
18
|
-
for (const line of lines)
|
|
19
|
-
console.log(` ${line}`);
|
|
20
|
-
}
|
|
21
|
-
const PRICE_UNIT_LABELS = {
|
|
22
|
-
image: "image",
|
|
23
|
-
second: "second",
|
|
24
|
-
request: "request",
|
|
25
|
-
"1m_tokens": "1M tokens",
|
|
26
|
-
};
|
|
27
|
-
/** USD amounts stay compact while preserving the precision the value actually needs. */
|
|
28
|
-
function formatUsdAmount(value) {
|
|
29
|
-
const magnitude = Math.abs(value);
|
|
30
|
-
const isWholeDollar = magnitude >= 1 && Number.isInteger(value);
|
|
31
|
-
const fractionDigits = value === 0 || isWholeDollar ? 0 : magnitude < 0.01 ? 4 : 2;
|
|
32
|
-
return `$${value.toLocaleString("en-US", { minimumFractionDigits: fractionDigits, maximumFractionDigits: fractionDigits })}`;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Render a display-only unit price, e.g. `$0.04 / image` or `$0.10–$0.50 / second`,
|
|
36
|
-
* optionally suffixed with a qualifier note.
|
|
37
|
-
*
|
|
38
|
-
* The raw `pricing` object is preserved in `--json` for machines; this string
|
|
39
|
-
* targets humans and agents reading the table output.
|
|
40
|
-
*/
|
|
41
|
-
export function formatGenerationPrice(pricing) {
|
|
42
|
-
const unit = PRICE_UNIT_LABELS[pricing.unit];
|
|
43
|
-
const value = typeof pricing.amount === "number"
|
|
44
|
-
? formatUsdAmount(pricing.amount)
|
|
45
|
-
: pricing.min === pricing.max
|
|
46
|
-
? formatUsdAmount(pricing.min)
|
|
47
|
-
: `${formatUsdAmount(pricing.min)}\u2013${formatUsdAmount(pricing.max)}`;
|
|
48
|
-
const base = `${value} / ${unit}`;
|
|
49
|
-
return pricing.note ? `${base} \u00b7 ${pricing.note}` : base;
|
|
50
|
-
}
|
|
51
|
-
/** LLM catalog entries carry cost as an untyped `model.cost` bag; validate it before use. */
|
|
52
|
-
function readLlmModelCost(model) {
|
|
53
|
-
const cost = model.cost;
|
|
54
|
-
if (!cost || typeof cost !== "object")
|
|
55
|
-
return null;
|
|
56
|
-
const { input, output, cacheRead, cacheWrite } = cost;
|
|
57
|
-
if (typeof input !== "number" || typeof output !== "number")
|
|
58
|
-
return null;
|
|
59
|
-
return {
|
|
60
|
-
input,
|
|
61
|
-
output,
|
|
62
|
-
...(typeof cacheRead === "number" ? { cacheRead } : {}),
|
|
63
|
-
...(typeof cacheWrite === "number" ? { cacheWrite } : {}),
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
/** Zero or absent per-token components carry no signal, so they are omitted. */
|
|
67
|
-
function formatLlmCostValue(value) {
|
|
68
|
-
return typeof value === "number" && Number.isFinite(value) && value !== 0 ? formatUsdAmount(value) : null;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Render per-million-token LLM cost, e.g. `$3 /M input · $15 /M output`,
|
|
72
|
-
* appending cache rates only when the model declares them.
|
|
73
|
-
*/
|
|
74
|
-
export function formatLlmModelCost(model) {
|
|
75
|
-
const cost = readLlmModelCost(model);
|
|
76
|
-
if (!cost)
|
|
77
|
-
return "";
|
|
78
|
-
const parts = [
|
|
79
|
-
[cost.input, "input"],
|
|
80
|
-
[cost.output, "output"],
|
|
81
|
-
[cost.cacheRead, "cache read"],
|
|
82
|
-
[cost.cacheWrite, "cache write"],
|
|
83
|
-
];
|
|
84
|
-
return parts.flatMap(([value, label]) => {
|
|
85
|
-
const formatted = formatLlmCostValue(value);
|
|
86
|
-
return formatted ? [`${formatted} /M ${label}`] : [];
|
|
87
|
-
}).join(" \u00b7 ");
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Drop hidden models from LLM discovery, mirroring generation models and the web
|
|
91
|
-
* picker. Providers left with no visible model are removed so the catalog shape
|
|
92
|
-
* matches what is actually shown. Explicit `true` is the only hidden signal.
|
|
93
|
-
*/
|
|
94
|
-
export function filterHiddenLlmModels(catalog) {
|
|
95
|
-
const visible = {};
|
|
96
|
-
for (const [provider, entries] of Object.entries(catalog)) {
|
|
97
|
-
const models = entries.filter((entry) => entry.model.hidden !== true);
|
|
98
|
-
if (models.length > 0)
|
|
99
|
-
visible[provider] = models;
|
|
100
|
-
}
|
|
101
|
-
return visible;
|
|
102
|
-
}
|
|
103
|
-
function formatContentSpec(spec) {
|
|
104
|
-
const details = [];
|
|
105
|
-
const roles = spec.roles;
|
|
106
|
-
details.push(spec.required === false ? "optional" : "required");
|
|
107
|
-
if (typeof spec.min === "number")
|
|
108
|
-
details.push(`min ${spec.min}`);
|
|
109
|
-
if (typeof spec.max === "number")
|
|
110
|
-
details.push(`max ${spec.max}`);
|
|
111
|
-
if (spec.sources?.length)
|
|
112
|
-
details.push(`sources: ${spec.sources.join(", ")}`);
|
|
113
|
-
if (roles?.length)
|
|
114
|
-
details.push(`roles: ${roles.join(", ")}`);
|
|
115
|
-
if (spec.merge)
|
|
116
|
-
details.push(`merge: ${spec.merge}`);
|
|
117
|
-
if (spec.description)
|
|
118
|
-
details.push(spec.description);
|
|
119
|
-
return `${spec.type}${details.length > 0 ? ` — ${details.join("; ")}` : ""}`;
|
|
120
|
-
}
|
|
121
|
-
function formatParameter(name, spec) {
|
|
122
|
-
const lines = [`${name}`];
|
|
123
|
-
const details = [`type: ${spec.type}`];
|
|
124
|
-
if (spec.optional)
|
|
125
|
-
details.push("optional");
|
|
126
|
-
if ("default" in spec && spec.default !== undefined)
|
|
127
|
-
details.push(`default: ${String(spec.default)}`);
|
|
128
|
-
if ("min" in spec && typeof spec.min === "number")
|
|
129
|
-
details.push(`min: ${spec.min}`);
|
|
130
|
-
if ("max" in spec && typeof spec.max === "number")
|
|
131
|
-
details.push(`max: ${spec.max}`);
|
|
132
|
-
if ("enum" in spec && spec.enum?.length)
|
|
133
|
-
details.push(`values: ${spec.enum.join(", ")}`);
|
|
134
|
-
lines.push(` ${details.join("; ")}`);
|
|
135
|
-
if (spec.description)
|
|
136
|
-
lines.push(` ${spec.description}`);
|
|
137
|
-
if ("examples" in spec && spec.examples?.length)
|
|
138
|
-
lines.push(` examples: ${spec.examples.map(String).join(", ")}`);
|
|
139
|
-
return lines;
|
|
140
|
-
}
|
|
141
|
-
function printMultimodalModel(model) {
|
|
142
|
-
console.log(model.title ?? model.model);
|
|
143
|
-
printSection("Model", [model.model]);
|
|
144
|
-
if (model.description)
|
|
145
|
-
printSection("Description", [model.description]);
|
|
146
|
-
if (model.pricing)
|
|
147
|
-
printSection("Pricing", [formatGenerationPrice(model.pricing)]);
|
|
148
|
-
printSection("Input", model.content.input.map(formatContentSpec));
|
|
149
|
-
const parameterLines = Object.entries(model.parameters ?? {}).flatMap(([name, spec]) => formatParameter(name, spec));
|
|
150
|
-
printSection("Parameters", parameterLines);
|
|
151
|
-
const examples = model.examples ?? [];
|
|
152
|
-
printSection("Examples", examples.map((example, index) => {
|
|
153
|
-
const title = example.title ? `${example.title}: ` : "";
|
|
154
|
-
const prompt = example.request.content.find((block) => block.type === "text")?.text;
|
|
155
|
-
return `${index + 1}. ${title}${prompt ? `"${prompt}"` : example.request.model}`;
|
|
156
|
-
}));
|
|
157
|
-
}
|
|
158
|
-
function formatModelContext(model) {
|
|
159
|
-
const value = model.contextWindow;
|
|
160
|
-
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0)
|
|
161
|
-
return "";
|
|
162
|
-
const source = typeof model.contextWindowSource === "string" ? model.contextWindowSource : null;
|
|
163
|
-
const ref = typeof model.contextWindowSourceRef === "string" ? `:${model.contextWindowSourceRef}` : "";
|
|
164
|
-
return source ? `${formatTokenCount(value)} (${source}${ref})` : formatTokenCount(value);
|
|
165
|
-
}
|
|
166
|
-
function formatTokenCount(value) {
|
|
167
|
-
if (value >= 1_000_000)
|
|
168
|
-
return `${(value / 1_000_000).toFixed(1)}M`;
|
|
169
|
-
if (value >= 1_000)
|
|
170
|
-
return `${(value / 1_000).toFixed(1)}k`;
|
|
171
|
-
return String(value);
|
|
172
|
-
}
|
|
173
|
-
export function registerModels(program) {
|
|
174
|
-
const cmd = program
|
|
175
|
-
.command("models")
|
|
176
|
-
.description("List available LLM and multimodal models")
|
|
177
|
-
.addHelpText("after", `
|
|
178
|
-
|
|
179
|
-
Examples:
|
|
180
|
-
cohub models ls
|
|
181
|
-
cohub models ls --space <spaceId>
|
|
182
|
-
cohub models ls --model-type multimodal
|
|
183
|
-
cohub models ls --model-type multimodal --json
|
|
184
|
-
cohub models show <model>
|
|
185
|
-
cohub models show <model> --json
|
|
186
|
-
`);
|
|
187
|
-
cmd
|
|
188
|
-
.command("ls")
|
|
189
|
-
.alias("list")
|
|
190
|
-
.description("List available models")
|
|
191
|
-
.option("--model-type <type>", "Model type: llm | multimodal", "llm")
|
|
192
|
-
.option("--json", "Output as JSON")
|
|
193
|
-
.action(async (opts, command) => {
|
|
194
|
-
const client = createClient();
|
|
195
|
-
try {
|
|
196
|
-
if (opts.modelType === "multimodal") {
|
|
197
|
-
const response = await client.models.listMultimodal();
|
|
198
|
-
const policy = parseGenerationPolicyFromEnv(process.env);
|
|
199
|
-
const allowedModelIds = getAllowedGenerationModelIds(policy);
|
|
200
|
-
const filtered = filterGenerationDeclarationsByPolicy(response.models, policy);
|
|
201
|
-
const models = filterDiscoverableGenerationModels(filtered, {
|
|
202
|
-
includeModelIds: allowedModelIds ?? undefined,
|
|
203
|
-
}).map(toMultimodalModelSummary);
|
|
204
|
-
if (jsonRequested(opts))
|
|
205
|
-
return outJson({ models });
|
|
206
|
-
table(models, [
|
|
207
|
-
{ key: "model", label: "Model" },
|
|
208
|
-
{ key: "title", label: "Title" },
|
|
209
|
-
{
|
|
210
|
-
key: "pricing",
|
|
211
|
-
label: "Price",
|
|
212
|
-
format: (value) => (value ? formatGenerationPrice(value) : ""),
|
|
213
|
-
},
|
|
214
|
-
{ key: "description", label: "Description" },
|
|
215
|
-
]);
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
if (opts.modelType && opts.modelType !== "llm") {
|
|
219
|
-
return error("Invalid model type", "Use --model-type llm or --model-type multimodal");
|
|
220
|
-
}
|
|
221
|
-
const spaceRef = explicitSpace(command);
|
|
222
|
-
const spaceId = spaceRef ? await resolveSpaceRef(spaceRef).catch(failSpaceTarget) : undefined;
|
|
223
|
-
const catalog = await client.models.list({ spaceId });
|
|
224
|
-
const visibleCatalog = filterHiddenLlmModels(catalog);
|
|
225
|
-
if (jsonRequested(opts))
|
|
226
|
-
return outJson(visibleCatalog);
|
|
227
|
-
if (Object.keys(visibleCatalog).length === 0)
|
|
228
|
-
return console.log(" (empty)");
|
|
229
|
-
for (const [provider, entries] of Object.entries(visibleCatalog)) {
|
|
230
|
-
console.log(`\n ${provider}`);
|
|
231
|
-
console.log(` ${"─".repeat(provider.length)}`);
|
|
232
|
-
table(entries.map((entry) => ({
|
|
233
|
-
id: entry.id,
|
|
234
|
-
provider: entry.provider,
|
|
235
|
-
context: formatModelContext(entry.model),
|
|
236
|
-
cost: formatLlmModelCost(entry.model),
|
|
237
|
-
})), [
|
|
238
|
-
{ key: "id", label: "ID" },
|
|
239
|
-
{ key: "provider", label: "Provider" },
|
|
240
|
-
{ key: "context", label: "Context" },
|
|
241
|
-
{ key: "cost", label: "Cost" },
|
|
242
|
-
]);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
catch (e) {
|
|
246
|
-
handleHttp(e);
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
cmd
|
|
250
|
-
.command("show")
|
|
251
|
-
.description("Show full multimodal model details")
|
|
252
|
-
.argument("<model>", "Multimodal model ID")
|
|
253
|
-
.option("--json", "Output as JSON")
|
|
254
|
-
.action(async (modelId, opts) => {
|
|
255
|
-
const client = createClient();
|
|
256
|
-
try {
|
|
257
|
-
const response = await client.models.listMultimodal();
|
|
258
|
-
const models = filterGenerationDeclarationsByPolicy(response.models, parseGenerationPolicyFromEnv(process.env));
|
|
259
|
-
const model = models.find((item) => item.model === modelId);
|
|
260
|
-
if (!model) {
|
|
261
|
-
return error("Model not found", `No multimodal model named ${modelId}`);
|
|
262
|
-
}
|
|
263
|
-
if (jsonRequested(opts))
|
|
264
|
-
return outJson(model);
|
|
265
|
-
printMultimodalModel(model);
|
|
266
|
-
}
|
|
267
|
-
catch (e) {
|
|
268
|
-
handleHttp(e);
|
|
269
|
-
}
|
|
270
|
-
});
|
|
271
|
-
}
|
package/dist/commands/profile.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { uploadAvatarAsset } from "../avatar.js";
|
|
2
|
-
import { createClient } from "../client.js";
|
|
3
|
-
import { json as outJson, jsonRequested, ok, error, handleHttp } from "../output.js";
|
|
4
|
-
export function registerProfile(program) {
|
|
5
|
-
const profileCmd = program.command("profile").description("Manage your profile");
|
|
6
|
-
profileCmd
|
|
7
|
-
.command("get <username>")
|
|
8
|
-
.description("Show a public user profile")
|
|
9
|
-
.option("--json", "Output as JSON")
|
|
10
|
-
.action(async (username, opts) => {
|
|
11
|
-
const client = createClient();
|
|
12
|
-
try {
|
|
13
|
-
const result = await client.users.getByUsername(username);
|
|
14
|
-
if (jsonRequested(opts))
|
|
15
|
-
return outJson(result);
|
|
16
|
-
const handle = result.profile.username ? `@${result.profile.username}` : result.profile.userUuid;
|
|
17
|
-
console.log(`\n ${result.profile.displayName} (${handle})`);
|
|
18
|
-
console.log(` Spaces: ${result.spaces.length}`);
|
|
19
|
-
console.log(` Apps: ${result.apps.length}\n`);
|
|
20
|
-
if (result.spaces.length > 0) {
|
|
21
|
-
console.log(" Spaces:");
|
|
22
|
-
for (const space of result.spaces) {
|
|
23
|
-
console.log(` - ${space.name} [${space.accessLabel}] ${space.spaceUrl}`);
|
|
24
|
-
}
|
|
25
|
-
console.log("");
|
|
26
|
-
}
|
|
27
|
-
if (result.apps.length > 0) {
|
|
28
|
-
console.log(" Apps:");
|
|
29
|
-
for (const app of result.apps) {
|
|
30
|
-
console.log(` - ${app.title} ${app.publicUrl}`);
|
|
31
|
-
}
|
|
32
|
-
console.log("");
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
catch (e) {
|
|
36
|
-
handleHttp(e);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
profileCmd
|
|
40
|
-
.command("update")
|
|
41
|
-
.description("Update your profile")
|
|
42
|
-
.option("--username <username>", "Public username")
|
|
43
|
-
.option("--display-name <name>", "Display name")
|
|
44
|
-
.option("--json", "Output as JSON")
|
|
45
|
-
.action(async (opts) => {
|
|
46
|
-
const input = {
|
|
47
|
-
username: opts.username,
|
|
48
|
-
displayName: opts.displayName,
|
|
49
|
-
};
|
|
50
|
-
if (input.username === undefined && input.displayName === undefined) {
|
|
51
|
-
return error("Nothing to update", "Pass --username or --display-name.");
|
|
52
|
-
}
|
|
53
|
-
const client = createClient();
|
|
54
|
-
try {
|
|
55
|
-
const result = await client.user.updateProfile(input);
|
|
56
|
-
if (jsonRequested(opts))
|
|
57
|
-
return outJson(result);
|
|
58
|
-
ok("Profile updated");
|
|
59
|
-
}
|
|
60
|
-
catch (e) {
|
|
61
|
-
handleHttp(e);
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
profileCmd
|
|
65
|
-
.command("avatar <path>")
|
|
66
|
-
.description("Upload your avatar")
|
|
67
|
-
.option("--json", "Output as JSON")
|
|
68
|
-
.action(async (path, opts) => {
|
|
69
|
-
const client = createClient();
|
|
70
|
-
try {
|
|
71
|
-
const asset = await uploadAvatarAsset({ client, purpose: "user_avatar", path });
|
|
72
|
-
const result = await client.user.updateProfile({ avatarUrl: asset.publicUrl });
|
|
73
|
-
if (jsonRequested(opts))
|
|
74
|
-
return outJson({ ...result, asset });
|
|
75
|
-
ok("Avatar updated");
|
|
76
|
-
}
|
|
77
|
-
catch (e) {
|
|
78
|
-
handleHttp(e);
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
}
|
package/dist/commands/prompts.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { createClient } from "../client.js";
|
|
2
|
-
import { table, json as outJson, jsonRequested, handleHttp } from "../output.js";
|
|
3
|
-
export function registerPrompts(program) {
|
|
4
|
-
const cmd = program.command("prompts").description("Prompt template management");
|
|
5
|
-
cmd
|
|
6
|
-
.command("ls")
|
|
7
|
-
.alias("list")
|
|
8
|
-
.description("List prompt templates")
|
|
9
|
-
.option("--space <id>", "Filter by space")
|
|
10
|
-
.option("--json", "Output as JSON")
|
|
11
|
-
.action(async (opts) => {
|
|
12
|
-
const client = createClient();
|
|
13
|
-
try {
|
|
14
|
-
const spaceId = opts.space ?? program.opts().space;
|
|
15
|
-
const result = await client.prompts.list({ spaceId });
|
|
16
|
-
if (jsonRequested(opts))
|
|
17
|
-
return outJson(result);
|
|
18
|
-
if (result.prompts.length === 0)
|
|
19
|
-
return console.log(" (empty)");
|
|
20
|
-
table(result.prompts.map((prompt) => ({
|
|
21
|
-
command: `/${prompt.name}`,
|
|
22
|
-
name: prompt.name,
|
|
23
|
-
scope: prompt.scope,
|
|
24
|
-
category: prompt.category ?? "",
|
|
25
|
-
description: prompt.description,
|
|
26
|
-
})), [
|
|
27
|
-
{ key: "command", label: "Command" },
|
|
28
|
-
{ key: "scope", label: "Scope" },
|
|
29
|
-
{ key: "category", label: "Category" },
|
|
30
|
-
{ key: "description", label: "Description" },
|
|
31
|
-
]);
|
|
32
|
-
}
|
|
33
|
-
catch (e) {
|
|
34
|
-
handleHttp(e);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type CohubHttpClient } from "@neta-art/cohub";
|
|
2
|
-
import type { Command } from "commander";
|
|
3
|
-
type LocalPublicFile = {
|
|
4
|
-
id: string;
|
|
5
|
-
localPath: string;
|
|
6
|
-
publicPath: string;
|
|
7
|
-
size: number;
|
|
8
|
-
mimeType: string;
|
|
9
|
-
};
|
|
10
|
-
type PublicCommandDeps = {
|
|
11
|
-
createClient?: () => CohubHttpClient;
|
|
12
|
-
fetch?: typeof fetch;
|
|
13
|
-
};
|
|
14
|
-
export declare function collectPublicUpload(source: string, destination?: string): Promise<{
|
|
15
|
-
files: LocalPublicFile[];
|
|
16
|
-
destination: string;
|
|
17
|
-
entryPath: string | null;
|
|
18
|
-
}>;
|
|
19
|
-
export declare function registerPublic(program: Command, deps?: PublicCommandDeps): Command;
|
|
20
|
-
export {};
|