@neta-art/cohub-cli 10.14.1 → 10.16.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 +3 -1
- package/dist/auth.d.ts +3 -1
- package/dist/auth.js +4 -0
- package/dist/board-export.d.ts +7 -0
- package/dist/board-export.js +3 -3
- package/dist/board-kernel.d.ts +1 -0
- package/dist/board-kernel.js +7605 -277
- package/dist/board-simulate.d.ts +53 -0
- package/dist/board-simulate.js +151 -0
- package/dist/bootstrap.js +5 -0
- package/dist/commands/auth.js +12 -1
- package/dist/commands/boards.js +68 -0
- package/dist/commands/host.d.ts +2 -0
- package/dist/commands/host.js +11 -0
- package/dist/commands/runtime.js +4 -16
- package/dist/commands/space-invitations.d.ts +3 -2
- package/dist/commands/space-invitations.js +29 -8
- package/dist/commands/spaces.js +55 -30
- package/dist/host/auth.d.ts +20 -0
- package/dist/host/auth.js +107 -0
- package/dist/host/login-env.d.ts +1 -0
- package/dist/host/login-env.js +31 -0
- package/dist/host/runtime.d.ts +25 -0
- package/dist/host/runtime.js +250 -0
- package/dist/host/runtimes.d.ts +9 -0
- package/dist/host/runtimes.js +42 -0
- package/dist/host/serve.d.ts +2 -0
- package/dist/host/serve.js +73 -0
- package/dist/index.js +2 -0
- package/dist/runtime/connection.d.ts +3 -0
- package/dist/runtime/connection.js +59 -3
- package/dist/runtime/harnesses/claude.js +8 -2
- package/dist/runtime/harnesses/index.d.ts +2 -0
- package/dist/runtime/harnesses/index.js +13 -0
- package/dist/runtime/harnesses/stream-json.d.ts +2 -2
- package/dist/runtime/harnesses/stream-json.js +5 -3
- package/dist/runtime/harnesses/types.d.ts +4 -2
- package/dist/runtime/harnesses/workbuddy.d.ts +8 -2
- package/dist/runtime/instance.d.ts +8 -1
- package/dist/runtime/instance.js +89 -9
- package/dist/runtime/launch.d.ts +1 -0
- package/dist/runtime/launch.js +6 -0
- package/dist/runtime/model-catalog.d.ts +1 -3
- package/dist/runtime/model-catalog.js +23 -7
- package/dist/runtime/supervisor.js +6 -4
- package/dist/space.d.ts +1 -0
- package/dist/space.js +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { isModelThinkingLevel, MODEL_THINKING_LEVELS as thinkingLevels, RUNTIME_MAX_SERVICE_TIERS, runtimeServiceTierSchema, thinkingLevelMapFor } from "@neta-art/cohub";
|
|
1
2
|
import { record } from "./json-rpc.js";
|
|
2
|
-
const
|
|
3
|
-
const thinkingLevel = (value) => thinkingLevels.includes(value) ? value : undefined;
|
|
3
|
+
const thinkingLevel = (value) => isModelThinkingLevel(value) ? value : undefined;
|
|
4
4
|
/**
|
|
5
5
|
* Publish only picker metadata, never provider credentials or request configuration.
|
|
6
6
|
* `state` is a fresh Pi's `get_state`: its model is what Pi runs when Cohub requests
|
|
@@ -16,7 +16,7 @@ export function piModelCatalog(entries, state) {
|
|
|
16
16
|
if (typeof model.id !== "string" || !model.id || typeof model.provider !== "string" || !model.provider)
|
|
17
17
|
return [];
|
|
18
18
|
const map = record(model.thinkingLevelMap);
|
|
19
|
-
const thinkingLevelMap =
|
|
19
|
+
const thinkingLevelMap = thinkingLevelMapFor((level) => map[level] === null || typeof map[level] === "string" ? map[level] : undefined);
|
|
20
20
|
const isDefault = current.provider === model.provider && current.id === model.id;
|
|
21
21
|
return [{
|
|
22
22
|
harness: "pi", id: model.id, provider: model.provider, name: typeof model.name === "string" ? model.name : model.id,
|
|
@@ -31,10 +31,10 @@ function codexThinking(model, configuredEffort) {
|
|
|
31
31
|
if (!Array.isArray(model.supportedReasoningEfforts))
|
|
32
32
|
return {};
|
|
33
33
|
const efforts = new Set(model.supportedReasoningEfforts.map((entry) => record(entry).reasoningEffort));
|
|
34
|
-
const thinkingLevelMap =
|
|
34
|
+
const thinkingLevelMap = thinkingLevelMapFor((level) => {
|
|
35
35
|
const effort = level === "off" ? "none" : level;
|
|
36
|
-
return
|
|
37
|
-
})
|
|
36
|
+
return efforts.has(effort) ? effort : null;
|
|
37
|
+
});
|
|
38
38
|
const normalize = (value) => thinkingLevel(value === "none" ? "off" : value);
|
|
39
39
|
const configured = normalize(configuredEffort);
|
|
40
40
|
const fallback = normalize(model.defaultReasoningEffort);
|
|
@@ -45,6 +45,22 @@ function codexThinking(model, configuredEffort) {
|
|
|
45
45
|
...(defaultThinkingLevel ? { defaultThinkingLevel } : {}),
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
|
+
/** `serviceTiers` supersedes the deprecated `additionalSpeedTiers`, which only names tier ids. */
|
|
49
|
+
function codexServiceTiers(model) {
|
|
50
|
+
const candidates = Array.isArray(model.serviceTiers)
|
|
51
|
+
? model.serviceTiers.map((entry) => {
|
|
52
|
+
const tier = record(entry);
|
|
53
|
+
return { id: tier.id, name: tier.name, ...(typeof tier.description === "string" && tier.description ? { description: tier.description } : {}) };
|
|
54
|
+
})
|
|
55
|
+
: Array.isArray(model.additionalSpeedTiers) ? model.additionalSpeedTiers.map((id) => ({ id, name: id })) : [];
|
|
56
|
+
// An entry outside the protocol's bounds is dropped rather than invalidating the whole catalog.
|
|
57
|
+
const tiers = candidates.flatMap((tier) => {
|
|
58
|
+
const parsed = runtimeServiceTierSchema.safeParse(tier);
|
|
59
|
+
return parsed.success ? [parsed.data] : [];
|
|
60
|
+
}).slice(0, RUNTIME_MAX_SERVICE_TIERS);
|
|
61
|
+
const defaultServiceTier = typeof model.defaultServiceTier === "string" && tiers.some((tier) => tier.id === model.defaultServiceTier) ? model.defaultServiceTier : undefined;
|
|
62
|
+
return { ...(tiers.length ? { serviceTiers: tiers } : {}), ...(defaultServiceTier ? { defaultServiceTier } : {}) };
|
|
63
|
+
}
|
|
48
64
|
/** Use Codex's picker-visible model/list for every provider, including custom providers. */
|
|
49
65
|
export function codexModelCatalog(configResponse, entries) {
|
|
50
66
|
const config = record(configResponse.config);
|
|
@@ -57,7 +73,7 @@ export function codexModelCatalog(configResponse, entries) {
|
|
|
57
73
|
return [];
|
|
58
74
|
// A configured model replaces the catalog's own default.
|
|
59
75
|
const isDefault = configuredModel ? id === configuredModel : model.isDefault === true;
|
|
60
|
-
return [{ harness: "codex", provider, id, name: typeof model.displayName === "string" ? model.displayName : id, ...(isDefault ? { isDefault } : {}), ...codexThinking(model, config.model_reasoning_effort) }];
|
|
76
|
+
return [{ harness: "codex", provider, id, name: typeof model.displayName === "string" ? model.displayName : id, ...(isDefault ? { isDefault } : {}), ...codexThinking(model, config.model_reasoning_effort), ...codexServiceTiers(model) }];
|
|
61
77
|
});
|
|
62
78
|
if (configuredModel && !models.some((model) => model.id === configuredModel))
|
|
63
79
|
models.unshift({ harness: "codex", provider, id: configuredModel, name: configuredModel, isDefault: true });
|
|
@@ -10,7 +10,7 @@ import { createClient } from "../client.js";
|
|
|
10
10
|
import { currentIdentityKey } from "../space.js";
|
|
11
11
|
import { ensureSandboxdBinary } from "../commands/sandboxd-binary.js";
|
|
12
12
|
import { serveRuntime } from "./connection.js";
|
|
13
|
-
import { discoverHarnesses } from "./harnesses/index.js";
|
|
13
|
+
import { discoverHarnesses, refreshHarnesses } from "./harnesses/index.js";
|
|
14
14
|
import { RuntimeDiagnostics, serializeDiagnosticError } from "./diagnostics.js";
|
|
15
15
|
import { ownRuntimeInstance, runtimeInstanceDirectory } from "./instance.js";
|
|
16
16
|
import { createDiagnosticConsole } from "./presentation.js";
|
|
@@ -73,6 +73,7 @@ export async function runRuntime(config, onState, externalSignal, onDiagnostic)
|
|
|
73
73
|
diagnosticsPath: diagnostics.directory,
|
|
74
74
|
};
|
|
75
75
|
const summary = () => ({ ...status, native: native.status() });
|
|
76
|
+
let instance;
|
|
76
77
|
let hasBeenReady = false;
|
|
77
78
|
const update = (patch) => {
|
|
78
79
|
const next = { ...status, ...patch };
|
|
@@ -87,8 +88,8 @@ export async function runRuntime(config, onState, externalSignal, onDiagnostic)
|
|
|
87
88
|
diagnostics.log("info", "runtime.available");
|
|
88
89
|
}
|
|
89
90
|
onState({ ...status });
|
|
91
|
+
instance?.changed();
|
|
90
92
|
};
|
|
91
|
-
let closeInstance;
|
|
92
93
|
let bridgeTask;
|
|
93
94
|
let retryDisconnectedBridge;
|
|
94
95
|
let nativeStarted = false;
|
|
@@ -107,7 +108,7 @@ export async function runRuntime(config, onState, externalSignal, onDiagnostic)
|
|
|
107
108
|
return tokenInFlight;
|
|
108
109
|
};
|
|
109
110
|
try {
|
|
110
|
-
|
|
111
|
+
instance = await ownRuntimeInstance(runtimeInstanceDirectory(config.identity, config.spaceId), summary, async (force) => {
|
|
111
112
|
if (!force)
|
|
112
113
|
for await (const batch of native.executor.results.pendingBatches()) {
|
|
113
114
|
if (batch.length)
|
|
@@ -310,6 +311,7 @@ export async function runRuntime(config, onState, externalSignal, onDiagnostic)
|
|
|
310
311
|
let importRequested = Boolean(config.importHistory);
|
|
311
312
|
await serveRuntime({
|
|
312
313
|
spaceId: config.spaceId, cwd: config.root, url: url.toString(), capabilities,
|
|
314
|
+
refreshCapabilities: (current) => refreshHarnesses(current, config.executables, config.root, (harness, error) => diagnostics.log("warn", "runtime.harness_catalog_failed", { harness, error: serializeDiagnosticError(error) })),
|
|
313
315
|
runtimeId: status.runtimeId, diagnostics, token, signal, executor: native.executor,
|
|
314
316
|
onReady: () => { update({ harnessConnected: true }); retryDisconnectedBridge?.(); },
|
|
315
317
|
onDisconnected: () => { native.connect(null); update({ harnessConnected: false }); retryDisconnectedBridge?.(); },
|
|
@@ -343,7 +345,7 @@ export async function runRuntime(config, onState, externalSignal, onDiagnostic)
|
|
|
343
345
|
}
|
|
344
346
|
finally {
|
|
345
347
|
try {
|
|
346
|
-
await
|
|
348
|
+
await instance?.close();
|
|
347
349
|
}
|
|
348
350
|
finally {
|
|
349
351
|
process.removeListener("SIGINT", stop);
|
package/dist/space.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export declare class SpaceTargetError extends Error {
|
|
|
4
4
|
name: string;
|
|
5
5
|
constructor(message: string, detail?: string | undefined);
|
|
6
6
|
}
|
|
7
|
+
export declare function jwtClaim(token: string | undefined | null, key: string): string | null;
|
|
7
8
|
/**
|
|
8
9
|
* Cache key aligned with auth: execution token is exclusive (same as
|
|
9
10
|
* `resolveAccessToken`) and never falls back to a local Logto session.
|
package/dist/space.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neta-art/cohub-cli",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.16.0",
|
|
4
4
|
"description": "CLI for Cohub — spaces, sessions, and agent collaboration.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"NOTICE"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@neta-art/cohub": "13.
|
|
22
|
-
"@neta-art/generation": "
|
|
21
|
+
"@neta-art/cohub": "13.6.0",
|
|
22
|
+
"@neta-art/generation": "0.2.8",
|
|
23
23
|
"commander": "^15.0.0",
|
|
24
24
|
"sharp": "^0.35.4",
|
|
25
25
|
"ws": "^8.21.3"
|