skydive-cli 0.5.0-beta.32 → 0.5.0-beta.36
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/CHANGELOG.md +4 -0
- package/README.md +20 -0
- package/dist/js/bin.mjs +413 -208
- package/dist/js/{boot-yyXrIeVy.mjs → boot-CmInaUwJ.mjs} +924 -73
- package/dist/js/{client-BTQ1fwzM.mjs → client-Btq6bMzX.mjs} +108 -2
- package/dist/js/{daemon-CxFxH36O.mjs → daemon-CH95gDij.mjs} +1 -1
- package/dist/js/{daemon-Btd2436i.mjs → daemon-Dg89tpOE.mjs} +1 -1
- package/dist/js/{daemon-client-Br1NlkRp.mjs → daemon-client-BNDnEGw6.mjs} +1 -1
- package/dist/js/daemon-client-CC9sxWac.mjs +8 -0
- package/dist/js/{profiler-CJMnC90G.mjs → install-aZ751iYf.mjs} +274 -210
- package/dist/js/launcher.mjs +49 -0
- package/dist/js/{print-B9djx8GU.mjs → print-DV9L41G2.mjs} +2 -2
- package/dist/js/{print-Clgq46GU.mjs → print-h22UbIfZ.mjs} +1 -1
- package/dist/js/raw-pty-Ci2qFR9F.mjs +5 -0
- package/dist/js/{raw-pty-B9Bue8gg.mjs → raw-pty-D5PhKZSl.mjs} +1 -1
- package/dist/js/{rest-C6E4mS2A.mjs → rest-ClVPZquN.mjs} +46 -9
- package/dist/js/{rest-CaWUSrnH.mjs → rest-v-7FQqLP.mjs} +1 -1
- package/package.json +11 -4
- package/dist/js/daemon-client-1Qfc_Y3J.mjs +0 -8
- package/dist/js/raw-pty-g3kATVQe.mjs +0 -5
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
//#region src/launcher.ts
|
|
8
|
+
const PLATFORM_PACKAGES = {
|
|
9
|
+
"darwin-arm64": "skydive-cli-darwin-arm64",
|
|
10
|
+
"darwin-x64": "skydive-cli-darwin-x64",
|
|
11
|
+
"linux-x64": "skydive-cli-linux-x64",
|
|
12
|
+
"linux-arm64": "skydive-cli-linux-arm64"
|
|
13
|
+
};
|
|
14
|
+
const require = createRequire(import.meta.url);
|
|
15
|
+
/** The compiled per-platform binary, or null if none is installed/available. */
|
|
16
|
+
function resolveBinaryPath() {
|
|
17
|
+
const pkg = PLATFORM_PACKAGES[`${process.platform}-${process.arch}`];
|
|
18
|
+
if (!pkg) return null;
|
|
19
|
+
try {
|
|
20
|
+
return require.resolve(`${pkg}/bin`);
|
|
21
|
+
} catch (_error) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/** The JS bundle sibling of this launcher (`dist/js/bin.mjs`). */
|
|
26
|
+
function jsBundlePath() {
|
|
27
|
+
return path.join(path.dirname(fileURLToPath(import.meta.url)), "bin.mjs");
|
|
28
|
+
}
|
|
29
|
+
const args = process.argv.slice(2);
|
|
30
|
+
const binaryPath = resolveBinaryPath();
|
|
31
|
+
let child;
|
|
32
|
+
if (binaryPath) {
|
|
33
|
+
const env = { ...process.env };
|
|
34
|
+
if (env["SKYDIVE_CLI_INSTALL_SOURCE"] === void 0) env["SKYDIVE_CLI_INSTALL_SOURCE"] = "package-manager";
|
|
35
|
+
child = spawnSync(binaryPath, args, {
|
|
36
|
+
stdio: "inherit",
|
|
37
|
+
env
|
|
38
|
+
});
|
|
39
|
+
} else child = spawnSync(process.execPath, [jsBundlePath(), ...args], { stdio: "inherit" });
|
|
40
|
+
if (child.error) {
|
|
41
|
+
const what = binaryPath ? `the platform binary (${binaryPath})` : `the CLI under Node (${process.execPath})`;
|
|
42
|
+
process.stderr.write(`skydive: failed to launch ${what}: ${child.error.message}\n`);
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
if (child.signal) process.kill(process.pid, child.signal);
|
|
46
|
+
else process.exit(child.status ?? 0);
|
|
47
|
+
|
|
48
|
+
//#endregion
|
|
49
|
+
export { };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-
|
|
3
|
-
import "./rest-
|
|
2
|
+
import { a as runPrint, i as resolveAgent, n as messageGet, o as toPrintError, r as readStdin, t as collectRunText } from "./print-h22UbIfZ.mjs";
|
|
3
|
+
import "./rest-ClVPZquN.mjs";
|
|
4
4
|
import "./billing-blocked-D3l5kJlX.mjs";
|
|
5
5
|
|
|
6
6
|
export { messageGet, readStdin, resolveAgent, runPrint };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as HttpError } from "./http-error-UHH3mVBF.mjs";
|
|
3
|
-
import { a as isRecord, i as errorMessage, r as sendErrorMessage, t as createRestClient } from "./rest-
|
|
3
|
+
import { a as isRecord, i as errorMessage, r as sendErrorMessage, t as createRestClient } from "./rest-ClVPZquN.mjs";
|
|
4
4
|
import { i as billingBlockedOutcomeFromSendResponse, n as BillingBlockedError } from "./billing-blocked-D3l5kJlX.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import Conf from "conf";
|
|
@@ -124,6 +124,13 @@ function createRestClient({ appUrl, sessionToken, workspaceId }) {
|
|
|
124
124
|
if (!res.ok) throw new HttpError(res.status, await res.text().catch(() => ""));
|
|
125
125
|
return schema.parse(await res.json());
|
|
126
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* The agent PATCH is a merge: only the keys present are written, so each
|
|
129
|
+
* caller sends exactly the settings it means to change.
|
|
130
|
+
*/
|
|
131
|
+
function patchAgent(agentId, body) {
|
|
132
|
+
return post(`/api/v1/agents/${encodeURIComponent(agentId)}`, body, updateAgentResponseSchema, "PATCH");
|
|
133
|
+
}
|
|
127
134
|
async function del(path) {
|
|
128
135
|
const res = await fetch(`${appUrl}${path}`, {
|
|
129
136
|
method: "DELETE",
|
|
@@ -243,9 +250,31 @@ function createRestClient({ appUrl, sessionToken, workspaceId }) {
|
|
|
243
250
|
const { models } = await get("/api/v1/models", listModelsResponseSchema);
|
|
244
251
|
return models;
|
|
245
252
|
},
|
|
246
|
-
|
|
247
|
-
const {
|
|
248
|
-
|
|
253
|
+
listModelEfforts: async () => {
|
|
254
|
+
const { modelConfigOverrides } = await get("/api/v1/models/preferred", modelEffortPreferencesResponseSchema);
|
|
255
|
+
const efforts = {};
|
|
256
|
+
for (const [modelId, config] of Object.entries(modelConfigOverrides ?? {})) if (config.thinkingLevel) efforts[modelId] = config.thinkingLevel;
|
|
257
|
+
return efforts;
|
|
258
|
+
},
|
|
259
|
+
setModelEffort: async ({ modelId, thinkingLevel }) => {
|
|
260
|
+
await post("/api/v1/models/config", {
|
|
261
|
+
modelId,
|
|
262
|
+
config: { thinkingLevel }
|
|
263
|
+
}, z.unknown(), "PATCH");
|
|
264
|
+
},
|
|
265
|
+
updateAgentModel: async ({ agentId, model, thinkingLevel }) => {
|
|
266
|
+
const { agent } = await patchAgent(agentId, {
|
|
267
|
+
model,
|
|
268
|
+
thinkingLevel
|
|
269
|
+
});
|
|
270
|
+
return {
|
|
271
|
+
model: agent.model ?? null,
|
|
272
|
+
thinkingLevel: agent.thinkingLevel ?? null
|
|
273
|
+
};
|
|
274
|
+
},
|
|
275
|
+
updateAgentEffort: async ({ agentId, thinkingLevel }) => {
|
|
276
|
+
const { agent } = await patchAgent(agentId, { thinkingLevel });
|
|
277
|
+
return { thinkingLevel: agent.thinkingLevel ?? null };
|
|
249
278
|
},
|
|
250
279
|
listConversations: async ({ agentId, limit, channels, archived, query, onPage }) => {
|
|
251
280
|
const trimmedQuery = query?.trim();
|
|
@@ -299,8 +328,8 @@ function createRestClient({ appUrl, sessionToken, workspaceId }) {
|
|
|
299
328
|
const { result } = await get(`/api/v1/trpc/v2.subagentTasks.list?input=${encodeURIComponent(JSON.stringify({ conversationId }))}`, subagentTasksResponseSchema);
|
|
300
329
|
return new Map(result.data.subagentTasks.map((task) => [task.id, task]));
|
|
301
330
|
},
|
|
302
|
-
computeLiveStats: async () => {
|
|
303
|
-
const { stats } = await get(
|
|
331
|
+
computeLiveStats: async (agentId) => {
|
|
332
|
+
const { stats } = await get(`/api/v1/compute/live-stats?agentId=${encodeURIComponent(agentId)}`, liveStatsResponseSchema);
|
|
304
333
|
return stats;
|
|
305
334
|
},
|
|
306
335
|
uploadAttachment: async ({ agentId, fileName, mediaType, data }) => {
|
|
@@ -452,17 +481,24 @@ const agentSummarySchema = z.object({
|
|
|
452
481
|
createdAt: z.string(),
|
|
453
482
|
creatorName: z.string().nullable().optional(),
|
|
454
483
|
model: z.string().nullable().optional(),
|
|
455
|
-
modelLocked: z.boolean().optional()
|
|
484
|
+
modelLocked: z.boolean().optional(),
|
|
485
|
+
thinkingLevel: z.string().nullable().optional()
|
|
456
486
|
});
|
|
457
487
|
const platformModelSchema = z.object({
|
|
458
488
|
id: z.string(),
|
|
459
489
|
displayName: z.string(),
|
|
460
490
|
providerDisplay: z.string().optional(),
|
|
461
491
|
reasoning: z.boolean().optional(),
|
|
462
|
-
compliant: z.boolean().optional()
|
|
492
|
+
compliant: z.boolean().optional(),
|
|
493
|
+
thinkingLevels: z.array(z.string()).optional(),
|
|
494
|
+
thinkingLevelLabels: z.record(z.string(), z.string()).optional()
|
|
463
495
|
}).passthrough();
|
|
464
496
|
const listModelsResponseSchema = z.object({ models: z.array(platformModelSchema) });
|
|
465
|
-
const
|
|
497
|
+
const modelEffortPreferencesResponseSchema = z.object({ modelConfigOverrides: z.record(z.string(), z.object({ thinkingLevel: z.string().optional() })).optional() });
|
|
498
|
+
const updateAgentResponseSchema = z.object({ agent: z.object({
|
|
499
|
+
model: z.string().nullable().optional(),
|
|
500
|
+
thinkingLevel: z.string().nullable().optional()
|
|
501
|
+
}).passthrough() });
|
|
466
502
|
const listAgentsResponseSchema = z.object({
|
|
467
503
|
agents: z.array(agentSummarySchema),
|
|
468
504
|
nextCursor: z.string().nullable().optional(),
|
|
@@ -617,7 +653,8 @@ const conversationStreamEventSchema = z.discriminatedUnion("kind", [
|
|
|
617
653
|
kind: z.literal("agent"),
|
|
618
654
|
id: z.string(),
|
|
619
655
|
model: z.string().nullable(),
|
|
620
|
-
modelLocked: z.boolean()
|
|
656
|
+
modelLocked: z.boolean(),
|
|
657
|
+
thinkingLevel: z.string().nullish()
|
|
621
658
|
}),
|
|
622
659
|
z.object({
|
|
623
660
|
kind: z.literal("run"),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as HttpError } from "./http-error-UHH3mVBF.mjs";
|
|
3
|
-
import { n as errorDetail, r as sendErrorMessage, t as createRestClient } from "./rest-
|
|
3
|
+
import { n as errorDetail, r as sendErrorMessage, t as createRestClient } from "./rest-ClVPZquN.mjs";
|
|
4
4
|
import "./billing-blocked-D3l5kJlX.mjs";
|
|
5
5
|
|
|
6
6
|
export { createRestClient };
|
package/package.json
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skydive-cli",
|
|
3
|
-
"version": "0.5.0-beta.
|
|
3
|
+
"version": "0.5.0-beta.36",
|
|
4
4
|
"description": "Skydive CLI — cloud agents from the command line",
|
|
5
5
|
"homepage": "https://skydive.com",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": {
|
|
8
|
-
"skydive": "./dist/js/
|
|
8
|
+
"skydive": "./dist/js/launcher.mjs"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"dist"
|
|
12
12
|
],
|
|
13
13
|
"type": "module",
|
|
14
14
|
"exports": {
|
|
15
|
-
"./bin": "./dist/js/bin.mjs"
|
|
15
|
+
"./bin": "./dist/js/bin.mjs",
|
|
16
|
+
"./launcher": "./dist/js/launcher.mjs"
|
|
16
17
|
},
|
|
17
18
|
"publishConfig": {
|
|
18
19
|
"access": "public",
|
|
@@ -41,7 +42,6 @@
|
|
|
41
42
|
"react-devtools-core": "^7.0.1",
|
|
42
43
|
"safe-stable-stringify": "^2.3.1",
|
|
43
44
|
"semver": "^7.7.4",
|
|
44
|
-
"shell-quote": "1.9.0",
|
|
45
45
|
"web-tree-sitter": "0.25.10",
|
|
46
46
|
"ws": "^8.21.0",
|
|
47
47
|
"yargs": "^17.7.2",
|
|
@@ -66,5 +66,12 @@
|
|
|
66
66
|
"engines": {
|
|
67
67
|
"bun": ">=1.3.14",
|
|
68
68
|
"node": ">=20.0.0"
|
|
69
|
+
},
|
|
70
|
+
"//optionalDependencies": "The per-platform binary packages (skydive-cli-<os>-<arch>) are INTENTIONALLY not committed here. They are published by release-skydive-cli-binaries.yml and injected — pinned to the exact version being published — into the published launcher's optionalDependencies at release time (scripts/prepare-platform-packages.mjs --pin-version, run in release-skydive-cli.yml). Committing them would make `yarn install` try to resolve versions that only exist post-publish, breaking local dev and CI. npm installs of a published skydive-cli still get them (os/cpu-gated); the launcher (src/launcher.ts) resolves and execs the matching one. Local dev never needs them: it runs the JS bundle or `build:binary` directly.",
|
|
71
|
+
"optionalDependencies": {
|
|
72
|
+
"skydive-cli-darwin-arm64": "0.5.0-beta.36",
|
|
73
|
+
"skydive-cli-darwin-x64": "0.5.0-beta.36",
|
|
74
|
+
"skydive-cli-linux-x64": "0.5.0-beta.36",
|
|
75
|
+
"skydive-cli-linux-arm64": "0.5.0-beta.36"
|
|
69
76
|
}
|
|
70
77
|
}
|