@neta-art/cohub-cli 10.24.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/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 -121
- 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 -141
- 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 -2170
- 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 -10
- package/dist/session-status.js +0 -25
- 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
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
import { n as buildInfo, t as CLI_VERSION } from "./version2.js";
|
|
2
|
+
import { r as Help, t as Command } from "./commander.js";
|
|
3
|
+
import { n as registerEndpointOptions } from "./endpoint-options.js";
|
|
4
|
+
//#region src/command-index.ts
|
|
5
|
+
const COMMANDS = [
|
|
6
|
+
{
|
|
7
|
+
names: ["auth"],
|
|
8
|
+
load: async () => (await import("./auth.js")).registerAuth
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
names: ["boards"],
|
|
12
|
+
load: async () => (await import("./boards.js")).registerBoards
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
names: ["profile"],
|
|
16
|
+
load: async () => (await import("./profile.js")).registerProfile
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
names: ["me"],
|
|
20
|
+
load: async () => (await import("./me.js")).registerMe
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
names: [
|
|
24
|
+
"prompt",
|
|
25
|
+
"completion",
|
|
26
|
+
"decision"
|
|
27
|
+
],
|
|
28
|
+
load: async () => (await import("./spaces.js")).registerPrompt
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
names: ["spaces", "labels"],
|
|
32
|
+
load: async () => (await import("./spaces.js")).registerSpaces
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
names: ["runtime"],
|
|
36
|
+
load: async () => (await import("./runtime2.js")).registerRuntime
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
names: ["channels"],
|
|
40
|
+
load: async () => (await import("./channels.js")).registerChannels
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
names: ["generate"],
|
|
44
|
+
load: async () => (await import("./generations.js")).registerGenerations
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
names: ["models"],
|
|
48
|
+
load: async () => (await import("./models.js")).registerModels
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
names: ["prompts"],
|
|
52
|
+
load: async () => (await import("./prompts.js")).registerPrompts
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
names: ["public"],
|
|
56
|
+
load: async () => (await import("./public.js")).registerPublic
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
names: ["skills"],
|
|
60
|
+
load: async () => (await import("./skills.js")).registerSkills
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
names: ["search"],
|
|
64
|
+
load: async () => (await import("./search.js")).registerSearch
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
names: ["references"],
|
|
68
|
+
load: async () => (await import("./references.js")).registerReferences
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
names: ["referrals"],
|
|
72
|
+
load: async () => (await import("./referrals.js")).registerReferrals
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
names: ["tasks"],
|
|
76
|
+
load: async () => (await import("./tasks.js")).registerTasks
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
names: ["cron-jobs"],
|
|
80
|
+
load: async () => (await import("./cron-jobs.js")).registerCronJobs
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
names: ["apps", "works"],
|
|
84
|
+
load: async () => (await import("./apps.js")).registerApps
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
names: ["rooms"],
|
|
88
|
+
load: async () => (await import("./rooms.js")).registerRooms
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
names: ["feedback"],
|
|
92
|
+
load: async () => (await import("./feedback.js")).registerFeedback
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
names: ["desktop"],
|
|
96
|
+
load: async () => (await import("./desktop.js")).registerDesktop
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
names: ["ui"],
|
|
100
|
+
load: async () => (await import("./desktop.js")).registerLegacyUi
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
names: ["host"],
|
|
104
|
+
load: async () => (await import("./host.js")).registerHost
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
names: ["version"],
|
|
108
|
+
load: async () => (await import("./version3.js")).registerVersion
|
|
109
|
+
}
|
|
110
|
+
];
|
|
111
|
+
async function registerCommands(program, commands = COMMANDS) {
|
|
112
|
+
for (const register of await Promise.all(commands.map((command) => command.load()))) register(program);
|
|
113
|
+
}
|
|
114
|
+
function addRootCommandStubs(program, lines) {
|
|
115
|
+
const terms = /* @__PURE__ */ new Map();
|
|
116
|
+
for (const [term, description] of lines) terms.set(program.command(term.split(/[ |]/, 1)[0] ?? term).description(description), term);
|
|
117
|
+
program.configureHelp({ subcommandTerm(command) {
|
|
118
|
+
return terms.get(command) ?? Help.prototype.subcommandTerm.call(this, command);
|
|
119
|
+
} });
|
|
120
|
+
}
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/help-path.ts
|
|
123
|
+
function isHelpFlag(token) {
|
|
124
|
+
return token === "-h" || token === "--help";
|
|
125
|
+
}
|
|
126
|
+
function findChild(command, name) {
|
|
127
|
+
return command.commands.find((child) => {
|
|
128
|
+
if (child.name() === "help") return false;
|
|
129
|
+
return child.name() === name || child.aliases().includes(name);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function hasSubcommands(command) {
|
|
133
|
+
return command.commands.some((child) => child.name() !== "help");
|
|
134
|
+
}
|
|
135
|
+
function knownOptions(command) {
|
|
136
|
+
const options = [];
|
|
137
|
+
let current = command;
|
|
138
|
+
while (current) {
|
|
139
|
+
options.push(...current.options);
|
|
140
|
+
current = current.parent;
|
|
141
|
+
}
|
|
142
|
+
return options;
|
|
143
|
+
}
|
|
144
|
+
function matchOption(command, token) {
|
|
145
|
+
if (!token.startsWith("-") || token === "-") return void 0;
|
|
146
|
+
const eq = token.indexOf("=");
|
|
147
|
+
const inline = eq >= 0;
|
|
148
|
+
const flag = inline ? token.slice(0, eq) : token;
|
|
149
|
+
for (const option of knownOptions(command)) if (option.short === flag || option.long === flag) return {
|
|
150
|
+
option,
|
|
151
|
+
inline
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function skipOption(command, argv, index) {
|
|
155
|
+
const matched = matchOption(command, argv[index] ?? "");
|
|
156
|
+
const next = index + 1;
|
|
157
|
+
if (matched?.inline) return next;
|
|
158
|
+
const value = argv[next];
|
|
159
|
+
if (!value) return next;
|
|
160
|
+
if (matched?.option.required) return next + 1;
|
|
161
|
+
if (matched?.option.optional && !value.startsWith("-")) return next + 1;
|
|
162
|
+
return next;
|
|
163
|
+
}
|
|
164
|
+
function remainderRequestsHelp(command, argv) {
|
|
165
|
+
let index = 0;
|
|
166
|
+
while (index < argv.length) {
|
|
167
|
+
const token = argv[index] ?? "";
|
|
168
|
+
if (token === "--") break;
|
|
169
|
+
if (isHelpFlag(token)) return true;
|
|
170
|
+
if (token.startsWith("-")) {
|
|
171
|
+
index = skipOption(command, argv, index);
|
|
172
|
+
continue;
|
|
173
|
+
}
|
|
174
|
+
index += 1;
|
|
175
|
+
}
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
/** Match `run.ts`: Cohub flags first, then the rest is the shell command. */
|
|
179
|
+
function runRemainderRequestsHelp(argv) {
|
|
180
|
+
for (let index = 0; index < argv.length; index += 1) {
|
|
181
|
+
const token = argv[index] ?? "";
|
|
182
|
+
if (token === "--") return false;
|
|
183
|
+
if (isHelpFlag(token)) return true;
|
|
184
|
+
if (token === "--async" || token === "--json") continue;
|
|
185
|
+
if (token === "-c" || token === "--command" || token === "--base-url") {
|
|
186
|
+
index += 1;
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
if (token.startsWith("--command=") || token.startsWith("--base-url=")) continue;
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
return false;
|
|
193
|
+
}
|
|
194
|
+
function walkCommandPath(program, argv) {
|
|
195
|
+
let command = program;
|
|
196
|
+
const path = [];
|
|
197
|
+
let helpRequested = false;
|
|
198
|
+
let index = 0;
|
|
199
|
+
while (index < argv.length) {
|
|
200
|
+
const token = argv[index] ?? "";
|
|
201
|
+
if (token === "--") break;
|
|
202
|
+
if (isHelpFlag(token)) {
|
|
203
|
+
helpRequested = true;
|
|
204
|
+
index += 1;
|
|
205
|
+
continue;
|
|
206
|
+
}
|
|
207
|
+
if (token.startsWith("-")) {
|
|
208
|
+
index = skipOption(command, argv, index);
|
|
209
|
+
continue;
|
|
210
|
+
}
|
|
211
|
+
if (token === "help" && (hasSubcommands(command) || path.length === 0)) {
|
|
212
|
+
helpRequested = true;
|
|
213
|
+
index += 1;
|
|
214
|
+
continue;
|
|
215
|
+
}
|
|
216
|
+
const child = findChild(command, token);
|
|
217
|
+
if (child) {
|
|
218
|
+
command = child;
|
|
219
|
+
path.push(child.name());
|
|
220
|
+
index += 1;
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
if (hasSubcommands(command) || token === "run" && path.length === 0) {
|
|
224
|
+
const remainder = argv.slice(index + 1);
|
|
225
|
+
const helpAfter = token === "run" && path.length === 0 ? runRemainderRequestsHelp(remainder) : remainderRequestsHelp(command, remainder);
|
|
226
|
+
return {
|
|
227
|
+
command,
|
|
228
|
+
path,
|
|
229
|
+
helpRequested: helpRequested || helpAfter,
|
|
230
|
+
unknown: token
|
|
231
|
+
};
|
|
232
|
+
}
|
|
233
|
+
index += 1;
|
|
234
|
+
}
|
|
235
|
+
return {
|
|
236
|
+
command,
|
|
237
|
+
path,
|
|
238
|
+
helpRequested,
|
|
239
|
+
unknown: null
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
function rootCommandName(program, argv) {
|
|
243
|
+
let index = 0;
|
|
244
|
+
while (index < argv.length) {
|
|
245
|
+
const token = argv[index] ?? "";
|
|
246
|
+
if (token === "--") return void 0;
|
|
247
|
+
if (token.startsWith("-")) {
|
|
248
|
+
index = skipOption(program, argv, index);
|
|
249
|
+
continue;
|
|
250
|
+
}
|
|
251
|
+
if (token !== "help") return token;
|
|
252
|
+
index += 1;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
function stripRootCommand(program, argv, name) {
|
|
256
|
+
let index = 0;
|
|
257
|
+
while (index < argv.length) {
|
|
258
|
+
const token = argv[index] ?? "";
|
|
259
|
+
if (token === "--") return void 0;
|
|
260
|
+
if (isHelpFlag(token) || token === "help") {
|
|
261
|
+
index += 1;
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
if (token.startsWith("-")) {
|
|
265
|
+
index = skipOption(program, argv, index);
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
if (token !== name) return void 0;
|
|
269
|
+
return [...argv.slice(0, index), ...argv.slice(index + 1)];
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
function editDistance(a, b) {
|
|
273
|
+
if (a === b) return 0;
|
|
274
|
+
if (Math.abs(a.length - b.length) > 3) return Math.max(a.length, b.length);
|
|
275
|
+
const rows = a.length + 1;
|
|
276
|
+
const cols = b.length + 1;
|
|
277
|
+
const previous = Array.from({ length: cols }, (_, index) => index);
|
|
278
|
+
const current = new Array(cols);
|
|
279
|
+
for (let i = 1; i < rows; i += 1) {
|
|
280
|
+
current[0] = i;
|
|
281
|
+
for (let j = 1; j < cols; j += 1) {
|
|
282
|
+
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
283
|
+
current[j] = Math.min((previous[j] ?? 0) + 1, (current[j - 1] ?? 0) + 1, (previous[j - 1] ?? 0) + cost);
|
|
284
|
+
}
|
|
285
|
+
for (let j = 0; j < cols; j += 1) previous[j] = current[j] ?? 0;
|
|
286
|
+
}
|
|
287
|
+
return previous[b.length] ?? Math.max(a.length, b.length);
|
|
288
|
+
}
|
|
289
|
+
function suggestCommand(command, token) {
|
|
290
|
+
const names = [...new Set(command.commands.flatMap((child) => {
|
|
291
|
+
if (child.name() === "help" || child.name().length <= 1) return [];
|
|
292
|
+
return [child.name(), ...child.aliases().filter((alias) => alias.length > 1)];
|
|
293
|
+
}))];
|
|
294
|
+
let best;
|
|
295
|
+
let bestDistance = 3;
|
|
296
|
+
for (const name of names) {
|
|
297
|
+
const distance = editDistance(token, name);
|
|
298
|
+
const length = Math.max(token.length, name.length);
|
|
299
|
+
if (distance >= bestDistance || (length - distance) / length <= .4) continue;
|
|
300
|
+
bestDistance = distance;
|
|
301
|
+
best = name;
|
|
302
|
+
}
|
|
303
|
+
return best;
|
|
304
|
+
}
|
|
305
|
+
function resolveHelpPath(program, argv) {
|
|
306
|
+
const walk = walkCommandPath(program, argv);
|
|
307
|
+
if (walk.unknown === "cli" && walk.path.length === 0) {
|
|
308
|
+
const stripped = stripRootCommand(program, argv, "cli");
|
|
309
|
+
return {
|
|
310
|
+
kind: "unknown",
|
|
311
|
+
token: "cli",
|
|
312
|
+
tryCommand: stripped && stripped.length > 0 ? stripped.join(" ") : void 0
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
if (!walk.helpRequested) return { kind: "passthrough" };
|
|
316
|
+
if (walk.unknown === "run" && walk.path.length === 0) return { kind: "run-help" };
|
|
317
|
+
if (walk.unknown) return {
|
|
318
|
+
kind: "unknown",
|
|
319
|
+
token: walk.unknown,
|
|
320
|
+
suggestion: suggestCommand(walk.command, walk.unknown)
|
|
321
|
+
};
|
|
322
|
+
return {
|
|
323
|
+
kind: "help",
|
|
324
|
+
command: walk.command
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
function formatUnknownCommandError(result) {
|
|
328
|
+
const lines = [`error: unknown command '${result.token}'`];
|
|
329
|
+
if (result.tryCommand) lines.push(`Try: cohub ${result.tryCommand}`);
|
|
330
|
+
else if (result.token === "cli") lines.push(`cohub has no "cli" subcommand. See cohub --help`);
|
|
331
|
+
else if (result.suggestion) lines.push(`(Did you mean ${result.suggestion}?)`);
|
|
332
|
+
return `${lines.join("\n")}\n`;
|
|
333
|
+
}
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/program.ts
|
|
336
|
+
function createProgram() {
|
|
337
|
+
return registerEndpointOptions(new Command("cohub")).name("cohub").summary("Work with Cohub from your terminal").description("Send prompts, manage Space files, and publish public output.").version(CLI_VERSION, "-v, --version", "Show version").option("-s, --space <space>", "Target Space: ID, slug, or username/slug").option("--json", "Print machine-readable JSON when supported").helpOption("-h, --help", "Show help").addHelpText("after", `
|
|
338
|
+
|
|
339
|
+
Help:
|
|
340
|
+
cohub apps publish --help
|
|
341
|
+
cohub help apps publish
|
|
342
|
+
|
|
343
|
+
Common commands:
|
|
344
|
+
cohub auth login
|
|
345
|
+
cohub profile avatar ./avatar.png
|
|
346
|
+
cohub spaces ls
|
|
347
|
+
cohub prompt "Fix the failing tests"
|
|
348
|
+
cohub completion "Summarize AGENTS.md" --system-prompt AGENTS.md --stream
|
|
349
|
+
cohub decision "I was charged twice" -q questions.json
|
|
350
|
+
cohub run -- git status
|
|
351
|
+
cohub runtime up ./my-project
|
|
352
|
+
cohub runtime logs --follow
|
|
353
|
+
cohub search "release notes"
|
|
354
|
+
cohub -s <space-id> boards get <board-id>
|
|
355
|
+
cohub -s <space-id> spaces turns ls --author others
|
|
356
|
+
cohub -s <space-id> spaces sessions turns ls <session-id>
|
|
357
|
+
cohub -s home spaces files ls
|
|
358
|
+
cohub -s <space-id> public upload ./dist demo
|
|
359
|
+
cohub -s <space-id> apps publish demo --file dist/index.html
|
|
360
|
+
cohub desktop open <app-id> --call selection.get
|
|
361
|
+
cohub rooms join <invite>
|
|
362
|
+
cohub -s <space-id> spaces commerce products list
|
|
363
|
+
cohub models ls
|
|
364
|
+
cohub models ls --model-type multimodal
|
|
365
|
+
cohub generate "A calm lake at sunrise" --model <model> --output lake.png
|
|
366
|
+
cohub feedback "Describe the problem" -f screenshot.png
|
|
367
|
+
|
|
368
|
+
Target space:
|
|
369
|
+
-s <space>, then COHUB_SPACE_ID, then the current directory Runtime binding.
|
|
370
|
+
<space> is an ID, a slug you own such as home, or username/slug.
|
|
371
|
+
prompt, completion, decision, generate, apps, and public fall back to your Home Space;
|
|
372
|
+
other Space commands need a target.
|
|
373
|
+
|
|
374
|
+
Environment:
|
|
375
|
+
COHUB_SPACE_ID Target Space when -s is omitted
|
|
376
|
+
COHUB_EXECUTION_TOKEN Use this token instead of the stored Logto session
|
|
377
|
+
COHUB_BASE_URL Override the API base URL
|
|
378
|
+
COHUB_WS_URL Override the realtime WebSocket URL
|
|
379
|
+
COHUB_WEB_URL Override the web URL used in links
|
|
380
|
+
COHUB_NO_DIRECT=1 Send files and screens through the API even when this machine serves the Space
|
|
381
|
+
ENV=dev Use the development Cohub environment
|
|
382
|
+
HTTPS_PROXY Honored for API and uploads (also HTTP_PROXY, NO_PROXY)
|
|
383
|
+
Runtime logs ~/.local/state/cohub/runtime/<space-id>/diagnostics
|
|
384
|
+
`);
|
|
385
|
+
}
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region src/index.ts
|
|
388
|
+
const program = createProgram();
|
|
389
|
+
const argv = process.argv.slice(2);
|
|
390
|
+
const name = rootCommandName(program, argv);
|
|
391
|
+
const named = COMMANDS.find((command) => name !== void 0 && command.names.includes(name));
|
|
392
|
+
const versionOnly = name === void 0 && argv.some((arg) => arg === "-v" || arg === "--version") && !argv.some((arg) => arg === "-h" || arg === "--help");
|
|
393
|
+
const rootCommands = name === void 0 && resolveHelpPath(program, argv).kind === "help" ? buildInfo().rootCommands : void 0;
|
|
394
|
+
if (rootCommands) addRootCommandStubs(program, rootCommands);
|
|
395
|
+
else await registerCommands(program, named ? [named] : name === "run" || versionOnly ? [] : COMMANDS);
|
|
396
|
+
const help = resolveHelpPath(program, argv);
|
|
397
|
+
if (help.kind === "help") help.command.outputHelp();
|
|
398
|
+
else if (help.kind === "run-help") (await import("./run.js")).printRunHelp();
|
|
399
|
+
else if (help.kind === "unknown") {
|
|
400
|
+
process.stderr.write(formatUnknownCommandError(help));
|
|
401
|
+
process.exit(1);
|
|
402
|
+
} else if (name === "run" && await (await import("./run.js")).maybeHandleRunCommand(argv)) process.exit();
|
|
403
|
+
else program.parse();
|
|
404
|
+
//#endregion
|
|
405
|
+
export {};
|