@codexhost/cli-linux-arm64 0.21.0 → 0.22.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 +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +1 -0
- package/app/console-web.js +1 -0
- package/app/desktop-controller.mjs +4 -1
- package/app/host-runtime.mjs +86 -21
- package/app/plugins/antigravity/plugin.mjs +1144 -1254
- package/app/plugins/claude-code/plugin.mjs +389 -84
- package/app/plugins/codebuddy/plugin.mjs +1 -0
- package/app/plugins/codex-usage/plugin.mjs +1 -0
- package/app/plugins/copilot/plugin.mjs +1 -0
- package/app/plugins/cursor-cli/plugin.mjs +1 -0
- package/app/plugins/deepseek-harness/plugin.mjs +1 -0
- package/app/plugins/devin/plugin.mjs +1 -0
- package/app/plugins/grok/plugin.mjs +192 -177
- package/app/plugins/hermes/plugin.mjs +1 -0
- package/app/plugins/kimi-code/plugin.mjs +1 -0
- package/app/plugins/kiro-cli/plugin.mjs +1 -0
- package/app/plugins/omp/plugin.mjs +108 -22
- package/app/plugins/opencode/plugin.mjs +1 -0
- package/app/plugins/pi/plugin.mjs +119 -23
- package/app/plugins/qoder/plugin.mjs +1 -0
- package/app/plugins/qoder-cn/plugin.mjs +1 -0
- package/app/plugins/qwen-code/plugin.mjs +1 -0
- package/app/plugins/workbuddy/plugin.mjs +1 -0
- package/app/plugins/zcode/plugin.mjs +1 -0
- package/app/renderer-extension.js +1 -0
- package/app/web/assets/index-CN4a4sj0.js +201 -0
- package/app/web/codexhost-settings.js +1 -0
- package/app/web/index.html +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +6 -6
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +69 -69
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +1 -1
- package/app/web-modules/server.mjs +130 -74
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
- package/app/web/assets/index-BdmZfTRW.js +0 -201
|
@@ -32926,12 +32926,12 @@ var require_form_data = __commonJS({
|
|
|
32926
32926
|
options.knownLength != null ? valueLength += Number(options.knownLength) : Buffer.isBuffer(value) ? valueLength = value.length : typeof value == "string" && (valueLength = Buffer.byteLength(value)), this._valueLength += valueLength, this._overheadLength += Buffer.byteLength(header2) + FormData2.LINE_BREAK.length, !(!value || !value.path && !(value.readable && hasOwn(value, "httpVersion")) && !(value instanceof Stream)) && (options.knownLength || this._valuesToMeasure.push(value));
|
|
32927
32927
|
};
|
|
32928
32928
|
FormData2.prototype._lengthRetriever = function(value, callback) {
|
|
32929
|
-
hasOwn(value, "fd") ? value.end != null && value.end != 1 / 0 && value.start != null ? callback(null, value.end + 1 - (value.start ? value.start : 0)) : fs4.stat(value.path, function(err,
|
|
32929
|
+
hasOwn(value, "fd") ? value.end != null && value.end != 1 / 0 && value.start != null ? callback(null, value.end + 1 - (value.start ? value.start : 0)) : fs4.stat(value.path, function(err, stat10) {
|
|
32930
32930
|
if (err) {
|
|
32931
32931
|
callback(err);
|
|
32932
32932
|
return;
|
|
32933
32933
|
}
|
|
32934
|
-
var fileSize =
|
|
32934
|
+
var fileSize = stat10.size - (value.start ? value.start : 0);
|
|
32935
32935
|
callback(null, fileSize);
|
|
32936
32936
|
}) : hasOwn(value, "httpVersion") ? callback(null, Number(value.headers["content-length"])) : hasOwn(value, "httpModule") ? (value.on("response", function(response) {
|
|
32937
32937
|
value.pause(), callback(null, Number(response.headers["content-length"]));
|
|
@@ -69504,6 +69504,7 @@ var identity = external_exports.string().min(1).max(1024), target = { hostId: id
|
|
|
69504
69504
|
message: "A history continuation requires its connection epoch"
|
|
69505
69505
|
}).optional()
|
|
69506
69506
|
}),
|
|
69507
|
+
external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
|
|
69507
69508
|
external_exports.strictObject({
|
|
69508
69509
|
kind: external_exports.literal("configure"),
|
|
69509
69510
|
...thread,
|
|
@@ -69676,24 +69677,43 @@ function registerUiExtensionRpc(rpc2, extensions3) {
|
|
|
69676
69677
|
// packages/web-server/src/workspace-file-actions.ts
|
|
69677
69678
|
import { execFile as execFile3 } from "node:child_process";
|
|
69678
69679
|
import { constants as constants2 } from "node:fs";
|
|
69679
|
-
import { open, realpath } from "node:fs/promises";
|
|
69680
|
+
import { open, realpath, stat } from "node:fs/promises";
|
|
69680
69681
|
import { basename, isAbsolute, resolve } from "node:path";
|
|
69681
69682
|
import { pipeline } from "node:stream/promises";
|
|
69682
|
-
async function openWorkspaceFile(launcher2, path8) {
|
|
69683
|
+
async function openWorkspaceFile(launcher2, path8, action) {
|
|
69683
69684
|
if (!launcher2 || !isAbsolute(launcher2))
|
|
69684
69685
|
throw new SessionRuntimeError("session/open-unavailable", "The native launcher is unavailable.");
|
|
69685
|
-
if (typeof path8 != "string" ||
|
|
69686
|
-
throw new SessionRuntimeError("gateway/bad-request", "An absolute
|
|
69687
|
-
let
|
|
69688
|
-
|
|
69689
|
-
|
|
69690
|
-
|
|
69691
|
-
|
|
69692
|
-
await
|
|
69686
|
+
if (typeof path8 != "string" || path8.includes("\0"))
|
|
69687
|
+
throw new SessionRuntimeError("gateway/bad-request", "An absolute path is required.");
|
|
69688
|
+
let nativePath = process.platform === "win32" ? path8.replace(/^\/(?=[a-z]:[/\\])/iu, "") : path8;
|
|
69689
|
+
if (!isAbsolute(nativePath))
|
|
69690
|
+
throw new SessionRuntimeError("gateway/bad-request", "An absolute path is required.");
|
|
69691
|
+
let target2 = await realpath(nativePath);
|
|
69692
|
+
if (action === "reveal") {
|
|
69693
|
+
let info = await stat(target2);
|
|
69694
|
+
if (!info.isFile() && !info.isDirectory())
|
|
69695
|
+
throw new SessionRuntimeError(
|
|
69696
|
+
"gateway/bad-request",
|
|
69697
|
+
"Only regular files and directories can be revealed."
|
|
69698
|
+
);
|
|
69699
|
+
} else {
|
|
69700
|
+
let file2 = await open(target2, constants2.O_RDONLY | constants2.O_NONBLOCK);
|
|
69701
|
+
try {
|
|
69702
|
+
if (!(await file2.stat()).isFile())
|
|
69703
|
+
throw new SessionRuntimeError("gateway/bad-request", "Only regular files can be opened.");
|
|
69704
|
+
} finally {
|
|
69705
|
+
await file2.close();
|
|
69706
|
+
}
|
|
69693
69707
|
}
|
|
69708
|
+
let command = action === "reveal" ? "reveal-file" : "open-file";
|
|
69694
69709
|
return await new Promise((resolve22, reject) => {
|
|
69695
|
-
execFile3(launcher2, [
|
|
69696
|
-
error51 ? reject(
|
|
69710
|
+
execFile3(launcher2, [command, target2], { timeout: 1e4, windowsHide: !0 }, (error51) => {
|
|
69711
|
+
error51 ? reject(
|
|
69712
|
+
new SessionRuntimeError(
|
|
69713
|
+
"session/open-failed",
|
|
69714
|
+
action === "reveal" ? "The system could not open the containing folder." : "The system could not open this file."
|
|
69715
|
+
)
|
|
69716
|
+
) : resolve22();
|
|
69697
69717
|
});
|
|
69698
69718
|
}), { opened: !0 };
|
|
69699
69719
|
}
|
|
@@ -70710,8 +70730,8 @@ function packageResolve(specifier, base, conditions) {
|
|
|
70710
70730
|
base
|
|
70711
70731
|
), packageJsonPath = fileURLToPath3(packageJsonUrl), lastPath;
|
|
70712
70732
|
do {
|
|
70713
|
-
let
|
|
70714
|
-
if (!
|
|
70733
|
+
let stat10 = tryStatSync(packageJsonPath.slice(0, -13));
|
|
70734
|
+
if (!stat10 || !stat10.isDirectory()) {
|
|
70715
70735
|
lastPath = packageJsonPath, packageJsonUrl = new URL(
|
|
70716
70736
|
(isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json",
|
|
70717
70737
|
packageJsonUrl
|
|
@@ -70874,9 +70894,9 @@ function iconOf(specifier, packageName, parentURL, manifestPath, value) {
|
|
|
70874
70894
|
}
|
|
70875
70895
|
let mediaType = ICON_MEDIA_TYPES.get(extname2(target2).toLowerCase());
|
|
70876
70896
|
if (mediaType === void 0) throw new Error(`${label}: icon must be SVG, PNG, JPEG, or WebP`);
|
|
70877
|
-
let file2 = realpathSync2(target2),
|
|
70878
|
-
if (!
|
|
70879
|
-
if (
|
|
70897
|
+
let file2 = realpathSync2(target2), stat10 = statSync2(file2);
|
|
70898
|
+
if (!stat10.isFile()) throw new Error(`${label}: icon must be a regular file`);
|
|
70899
|
+
if (stat10.size > MAX_ICON_BYTES) throw new Error(`${label}: icon exceeds 256 KiB`);
|
|
70880
70900
|
let bytes = readFileSync3(file2);
|
|
70881
70901
|
if (bytes.length > MAX_ICON_BYTES) throw new Error(`${label}: icon exceeds 256 KiB`);
|
|
70882
70902
|
return `data:${mediaType};base64,${bytes.toString("base64")}`;
|
|
@@ -70983,7 +71003,7 @@ function readExtensionMeta(specifier, directory) {
|
|
|
70983
71003
|
|
|
70984
71004
|
// packages/web-server/src/ui-extension-install.ts
|
|
70985
71005
|
import { execFile as execFile4 } from "node:child_process";
|
|
70986
|
-
import { stat, writeFile } from "node:fs/promises";
|
|
71006
|
+
import { stat as stat2, writeFile } from "node:fs/promises";
|
|
70987
71007
|
import { join as join3 } from "node:path";
|
|
70988
71008
|
|
|
70989
71009
|
// packages/harness-discovery/dist/environment.js
|
|
@@ -71231,7 +71251,7 @@ async function extensionInstallSpec(input) {
|
|
|
71231
71251
|
}
|
|
71232
71252
|
if (parsed.kind === "git") return { spec, installSpec: githubArchive(spec) };
|
|
71233
71253
|
if (parsed.path !== void 0) {
|
|
71234
|
-
let info = await
|
|
71254
|
+
let info = await stat2(parsed.path).catch(() => {
|
|
71235
71255
|
});
|
|
71236
71256
|
if (parsed.kind === "path" && info?.isDirectory() || parsed.kind === "tarball" && info?.isFile())
|
|
71237
71257
|
return { spec, ...spec !== parsed.path ? { installSpec: parsed.path } : {} };
|
|
@@ -76541,6 +76561,12 @@ function hostFileChanges(value) {
|
|
|
76541
76561
|
function hasFileChangePath(item) {
|
|
76542
76562
|
return item.changes.some((change) => change.path.trim() !== "");
|
|
76543
76563
|
}
|
|
76564
|
+
function mcpResultText(item) {
|
|
76565
|
+
return isRecord2(item.error) && typeof item.error.message == "string" ? item.error.message : !isRecord2(item.result) || !Array.isArray(item.result.content) ? "" : item.result.content.map(
|
|
76566
|
+
(block) => isRecord2(block) && block.type === "text" && typeof block.text == "string" ? block.text : JSON.stringify(block)
|
|
76567
|
+
).join(`
|
|
76568
|
+
`);
|
|
76569
|
+
}
|
|
76544
76570
|
function itemOf(item, reasoningPreviewIds) {
|
|
76545
76571
|
let itemId = item.id;
|
|
76546
76572
|
switch (item.type) {
|
|
@@ -76571,6 +76597,21 @@ function itemOf(item, reasoningPreviewIds) {
|
|
|
76571
76597
|
exitCode: typeof item.exitCode == "number" ? item.exitCode : null
|
|
76572
76598
|
};
|
|
76573
76599
|
case "mcpToolCall":
|
|
76600
|
+
return {
|
|
76601
|
+
type: "toolExecution",
|
|
76602
|
+
itemId,
|
|
76603
|
+
toolName: String(item.tool ?? ""),
|
|
76604
|
+
namespace: String(item.server ?? ""),
|
|
76605
|
+
arguments: item.arguments ?? {},
|
|
76606
|
+
output: { content: [{ type: "text", text: mcpResultText(item) }] }
|
|
76607
|
+
};
|
|
76608
|
+
case "webSearch":
|
|
76609
|
+
return {
|
|
76610
|
+
type: "toolExecution",
|
|
76611
|
+
itemId,
|
|
76612
|
+
toolName: "web_search",
|
|
76613
|
+
arguments: { query: String(item.query ?? "") }
|
|
76614
|
+
};
|
|
76574
76615
|
case "dynamicToolCall":
|
|
76575
76616
|
return {
|
|
76576
76617
|
type: "toolExecution",
|
|
@@ -76863,7 +76904,7 @@ var ChThreadView = class _ChThreadView {
|
|
|
76863
76904
|
view.projector.itemStarted(projected), projected.type === "commandExecution" && projected.output && view.projector.itemUpdated(item.id, { type: "output.append", text: projected.output }), view.started.add(item.id);
|
|
76864
76905
|
}
|
|
76865
76906
|
view.items.set(item.id, projected);
|
|
76866
|
-
let itemOutcome = item.status === "completed" ? { status: "succeeded" } : item.status === "failed" ? {
|
|
76907
|
+
let itemOutcome = item.status === "completed" || item.type === "webSearch" ? { status: "succeeded" } : item.status === "failed" ? {
|
|
76867
76908
|
status: "failed",
|
|
76868
76909
|
error: {
|
|
76869
76910
|
code: "nativeFailed",
|
|
@@ -78172,11 +78213,11 @@ var WebFiles = class {
|
|
|
78172
78213
|
try {
|
|
78173
78214
|
if (realpathSync4.native(path8) !== join12(folder, name2) || lstatSync2(path8).isSymbolicLink())
|
|
78174
78215
|
return;
|
|
78175
|
-
let
|
|
78176
|
-
return !
|
|
78216
|
+
let stat10 = lstatSync2(path8);
|
|
78217
|
+
return !stat10.isFile() || !Number.isSafeInteger(stat10.size) ? void 0 : {
|
|
78177
78218
|
attachmentId: `web-file:${basename6(folder)}/${encodeURIComponent(name2)}`,
|
|
78178
78219
|
name: name2,
|
|
78179
|
-
bytes:
|
|
78220
|
+
bytes: stat10.size
|
|
78180
78221
|
};
|
|
78181
78222
|
} catch {
|
|
78182
78223
|
return;
|
|
@@ -79526,14 +79567,14 @@ var ChSessions = class {
|
|
|
79526
79567
|
"Remote connections cannot open Host files."
|
|
79527
79568
|
);
|
|
79528
79569
|
let request3 = requestOf(args);
|
|
79529
|
-
if (request3.action !== void 0 || request3.application !== void 0)
|
|
79570
|
+
if (request3.action !== void 0 && request3.action !== "reveal" || request3.application !== void 0)
|
|
79530
79571
|
throw new SessionRuntimeError(
|
|
79531
79572
|
"session/open-unavailable",
|
|
79532
79573
|
"Only the system default application is supported."
|
|
79533
79574
|
);
|
|
79534
79575
|
if (!this.openFile)
|
|
79535
79576
|
throw new SessionRuntimeError("session/open-unavailable", "The native launcher is unavailable.");
|
|
79536
|
-
return this.openFile(request3.path);
|
|
79577
|
+
return this.openFile(request3.path, request3.action);
|
|
79537
79578
|
});
|
|
79538
79579
|
for (let [method2, archived] of [
|
|
79539
79580
|
["workspace/archiveSession", !0],
|
|
@@ -80030,8 +80071,8 @@ async function discoverHostClientChannel(directory) {
|
|
|
80030
80071
|
try {
|
|
80031
80072
|
let handle = await open3(path6.join(directory, name2), constants6.O_RDONLY | (constants6.O_NOFOLLOW ?? 0));
|
|
80032
80073
|
try {
|
|
80033
|
-
let
|
|
80034
|
-
if (!
|
|
80074
|
+
let stat10 = await handle.stat();
|
|
80075
|
+
if (!stat10.isFile() || stat10.size > 4096 || process.platform !== "win32" && (stat10.uid !== process.getuid?.() || (stat10.mode & 63) !== 0))
|
|
80035
80076
|
continue;
|
|
80036
80077
|
let descriptor = clientChannelDescriptorSchema.parse(JSON.parse(await handle.readFile("utf8")));
|
|
80037
80078
|
process.kill(descriptor.pid, 0), candidates.push(descriptor);
|
|
@@ -81777,7 +81818,7 @@ async function installRendererLoadedModules(renderer) {
|
|
|
81777
81818
|
contexts.clear(), contextIds.clear(), dirty.clear();
|
|
81778
81819
|
};
|
|
81779
81820
|
try {
|
|
81780
|
-
return await renderer.command("Runtime.enable"), await renderer.command("Debugger.enable"), ready = !0, await flush(), dispose;
|
|
81821
|
+
return await renderer.command("Runtime.enable"), await renderer.command("Debugger.enable", { maxScriptsCacheSize: 0 }), ready = !0, await flush(), dispose;
|
|
81781
81822
|
} catch (error51) {
|
|
81782
81823
|
throw dispose(), error51;
|
|
81783
81824
|
}
|
|
@@ -82862,8 +82903,8 @@ async function readRemoteProjectMetadata(file2 = join14(process.env.CODEX_HOME ?
|
|
|
82862
82903
|
if (!handle)
|
|
82863
82904
|
return [];
|
|
82864
82905
|
try {
|
|
82865
|
-
let
|
|
82866
|
-
if (!
|
|
82906
|
+
let stat10 = await handle.stat();
|
|
82907
|
+
if (!stat10.isFile() || stat10.size > 32 * 1024 * 1024)
|
|
82867
82908
|
throw new Error("Invalid Desktop project metadata");
|
|
82868
82909
|
let text3 = await handle.readFile("utf8");
|
|
82869
82910
|
if (Buffer.byteLength(text3) > 32 * 1024 * 1024)
|
|
@@ -82986,8 +83027,8 @@ async function requestRemoteSession(operation, path8 = remoteSessionDescriptorPa
|
|
|
82986
83027
|
return result;
|
|
82987
83028
|
}
|
|
82988
83029
|
async function readDescriptor(path8) {
|
|
82989
|
-
let
|
|
82990
|
-
if (!
|
|
83030
|
+
let stat10 = await lstat3(path8);
|
|
83031
|
+
if (!stat10.isFile() || stat10.size > 4096 || process.platform !== "win32" && (stat10.uid !== process.getuid?.() || (stat10.mode & 63) !== 0))
|
|
82991
83032
|
throw new Error("Desktop runtime descriptor is not a private owned file");
|
|
82992
83033
|
let value = JSON.parse(await readFile4(path8, "utf8"));
|
|
82993
83034
|
if (value.schema_version !== 1 || !Number.isInteger(value.launcher_pid) || Number(value.launcher_pid) <= 0 || !Number.isInteger(value.control_port) || Number(value.control_port) < 1 || Number(value.control_port) > 65535 || typeof value.nonce != "string" || !/^[0-9a-f]{32}$/u.test(value.nonce))
|
|
@@ -83691,7 +83732,7 @@ var RemoteSessions = class {
|
|
|
83691
83732
|
try {
|
|
83692
83733
|
return await this.call(parsed.data);
|
|
83693
83734
|
} catch (error51) {
|
|
83694
|
-
let write = !["hosts", "list", "read", "status"].includes(operation.kind);
|
|
83735
|
+
let write = !["hosts", "list", "read", "status", "usage"].includes(operation.kind);
|
|
83695
83736
|
throw !write && error51 instanceof RemoteSessionError && ![-32090, -32093].includes(error51.code) ? new SessionRuntimeError(
|
|
83696
83737
|
error51.code === -32094 ? "remote/history-too-large" : error51.code === -32095 ? "remote/connection-changed" : error51.code === -32096 ? "remote/controller-rejected" : "remote/read-failed",
|
|
83697
83738
|
error51.message
|
|
@@ -83847,7 +83888,7 @@ var RemoteSessions = class {
|
|
|
83847
83888
|
}
|
|
83848
83889
|
offline(entry) {
|
|
83849
83890
|
let changed = entry.online;
|
|
83850
|
-
entry.online = !1;
|
|
83891
|
+
entry.online = !1, changed && delete entry.usageRequest;
|
|
83851
83892
|
let id = remoteSessionId(entry.identity.hostId, entry.identity.threadId);
|
|
83852
83893
|
this.clearPending(id), changed && !this.closed && this.events.emit("api-session/added", this.summary(id, entry)), entry.view?.log.setProjection("nativeConnection", {
|
|
83853
83894
|
state: "reconnecting",
|
|
@@ -83920,7 +83961,7 @@ var RemoteSessions = class {
|
|
|
83920
83961
|
"harnessIdentity",
|
|
83921
83962
|
"remoteHistoryError"
|
|
83922
83963
|
].includes(key) && current.view.log.setProjection(key, value);
|
|
83923
|
-
current.view.log.setProjection("harnessIdentity", remoteHarnessIdentity(current) ?? null), applyRemoteControls(current, current.view), this.interactions(id, current, snapshot.requests), (snapshot.interactionsAvailable === !1 || snapshot.requests.some(
|
|
83964
|
+
current.view.log.setProjection("harnessIdentity", remoteHarnessIdentity(current) ?? null), applyRemoteControls(current, current.view), this.loadUsage(id, current, current.view, snapshot.epoch), this.interactions(id, current, snapshot.requests), (snapshot.interactionsAvailable === !1 || snapshot.requests.some(
|
|
83924
83965
|
(request3) => ![
|
|
83925
83966
|
"item/commandExecution/requestApproval",
|
|
83926
83967
|
"item/fileChange/requestApproval"
|
|
@@ -83941,8 +83982,23 @@ var RemoteSessions = class {
|
|
|
83941
83982
|
delete current.reading;
|
|
83942
83983
|
}), current.reading;
|
|
83943
83984
|
}
|
|
83985
|
+
loadUsage(id, entry, view, epoch) {
|
|
83986
|
+
let updatedAt = view.thread.updatedAt, lastTurnId = view.thread.turns.at(-1)?.id, previous = entry.usageRequest;
|
|
83987
|
+
if (previous?.view === view && (previous.pending || previous.updatedAt === updatedAt && previous.lastTurnId === lastTurnId && Date.now() < previous.retryAt))
|
|
83988
|
+
return;
|
|
83989
|
+
let request3 = { view, updatedAt, lastTurnId, retryAt: 0, pending: !0 };
|
|
83990
|
+
entry.usageRequest = request3;
|
|
83991
|
+
let matchesHistory = () => view.thread.updatedAt === updatedAt && view.thread.turns.at(-1)?.id === lastTurnId, isCurrent = () => !this.closed && this.entries.get(id) === entry && entry.online && entry.view === view && entry.epoch === epoch && entry.usageRequest === request3;
|
|
83992
|
+
this.invoke({ kind: "usage", ...entry.identity, epoch }).then((raw) => {
|
|
83993
|
+
let parsed = threadUsageInspectionSchema.safeParse(raw);
|
|
83994
|
+
parsed.success && parsed.data.threadId === entry.identity.threadId && isCurrent() && matchesHistory() && applyUsageProjections(view.log, parsed.data);
|
|
83995
|
+
}).catch(() => {
|
|
83996
|
+
}).finally(() => {
|
|
83997
|
+
request3.pending = !1, request3.retryAt = Date.now() + 3e4, isCurrent() && !matchesHistory() && this.loadUsage(id, entry, view, epoch);
|
|
83998
|
+
});
|
|
83999
|
+
}
|
|
83944
84000
|
retireView(entry) {
|
|
83945
|
-
entry.view && (entry.viewOrigin = entry.view.log.lastSeq + 1, entry.view.retire(), entry.view.log.reconnectFollowers(), delete entry.view, delete entry.viewHarnessId);
|
|
84001
|
+
entry.view && (entry.viewOrigin = entry.view.log.lastSeq + 1, entry.view.retire(), entry.view.log.reconnectFollowers(), delete entry.view, delete entry.viewHarnessId, delete entry.usageRequest);
|
|
83946
84002
|
}
|
|
83947
84003
|
createView(row, harnessId, origin = 0) {
|
|
83948
84004
|
let view = new ChThreadView(
|
|
@@ -84239,7 +84295,7 @@ async function serveChClientGateway(host, request3, response) {
|
|
|
84239
84295
|
}
|
|
84240
84296
|
|
|
84241
84297
|
// apps/web-ui/packages/host/dsh-web-backend/src/index.ts
|
|
84242
|
-
import { stat as
|
|
84298
|
+
import { stat as stat8 } from "node:fs/promises";
|
|
84243
84299
|
|
|
84244
84300
|
// apps/web-ui/packages/host/dsh-web-backend/src/plugin-runtime.ts
|
|
84245
84301
|
import { Service as Service2 } from "@deepseek-ai/cordis";
|
|
@@ -87435,7 +87491,7 @@ var WorkspaceChangeFeed = class {
|
|
|
87435
87491
|
throw error51;
|
|
87436
87492
|
});
|
|
87437
87493
|
if (target2 === void 0 || aborted2()) return;
|
|
87438
|
-
let
|
|
87494
|
+
let stat10 = async () => {
|
|
87439
87495
|
let info = await this.ctx.fs.stat(target2, signal).catch((error51) => {
|
|
87440
87496
|
if (!aborted2())
|
|
87441
87497
|
throw error51;
|
|
@@ -87448,7 +87504,7 @@ var WorkspaceChangeFeed = class {
|
|
|
87448
87504
|
);
|
|
87449
87505
|
return info;
|
|
87450
87506
|
};
|
|
87451
|
-
if (await
|
|
87507
|
+
if (await stat10(), aborted2()) return;
|
|
87452
87508
|
try {
|
|
87453
87509
|
if (unwatch = await this.ctx.fs.watch(
|
|
87454
87510
|
target2,
|
|
@@ -87470,7 +87526,7 @@ var WorkspaceChangeFeed = class {
|
|
|
87470
87526
|
yield { kind: "ready" };
|
|
87471
87527
|
for await (let [observed] of follower.read()) {
|
|
87472
87528
|
if (observed.targetKey !== target2.targetKey) continue;
|
|
87473
|
-
let info = await
|
|
87529
|
+
let info = await stat10();
|
|
87474
87530
|
if (aborted2()) return;
|
|
87475
87531
|
let absolutePath = this.ctx.fs.processPath(target2);
|
|
87476
87532
|
yield {
|
|
@@ -88611,12 +88667,12 @@ import { once as once2 } from "node:events";
|
|
|
88611
88667
|
|
|
88612
88668
|
// node_modules/chokidar/esm/index.js
|
|
88613
88669
|
import { stat as statcb } from "fs";
|
|
88614
|
-
import { stat as
|
|
88670
|
+
import { stat as stat5, readdir as readdir5 } from "fs/promises";
|
|
88615
88671
|
import { EventEmitter } from "events";
|
|
88616
88672
|
import * as sysPath2 from "path";
|
|
88617
88673
|
|
|
88618
88674
|
// node_modules/readdirp/esm/index.js
|
|
88619
|
-
import { stat as
|
|
88675
|
+
import { stat as stat3, lstat as lstat4, readdir as readdir4, realpath as realpath4 } from "node:fs/promises";
|
|
88620
88676
|
import { Readable as Readable2 } from "node:stream";
|
|
88621
88677
|
import { resolve as presolve, relative as prelative, join as pjoin, sep as psep } from "node:path";
|
|
88622
88678
|
var EntryTypes = {
|
|
@@ -88671,7 +88727,7 @@ var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR", NORMAL_FLOW_ERRORS = /* @
|
|
|
88671
88727
|
});
|
|
88672
88728
|
let opts = { ...defaultOptions, ...options }, { root, type: type2 } = opts;
|
|
88673
88729
|
this._fileFilter = normalizeFilter(opts.fileFilter), this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
88674
|
-
let statMethod = opts.lstat ? lstat4 :
|
|
88730
|
+
let statMethod = opts.lstat ? lstat4 : stat3;
|
|
88675
88731
|
wantBigintFsStats ? this._stat = (path8) => statMethod(path8, { bigint: !0 }) : this._stat = statMethod, this._maxDepth = opts.depth ?? defaultOptions.depth, this._wantsDir = type2 ? DIR_TYPES.has(type2) : !1, this._wantsFile = type2 ? FILE_TYPES.has(type2) : !1, this._wantsEverything = type2 === EntryTypes.EVERYTHING_TYPE, this._root = presolve(root), this._isDirent = !opts.alwaysStat, this._statsProp = this._isDirent ? "dirent" : "stats", this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent }, this.parents = [this._exploreDir(root, 1)], this.reading = !1, this.parent = void 0;
|
|
88676
88732
|
}
|
|
88677
88733
|
async _read(batch) {
|
|
@@ -88775,7 +88831,7 @@ function readdirp(root, options = {}) {
|
|
|
88775
88831
|
|
|
88776
88832
|
// node_modules/chokidar/esm/handler.js
|
|
88777
88833
|
import { watchFile, unwatchFile, watch as fs_watch } from "fs";
|
|
88778
|
-
import { open as open5, stat as
|
|
88834
|
+
import { open as open5, stat as stat4, lstat as lstat5, realpath as fsrealpath } from "fs/promises";
|
|
88779
88835
|
import * as sysPath from "path";
|
|
88780
88836
|
import { type as osType } from "os";
|
|
88781
88837
|
var STR_DATA = "data", STR_END = "end", STR_CLOSE = "close", EMPTY_FN = () => {
|
|
@@ -88790,7 +88846,7 @@ var pl = process.platform, isWindows = pl === "win32", isMacos = pl === "darwin"
|
|
|
88790
88846
|
UNLINK_DIR: "unlinkDir",
|
|
88791
88847
|
RAW: "raw",
|
|
88792
88848
|
ERROR: "error"
|
|
88793
|
-
}, EV = EVENTS, THROTTLE_MODE_WATCH = "watch", statMethods = { lstat: lstat5, stat:
|
|
88849
|
+
}, EV = EVENTS, THROTTLE_MODE_WATCH = "watch", statMethods = { lstat: lstat5, stat: stat4 }, KEY_LISTENERS = "listeners", KEY_ERR = "errHandlers", KEY_RAW = "rawEmitters", HANDLER_KEYS = [KEY_LISTENERS, KEY_ERR, KEY_RAW], binaryExtensions = /* @__PURE__ */ new Set([
|
|
88794
88850
|
"3dm",
|
|
88795
88851
|
"3ds",
|
|
88796
88852
|
"3g2",
|
|
@@ -89179,7 +89235,7 @@ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
|
|
|
89179
89235
|
if (this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5)) {
|
|
89180
89236
|
if (!newStats || newStats.mtimeMs === 0)
|
|
89181
89237
|
try {
|
|
89182
|
-
let newStats2 = await
|
|
89238
|
+
let newStats2 = await stat4(file2);
|
|
89183
89239
|
if (this.fsw.closed)
|
|
89184
89240
|
return;
|
|
89185
89241
|
let at = newStats2.atimeMs, mt = newStats2.mtimeMs;
|
|
@@ -89590,7 +89646,7 @@ var unifyPaths = (paths_) => {
|
|
|
89590
89646
|
if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
|
|
89591
89647
|
let fullPath = opts.cwd ? sysPath2.join(opts.cwd, path8) : path8, stats2;
|
|
89592
89648
|
try {
|
|
89593
|
-
stats2 = await
|
|
89649
|
+
stats2 = await stat5(fullPath);
|
|
89594
89650
|
} catch {
|
|
89595
89651
|
}
|
|
89596
89652
|
if (!stats2 || this.closed)
|
|
@@ -89677,8 +89733,8 @@ var unifyPaths = (paths_) => {
|
|
|
89677
89733
|
}
|
|
89678
89734
|
return this._userIgnored(path8, stats);
|
|
89679
89735
|
}
|
|
89680
|
-
_isntIgnored(path8,
|
|
89681
|
-
return !this._isIgnored(path8,
|
|
89736
|
+
_isntIgnored(path8, stat10) {
|
|
89737
|
+
return !this._isIgnored(path8, stat10);
|
|
89682
89738
|
}
|
|
89683
89739
|
/**
|
|
89684
89740
|
* Provides a set of common helpers and properties relating to symlink handling.
|
|
@@ -91414,7 +91470,7 @@ import {
|
|
|
91414
91470
|
readdir as readdir6,
|
|
91415
91471
|
rename as rename3,
|
|
91416
91472
|
rm as rm4,
|
|
91417
|
-
stat as
|
|
91473
|
+
stat as stat6
|
|
91418
91474
|
} from "node:fs/promises";
|
|
91419
91475
|
import { basename as basename10, dirname as dirname11, isAbsolute as isAbsolute14, join as join20, resolve as resolve15, sep as sep7 } from "node:path";
|
|
91420
91476
|
import { TextDecoder as TextDecoder2, promisify as promisify6 } from "node:util";
|
|
@@ -91547,7 +91603,7 @@ async function resolveLocalTarget(cwd, path8) {
|
|
|
91547
91603
|
`cannot resolve "${displayPath}": parent traversal crosses a missing directory`,
|
|
91548
91604
|
"FS_NOT_FOUND"
|
|
91549
91605
|
);
|
|
91550
|
-
if (process.platform === "win32" && !(await
|
|
91606
|
+
if (process.platform === "win32" && !(await stat6(realAncestor)).isDirectory())
|
|
91551
91607
|
throw new FsError(
|
|
91552
91608
|
`cannot resolve "${displayPath}": a parent path segment is not a directory`,
|
|
91553
91609
|
"FS_NOT_FOUND"
|
|
@@ -91575,7 +91631,7 @@ async function probeStats(absolutePath, readStats) {
|
|
|
91575
91631
|
}
|
|
91576
91632
|
}
|
|
91577
91633
|
async function probe(absolutePath) {
|
|
91578
|
-
let info = await probeStats(absolutePath, (path8) =>
|
|
91634
|
+
let info = await probeStats(absolutePath, (path8) => stat6(path8, { bigint: !0 }));
|
|
91579
91635
|
return info ? {
|
|
91580
91636
|
version: versionOf(info),
|
|
91581
91637
|
mode: Number(info.mode & 0o777n),
|
|
@@ -91661,7 +91717,7 @@ async function statRegularFile(target2, verb, signal) {
|
|
|
91661
91717
|
throwIfAborted(signal, verb);
|
|
91662
91718
|
let info;
|
|
91663
91719
|
try {
|
|
91664
|
-
info = await
|
|
91720
|
+
info = await stat6(target2.targetKey);
|
|
91665
91721
|
} catch (error51) {
|
|
91666
91722
|
throw isENOENT(error51) ? new FsError(`cannot ${verb} "${target2.displayPath}": not found`, "FS_NOT_FOUND") : error51;
|
|
91667
91723
|
}
|
|
@@ -95847,7 +95903,7 @@ var _deepseek_ai_dsh_api_terminal_controller_terminal_attach_parameter_0$schema$
|
|
|
95847
95903
|
|
|
95848
95904
|
// apps/web-ui/packages/subprocess/subprocess-local/src/index.ts
|
|
95849
95905
|
import { constants as constants9 } from "node:fs";
|
|
95850
|
-
import { access, stat as
|
|
95906
|
+
import { access, stat as stat7 } from "node:fs/promises";
|
|
95851
95907
|
import { userInfo } from "node:os";
|
|
95852
95908
|
import { delimiter, extname as extname6, isAbsolute as isAbsolute19, resolve as resolve17 } from "node:path";
|
|
95853
95909
|
|
|
@@ -96173,8 +96229,8 @@ function linuxProcessGroupHasLiveMembers(processGroupId, internals = DEFAULT_INT
|
|
|
96173
96229
|
let matched = !1;
|
|
96174
96230
|
for (let entry of entries) {
|
|
96175
96231
|
if (!/^\d+$/.test(entry)) continue;
|
|
96176
|
-
let
|
|
96177
|
-
if (
|
|
96232
|
+
let stat10 = readLinuxStat(internals, Number(entry));
|
|
96233
|
+
if (stat10?.pgrp === processGroupId && (matched = !0, !/^[ZXx]$/.test(stat10.state)))
|
|
96178
96234
|
return !0;
|
|
96179
96235
|
}
|
|
96180
96236
|
return matched ? !1 : void 0;
|
|
@@ -96333,22 +96389,22 @@ var LinuxProcessInspector = class extends PosixProcessInspector {
|
|
|
96333
96389
|
return !1;
|
|
96334
96390
|
}
|
|
96335
96391
|
isAlive(identity2) {
|
|
96336
|
-
let
|
|
96337
|
-
return
|
|
96392
|
+
let stat10 = readLinuxStat(this.internals, identity2.pid);
|
|
96393
|
+
return stat10?.started === identity2.started && !quiescent(stat10.state);
|
|
96338
96394
|
}
|
|
96339
96395
|
snapshot() {
|
|
96340
96396
|
let pids = numericEntries(this.internals, "/proc");
|
|
96341
96397
|
if (pids === void 0)
|
|
96342
96398
|
throw new Error("Cannot inspect processes: /proc directory is unreadable");
|
|
96343
96399
|
let complete = !0, rows = pids.flatMap((pid) => {
|
|
96344
|
-
let
|
|
96345
|
-
return
|
|
96400
|
+
let stat10 = readLinuxStat(this.internals, pid);
|
|
96401
|
+
return stat10 === void 0 && (complete = !1), stat10 === void 0 ? [] : [
|
|
96346
96402
|
{
|
|
96347
96403
|
pid,
|
|
96348
|
-
parentPid:
|
|
96349
|
-
started:
|
|
96350
|
-
session:
|
|
96351
|
-
state:
|
|
96404
|
+
parentPid: stat10.parentPid,
|
|
96405
|
+
started: stat10.started,
|
|
96406
|
+
session: stat10.session,
|
|
96407
|
+
state: stat10.state
|
|
96352
96408
|
}
|
|
96353
96409
|
];
|
|
96354
96410
|
});
|
|
@@ -98437,7 +98493,7 @@ var requireNodePty = createLazyRequire("node-pty", import.meta.url), LocalSubpro
|
|
|
98437
98493
|
for (let candidate of candidates) {
|
|
98438
98494
|
signal?.throwIfAborted();
|
|
98439
98495
|
try {
|
|
98440
|
-
if (!(await
|
|
98496
|
+
if (!(await stat7(candidate)).isFile()) continue;
|
|
98441
98497
|
return await access(candidate, constants9.X_OK), signal?.throwIfAborted(), candidate;
|
|
98442
98498
|
} catch {
|
|
98443
98499
|
}
|
|
@@ -99078,7 +99134,7 @@ async function createDshWebBackend(options) {
|
|
|
99078
99134
|
async ensure(agent, signal) {
|
|
99079
99135
|
signal.throwIfAborted();
|
|
99080
99136
|
let cwd = this.get(agent.session);
|
|
99081
|
-
if (!(await
|
|
99137
|
+
if (!(await stat8(cwd)).isDirectory())
|
|
99082
99138
|
throw new Error("Terminal working directory is not a directory");
|
|
99083
99139
|
return signal.throwIfAborted(), cwd;
|
|
99084
99140
|
}
|
|
@@ -100253,8 +100309,8 @@ import { statSync as statSync11 } from "node:fs";
|
|
|
100253
100309
|
var SHELL_EVENTS_PATH = "/plugins/shell-events";
|
|
100254
100310
|
function statKey(path8) {
|
|
100255
100311
|
try {
|
|
100256
|
-
let
|
|
100257
|
-
return `${String(
|
|
100312
|
+
let stat10 = statSync11(path8);
|
|
100313
|
+
return `${String(stat10.mtimeMs)}:${String(stat10.ctimeMs)}:${String(stat10.size)}`;
|
|
100258
100314
|
} catch {
|
|
100259
100315
|
return;
|
|
100260
100316
|
}
|
|
@@ -100446,11 +100502,11 @@ function defaultWebDataDirectory(hostDataDirectory) {
|
|
|
100446
100502
|
|
|
100447
100503
|
// packages/web-server/src/packaged-host.ts
|
|
100448
100504
|
import { createHash as createHash11 } from "node:crypto";
|
|
100449
|
-
import { cp, mkdir as mkdir7, mkdtemp as mkdtemp3, readFile as readFile6, readdir as readdir8, rename as rename5, rm as rm8, stat as
|
|
100505
|
+
import { cp, mkdir as mkdir7, mkdtemp as mkdtemp3, readFile as readFile6, readdir as readdir8, rename as rename5, rm as rm8, stat as stat9 } from "node:fs/promises";
|
|
100450
100506
|
import { join as join30 } from "node:path";
|
|
100451
100507
|
async function hashDirectory(root, hash3, relative11 = "") {
|
|
100452
100508
|
for (let name2 of (await readdir8(join30(root, relative11))).sort()) {
|
|
100453
|
-
let file2 = join30(relative11, name2), metadata = await
|
|
100509
|
+
let file2 = join30(relative11, name2), metadata = await stat9(join30(root, file2));
|
|
100454
100510
|
hash3.update(JSON.stringify([file2, metadata.mode & 511, metadata.isDirectory()])), metadata.isDirectory() ? await hashDirectory(root, hash3, file2) : (hash3.update(String(metadata.size) + ":"), hash3.update(await readFile6(join30(root, file2))));
|
|
100455
100511
|
}
|
|
100456
100512
|
}
|
|
@@ -100471,7 +100527,7 @@ async function snapshotPackagedHost(distribution, data2) {
|
|
|
100471
100527
|
try {
|
|
100472
100528
|
await rename5(staging, destination);
|
|
100473
100529
|
} catch (error51) {
|
|
100474
|
-
if (!(await
|
|
100530
|
+
if (!(await stat9(destination).catch(() => null))?.isDirectory()) throw error51;
|
|
100475
100531
|
}
|
|
100476
100532
|
return destination;
|
|
100477
100533
|
} finally {
|
|
@@ -100580,7 +100636,7 @@ var publicUrl = background ? background.publicUrl : values["public-url"] ?? proc
|
|
|
100580
100636
|
displayEntries,
|
|
100581
100637
|
preferences,
|
|
100582
100638
|
enabledHarnesses,
|
|
100583
|
-
(path8) => openWorkspaceFile(launcher, path8)
|
|
100639
|
+
(path8, action) => openWorkspaceFile(launcher, path8, action)
|
|
100584
100640
|
), dsh = await DshWebServices.open({
|
|
100585
100641
|
workspaceRoot: resolve21(values.workspace),
|
|
100586
100642
|
threadWorkspace: (id) => sessions.terminalWorkspaceRoot(id),
|
package/bin/codexhost
CHANGED
|
Binary file
|
package/libexec/codexhost-shim
CHANGED
|
Binary file
|
|
Binary file
|