@lobehub/cli 0.0.90 → 0.0.92
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/dist/acceptance-report.html +38 -38
- package/dist/index.js +125 -1
- package/man/man1/lh.1 +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9431,6 +9431,10 @@ var init_chunk$1 = __esmMin((() => {
|
|
|
9431
9431
|
init_document$1();
|
|
9432
9432
|
}));
|
|
9433
9433
|
|
|
9434
|
+
//#endregion
|
|
9435
|
+
//#region ../../packages/types/src/contact.ts
|
|
9436
|
+
var init_contact = __esmMin((() => {}));
|
|
9437
|
+
|
|
9434
9438
|
//#endregion
|
|
9435
9439
|
//#region ../../packages/types/src/conversation.ts
|
|
9436
9440
|
var init_conversation = __esmMin((() => {}));
|
|
@@ -11339,7 +11343,8 @@ var init_preference = __esmMin((() => {
|
|
|
11339
11343
|
]).optional(),
|
|
11340
11344
|
topicIncludeCompleted: boolean().optional(),
|
|
11341
11345
|
topicSortBy: _enum(["createdAt", "updatedAt"]).optional(),
|
|
11342
|
-
useCmdEnterToSend: boolean().optional()
|
|
11346
|
+
useCmdEnterToSend: boolean().optional(),
|
|
11347
|
+
workspace: object$1({ order: array(string()).optional() }).optional()
|
|
11343
11348
|
}).partial();
|
|
11344
11349
|
}));
|
|
11345
11350
|
|
|
@@ -12108,6 +12113,7 @@ var init_src$2 = __esmMin((() => {
|
|
|
12108
12113
|
init_brief();
|
|
12109
12114
|
init_channel();
|
|
12110
12115
|
init_chunk$1();
|
|
12116
|
+
init_contact();
|
|
12111
12117
|
init_conversation();
|
|
12112
12118
|
init_creds();
|
|
12113
12119
|
init_dashboard();
|
|
@@ -17884,6 +17890,7 @@ const TRPC_NAMESPACE_API_KEY_RULES = {
|
|
|
17884
17890
|
canvas: "blocked",
|
|
17885
17891
|
changelog: "open",
|
|
17886
17892
|
channel: "blocked",
|
|
17893
|
+
contact: "blocked",
|
|
17887
17894
|
chunk: rw("knowledge:read", "knowledge:write"),
|
|
17888
17895
|
comfyui: rw("model:read", "model:write"),
|
|
17889
17896
|
composio: "blocked",
|
|
@@ -28120,6 +28127,107 @@ function attachCriterionCommands(parent) {
|
|
|
28120
28127
|
return criterion;
|
|
28121
28128
|
}
|
|
28122
28129
|
|
|
28130
|
+
//#endregion
|
|
28131
|
+
//#region src/commands/acceptance/delete.ts
|
|
28132
|
+
/** Mirrors the server's `removeBatch` / `purgePreview` input caps. */
|
|
28133
|
+
const REMOVE_BATCH_LIMIT = 200;
|
|
28134
|
+
const PURGE_PREVIEW_LIMIT = 20;
|
|
28135
|
+
const formatBytes$1 = (bytes) => {
|
|
28136
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
28137
|
+
const units = [
|
|
28138
|
+
"KB",
|
|
28139
|
+
"MB",
|
|
28140
|
+
"GB",
|
|
28141
|
+
"TB"
|
|
28142
|
+
];
|
|
28143
|
+
let value = bytes / 1024;
|
|
28144
|
+
let unit = 0;
|
|
28145
|
+
while (value >= 1024 && unit < units.length - 1) {
|
|
28146
|
+
value /= 1024;
|
|
28147
|
+
unit += 1;
|
|
28148
|
+
}
|
|
28149
|
+
return `${value.toFixed(value >= 10 ? 0 : 1)} ${units[unit]}`;
|
|
28150
|
+
};
|
|
28151
|
+
const describePurge = (preview) => `${preview.rounds} round(s), ${preview.fileCount} evidence file(s) (screenshots ${preview.files.images} · recordings ${preview.files.videos} · other ${preview.files.other}), ${formatBytes$1(preview.bytes)} freed`;
|
|
28152
|
+
/**
|
|
28153
|
+
* The purge preview only answers up to its cap and fails on an id the caller
|
|
28154
|
+
* cannot read; a missing preview never blocks the delete, the prompt just
|
|
28155
|
+
* says less.
|
|
28156
|
+
*/
|
|
28157
|
+
async function loadPurgePreview(client, ids) {
|
|
28158
|
+
if (ids.length > PURGE_PREVIEW_LIMIT) return;
|
|
28159
|
+
try {
|
|
28160
|
+
return await client.acceptance.purgePreview.query({ ids });
|
|
28161
|
+
} catch {
|
|
28162
|
+
return;
|
|
28163
|
+
}
|
|
28164
|
+
}
|
|
28165
|
+
async function confirmDelete(client, ids, purge) {
|
|
28166
|
+
const target = ids.length === 1 ? `acceptance ${import_picocolors.default.bold(ids[0])}` : `${ids.length} acceptances`;
|
|
28167
|
+
if (!purge) return confirm(`Delete ${target}? Its verification rounds are kept as standalone reports (use --purge to remove them too).`);
|
|
28168
|
+
const preview = await loadPurgePreview(client, ids);
|
|
28169
|
+
return confirm(`Permanently delete ${target} with every round, report and evidence file?${preview ? ` This removes ${describePurge(preview)}.` : ""} This cannot be undone.`);
|
|
28170
|
+
}
|
|
28171
|
+
async function removeAll(client, ids, purge) {
|
|
28172
|
+
if (ids.length === 1) {
|
|
28173
|
+
await client.acceptance.remove.mutate({
|
|
28174
|
+
id: ids[0],
|
|
28175
|
+
purge
|
|
28176
|
+
});
|
|
28177
|
+
return {
|
|
28178
|
+
deleted: 1,
|
|
28179
|
+
failedIds: []
|
|
28180
|
+
};
|
|
28181
|
+
}
|
|
28182
|
+
let deleted = 0;
|
|
28183
|
+
const failedIds = [];
|
|
28184
|
+
for (let i = 0; i < ids.length; i += REMOVE_BATCH_LIMIT) {
|
|
28185
|
+
const result = await client.acceptance.removeBatch.mutate({
|
|
28186
|
+
ids: ids.slice(i, i + REMOVE_BATCH_LIMIT),
|
|
28187
|
+
purge
|
|
28188
|
+
});
|
|
28189
|
+
deleted += result.deleted;
|
|
28190
|
+
failedIds.push(...result.failedIds);
|
|
28191
|
+
}
|
|
28192
|
+
return {
|
|
28193
|
+
deleted,
|
|
28194
|
+
failedIds
|
|
28195
|
+
};
|
|
28196
|
+
}
|
|
28197
|
+
/**
|
|
28198
|
+
* `lh acceptance delete` — remove the acceptance aggregate (the review shell
|
|
28199
|
+
* around its rounds). By default the rounds detach and stay reachable as
|
|
28200
|
+
* standalone reports; `--purge` also deletes the rounds and the evidence files
|
|
28201
|
+
* only they referenced, matching the Web delete dialog.
|
|
28202
|
+
*/
|
|
28203
|
+
function attachDeleteCommand(acceptance, resolveAcceptanceId) {
|
|
28204
|
+
acceptance.command("delete <idOrSubject...>").alias("rm").description("Delete acceptances (uuid or type:id); rounds are kept as standalone reports unless --purge").option("--purge", "Also permanently delete every round, report and evidence file").option("-y, --yes", "Skip the confirmation prompt").option("--json [fields]", "Output JSON").action(async (refs, options) => {
|
|
28205
|
+
const ids = [];
|
|
28206
|
+
for (const ref of refs) ids.push(await resolveAcceptanceId(ref));
|
|
28207
|
+
const uniqueIds = [...new Set(ids)];
|
|
28208
|
+
const purge = Boolean(options.purge);
|
|
28209
|
+
const client = await getTrpcClient();
|
|
28210
|
+
if (!options.yes && !await confirmDelete(client, uniqueIds, purge)) {
|
|
28211
|
+
console.log("Aborted.");
|
|
28212
|
+
return;
|
|
28213
|
+
}
|
|
28214
|
+
const result = await removeAll(client, uniqueIds, purge);
|
|
28215
|
+
if (result.failedIds.length > 0) process.exitCode = 1;
|
|
28216
|
+
if (options.json !== void 0) {
|
|
28217
|
+
outputJson({
|
|
28218
|
+
...result,
|
|
28219
|
+
purged: purge
|
|
28220
|
+
}, typeof options.json === "string" ? options.json : void 0);
|
|
28221
|
+
return;
|
|
28222
|
+
}
|
|
28223
|
+
if (result.deleted > 0) {
|
|
28224
|
+
const what = uniqueIds.length === 1 ? `acceptance ${uniqueIds[0]}` : `${result.deleted} acceptance(s)`;
|
|
28225
|
+
console.log(`${import_picocolors.default.green("✓")} Deleted ${what}${purge ? " with rounds and evidence" : " — rounds kept as standalone reports"}`);
|
|
28226
|
+
}
|
|
28227
|
+
for (const id of result.failedIds) log$13.error(`Could not delete ${id}`);
|
|
28228
|
+
});
|
|
28229
|
+
}
|
|
28230
|
+
|
|
28123
28231
|
//#endregion
|
|
28124
28232
|
//#region src/commands/acceptance/language.ts
|
|
28125
28233
|
const HAN = {
|
|
@@ -39405,6 +39513,7 @@ function registerAcceptanceCommands(parent, options) {
|
|
|
39405
39513
|
}
|
|
39406
39514
|
});
|
|
39407
39515
|
if (options?.deprecated) return;
|
|
39516
|
+
attachDeleteCommand(acceptance, resolveAcceptanceId);
|
|
39408
39517
|
attachAcceptanceRunCommands(acceptance);
|
|
39409
39518
|
attachPlanCommands(acceptance);
|
|
39410
39519
|
attachCriterionCommands(acceptance);
|
|
@@ -266353,6 +266462,8 @@ const assertEntriesWithinWorkspace = async (workspaceRoot, targets) => {
|
|
|
266353
266462
|
/** Why a client without the app-update handlers rejects those RPCs. */
|
|
266354
266463
|
const APP_UPDATE_UNSUPPORTED_MESSAGE = "This device client does not support remote updates";
|
|
266355
266464
|
const CLI_UPDATE_UNSUPPORTED_MESSAGE = "This device client does not support remote CLI updates";
|
|
266465
|
+
/** Why a client that runs no MCP servers rejects `listMcpTools`. */
|
|
266466
|
+
const MCP_UNSUPPORTED_MESSAGE = "This device client does not support MCP servers";
|
|
266356
266467
|
/** Why a client without a recoverable trash (the CLI daemon) rejects `trashLocalFiles`. */
|
|
266357
266468
|
const TRASH_UNSUPPORTED_MESSAGE = "This device does not support moving files to the trash";
|
|
266358
266469
|
/**
|
|
@@ -266401,6 +266512,9 @@ const executeDeviceRpc = async (method, params, deps) => {
|
|
|
266401
266512
|
case "listHeterogeneousAgentModels":
|
|
266402
266513
|
if (!deps.listHeterogeneousAgentModels) throw new Error("This device client does not support heterogeneous agent model discovery");
|
|
266403
266514
|
return deps.listHeterogeneousAgentModels(params);
|
|
266515
|
+
case "listMcpTools":
|
|
266516
|
+
if (!deps.listMcpTools) throw new Error(MCP_UNSUPPORTED_MESSAGE);
|
|
266517
|
+
return deps.listMcpTools(params);
|
|
266404
266518
|
case "getClaudeCodeQuota": return getClaudeCodeQuota(params);
|
|
266405
266519
|
case "getAntigravityQuota": return getAntigravityQuota(params);
|
|
266406
266520
|
case "getCodexQuota": return getCodexQuota(params);
|
|
@@ -331869,6 +331983,15 @@ async function executeDeviceMcpCall(call, getToolAuth) {
|
|
|
331869
331983
|
}
|
|
331870
331984
|
}
|
|
331871
331985
|
/**
|
|
331986
|
+
* List an MCP server's tools on this machine (the `listMcpTools` device RPC),
|
|
331987
|
+
* for a server the cloud must not connect to itself: an install, a tool
|
|
331988
|
+
* refresh or a connection test. Listed on the runtime the tunneled calls run
|
|
331989
|
+
* on, so a stdio server is listed on the session its calls then reuse.
|
|
331990
|
+
*/
|
|
331991
|
+
async function listDeviceMcpTools({ mcpApps, params }) {
|
|
331992
|
+
return (await getRuntime()).listTools(await toClientParams(params), { mcpApps });
|
|
331993
|
+
}
|
|
331994
|
+
/**
|
|
331872
331995
|
* Disconnect every pooled MCP session so no stdio server outlives the process.
|
|
331873
331996
|
* Every disconnect starts synchronously, so an exit path that cannot await
|
|
331874
331997
|
* (connect's `cleanup()` right before `process.exit`) still closes each
|
|
@@ -554045,6 +554168,7 @@ async function runConnect(options, isDaemonChild) {
|
|
|
554045
554168
|
...params.env
|
|
554046
554169
|
}
|
|
554047
554170
|
}),
|
|
554171
|
+
listMcpTools: listDeviceMcpTools,
|
|
554048
554172
|
restartCli: maintenance.restart,
|
|
554049
554173
|
searchProjectFiles: defaultSearchProjectFiles
|
|
554050
554174
|
};
|
package/man/man1/lh.1
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.\" Code generated by `npm run man:generate`; DO NOT EDIT.
|
|
2
2
|
.\" Manual command details come from the Commander command tree.
|
|
3
|
-
.TH LH 1 "" "@lobehub/cli 0.0.
|
|
3
|
+
.TH LH 1 "" "@lobehub/cli 0.0.92" "User Commands"
|
|
4
4
|
.SH NAME
|
|
5
5
|
lh \- LobeHub CLI \- manage and connect to LobeHub services
|
|
6
6
|
.SH SYNOPSIS
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lobehub/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.92",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/lobehub/lobehub",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"access": "public",
|
|
84
84
|
"registry": "https://registry.npmjs.org"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "5a04f3b839add50e50a394ecf106713cae7c0707"
|
|
87
87
|
}
|