@karlorz/codexhost-cli-darwin-x64 0.21.0-0 → 0.22.0-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 +2 -1
- package/app/cpa-live-voice-hook.js +213 -178
- package/app/desktop-controller.mjs +8 -2
- package/app/host-runtime.mjs +96 -26
- package/app/overlay-voice-bootstrap.js +1 -1616
- package/app/plugins/antigravity/plugin.mjs +1144 -1254
- package/app/plugins/claude-code/plugin.mjs +389 -80
- 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 +232 -217
- 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 +799 -476
- package/app/voice-qualification.json +13 -13
- package/app/web/assets/index-CYo5zTz_.js +201 -0
- package/app/web/codexhost-settings.js +2 -1
- 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 +3 -3
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +9 -9
- 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-DLXdvkWR.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"]));
|
|
@@ -69924,6 +69924,7 @@ var identity = external_exports.string().min(1).max(1024), target = { hostId: id
|
|
|
69924
69924
|
message: "A history continuation requires its connection epoch"
|
|
69925
69925
|
}).optional()
|
|
69926
69926
|
}),
|
|
69927
|
+
external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
|
|
69927
69928
|
external_exports.strictObject({
|
|
69928
69929
|
kind: external_exports.literal("configure"),
|
|
69929
69930
|
...thread,
|
|
@@ -70122,24 +70123,43 @@ function registerUiExtensionRpc(rpc2, extensions3) {
|
|
|
70122
70123
|
// packages/web-server/src/workspace-file-actions.ts
|
|
70123
70124
|
import { execFile as execFile3 } from "node:child_process";
|
|
70124
70125
|
import { constants as constants2 } from "node:fs";
|
|
70125
|
-
import { open, realpath } from "node:fs/promises";
|
|
70126
|
+
import { open, realpath, stat } from "node:fs/promises";
|
|
70126
70127
|
import { basename, isAbsolute, resolve } from "node:path";
|
|
70127
70128
|
import { pipeline } from "node:stream/promises";
|
|
70128
|
-
async function openWorkspaceFile(launcher2, path8) {
|
|
70129
|
+
async function openWorkspaceFile(launcher2, path8, action) {
|
|
70129
70130
|
if (!launcher2 || !isAbsolute(launcher2))
|
|
70130
70131
|
throw new SessionRuntimeError("session/open-unavailable", "The native launcher is unavailable.");
|
|
70131
|
-
if (typeof path8 != "string" ||
|
|
70132
|
-
throw new SessionRuntimeError("gateway/bad-request", "An absolute
|
|
70133
|
-
let
|
|
70134
|
-
|
|
70135
|
-
|
|
70136
|
-
|
|
70137
|
-
|
|
70138
|
-
await
|
|
70132
|
+
if (typeof path8 != "string" || path8.includes("\0"))
|
|
70133
|
+
throw new SessionRuntimeError("gateway/bad-request", "An absolute path is required.");
|
|
70134
|
+
let nativePath = process.platform === "win32" ? path8.replace(/^\/(?=[a-z]:[/\\])/iu, "") : path8;
|
|
70135
|
+
if (!isAbsolute(nativePath))
|
|
70136
|
+
throw new SessionRuntimeError("gateway/bad-request", "An absolute path is required.");
|
|
70137
|
+
let target2 = await realpath(nativePath);
|
|
70138
|
+
if (action === "reveal") {
|
|
70139
|
+
let info = await stat(target2);
|
|
70140
|
+
if (!info.isFile() && !info.isDirectory())
|
|
70141
|
+
throw new SessionRuntimeError(
|
|
70142
|
+
"gateway/bad-request",
|
|
70143
|
+
"Only regular files and directories can be revealed."
|
|
70144
|
+
);
|
|
70145
|
+
} else {
|
|
70146
|
+
let file2 = await open(target2, constants2.O_RDONLY | constants2.O_NONBLOCK);
|
|
70147
|
+
try {
|
|
70148
|
+
if (!(await file2.stat()).isFile())
|
|
70149
|
+
throw new SessionRuntimeError("gateway/bad-request", "Only regular files can be opened.");
|
|
70150
|
+
} finally {
|
|
70151
|
+
await file2.close();
|
|
70152
|
+
}
|
|
70139
70153
|
}
|
|
70154
|
+
let command = action === "reveal" ? "reveal-file" : "open-file";
|
|
70140
70155
|
return await new Promise((resolve22, reject) => {
|
|
70141
|
-
execFile3(launcher2, [
|
|
70142
|
-
error51 ? reject(
|
|
70156
|
+
execFile3(launcher2, [command, target2], { timeout: 1e4, windowsHide: !0 }, (error51) => {
|
|
70157
|
+
error51 ? reject(
|
|
70158
|
+
new SessionRuntimeError(
|
|
70159
|
+
"session/open-failed",
|
|
70160
|
+
action === "reveal" ? "The system could not open the containing folder." : "The system could not open this file."
|
|
70161
|
+
)
|
|
70162
|
+
) : resolve22();
|
|
70143
70163
|
});
|
|
70144
70164
|
}), { opened: !0 };
|
|
70145
70165
|
}
|
|
@@ -71156,8 +71176,8 @@ function packageResolve(specifier, base, conditions) {
|
|
|
71156
71176
|
base
|
|
71157
71177
|
), packageJsonPath = fileURLToPath3(packageJsonUrl), lastPath;
|
|
71158
71178
|
do {
|
|
71159
|
-
let
|
|
71160
|
-
if (!
|
|
71179
|
+
let stat10 = tryStatSync(packageJsonPath.slice(0, -13));
|
|
71180
|
+
if (!stat10 || !stat10.isDirectory()) {
|
|
71161
71181
|
lastPath = packageJsonPath, packageJsonUrl = new URL(
|
|
71162
71182
|
(isScoped ? "../../../../node_modules/" : "../../../node_modules/") + packageName + "/package.json",
|
|
71163
71183
|
packageJsonUrl
|
|
@@ -71320,9 +71340,9 @@ function iconOf(specifier, packageName, parentURL, manifestPath, value) {
|
|
|
71320
71340
|
}
|
|
71321
71341
|
let mediaType = ICON_MEDIA_TYPES.get(extname2(target2).toLowerCase());
|
|
71322
71342
|
if (mediaType === void 0) throw new Error(`${label}: icon must be SVG, PNG, JPEG, or WebP`);
|
|
71323
|
-
let file2 = realpathSync2(target2),
|
|
71324
|
-
if (!
|
|
71325
|
-
if (
|
|
71343
|
+
let file2 = realpathSync2(target2), stat10 = statSync2(file2);
|
|
71344
|
+
if (!stat10.isFile()) throw new Error(`${label}: icon must be a regular file`);
|
|
71345
|
+
if (stat10.size > MAX_ICON_BYTES) throw new Error(`${label}: icon exceeds 256 KiB`);
|
|
71326
71346
|
let bytes = readFileSync3(file2);
|
|
71327
71347
|
if (bytes.length > MAX_ICON_BYTES) throw new Error(`${label}: icon exceeds 256 KiB`);
|
|
71328
71348
|
return `data:${mediaType};base64,${bytes.toString("base64")}`;
|
|
@@ -71429,7 +71449,7 @@ function readExtensionMeta(specifier, directory) {
|
|
|
71429
71449
|
|
|
71430
71450
|
// packages/web-server/src/ui-extension-install.ts
|
|
71431
71451
|
import { execFile as execFile4 } from "node:child_process";
|
|
71432
|
-
import { stat, writeFile } from "node:fs/promises";
|
|
71452
|
+
import { stat as stat2, writeFile } from "node:fs/promises";
|
|
71433
71453
|
import { join as join3 } from "node:path";
|
|
71434
71454
|
|
|
71435
71455
|
// packages/harness-discovery/dist/environment.js
|
|
@@ -71677,7 +71697,7 @@ async function extensionInstallSpec(input) {
|
|
|
71677
71697
|
}
|
|
71678
71698
|
if (parsed.kind === "git") return { spec, installSpec: githubArchive(spec) };
|
|
71679
71699
|
if (parsed.path !== void 0) {
|
|
71680
|
-
let info = await
|
|
71700
|
+
let info = await stat2(parsed.path).catch(() => {
|
|
71681
71701
|
});
|
|
71682
71702
|
if (parsed.kind === "path" && info?.isDirectory() || parsed.kind === "tarball" && info?.isFile())
|
|
71683
71703
|
return { spec, ...spec !== parsed.path ? { installSpec: parsed.path } : {} };
|
|
@@ -76987,6 +77007,12 @@ function hostFileChanges(value) {
|
|
|
76987
77007
|
function hasFileChangePath(item) {
|
|
76988
77008
|
return item.changes.some((change) => change.path.trim() !== "");
|
|
76989
77009
|
}
|
|
77010
|
+
function mcpResultText(item) {
|
|
77011
|
+
return isRecord2(item.error) && typeof item.error.message == "string" ? item.error.message : !isRecord2(item.result) || !Array.isArray(item.result.content) ? "" : item.result.content.map(
|
|
77012
|
+
(block) => isRecord2(block) && block.type === "text" && typeof block.text == "string" ? block.text : JSON.stringify(block)
|
|
77013
|
+
).join(`
|
|
77014
|
+
`);
|
|
77015
|
+
}
|
|
76990
77016
|
function itemOf(item, reasoningPreviewIds) {
|
|
76991
77017
|
let itemId = item.id;
|
|
76992
77018
|
switch (item.type) {
|
|
@@ -77017,6 +77043,21 @@ function itemOf(item, reasoningPreviewIds) {
|
|
|
77017
77043
|
exitCode: typeof item.exitCode == "number" ? item.exitCode : null
|
|
77018
77044
|
};
|
|
77019
77045
|
case "mcpToolCall":
|
|
77046
|
+
return {
|
|
77047
|
+
type: "toolExecution",
|
|
77048
|
+
itemId,
|
|
77049
|
+
toolName: String(item.tool ?? ""),
|
|
77050
|
+
namespace: String(item.server ?? ""),
|
|
77051
|
+
arguments: item.arguments ?? {},
|
|
77052
|
+
output: { content: [{ type: "text", text: mcpResultText(item) }] }
|
|
77053
|
+
};
|
|
77054
|
+
case "webSearch":
|
|
77055
|
+
return {
|
|
77056
|
+
type: "toolExecution",
|
|
77057
|
+
itemId,
|
|
77058
|
+
toolName: "web_search",
|
|
77059
|
+
arguments: { query: String(item.query ?? "") }
|
|
77060
|
+
};
|
|
77020
77061
|
case "dynamicToolCall":
|
|
77021
77062
|
return {
|
|
77022
77063
|
type: "toolExecution",
|
|
@@ -77309,7 +77350,7 @@ var ChThreadView = class _ChThreadView {
|
|
|
77309
77350
|
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);
|
|
77310
77351
|
}
|
|
77311
77352
|
view.items.set(item.id, projected);
|
|
77312
|
-
let itemOutcome = item.status === "completed" ? { status: "succeeded" } : item.status === "failed" ? {
|
|
77353
|
+
let itemOutcome = item.status === "completed" || item.type === "webSearch" ? { status: "succeeded" } : item.status === "failed" ? {
|
|
77313
77354
|
status: "failed",
|
|
77314
77355
|
error: {
|
|
77315
77356
|
code: "nativeFailed",
|
|
@@ -78618,11 +78659,11 @@ var WebFiles = class {
|
|
|
78618
78659
|
try {
|
|
78619
78660
|
if (realpathSync4.native(path8) !== join12(folder, name2) || lstatSync2(path8).isSymbolicLink())
|
|
78620
78661
|
return;
|
|
78621
|
-
let
|
|
78622
|
-
return !
|
|
78662
|
+
let stat10 = lstatSync2(path8);
|
|
78663
|
+
return !stat10.isFile() || !Number.isSafeInteger(stat10.size) ? void 0 : {
|
|
78623
78664
|
attachmentId: `web-file:${basename6(folder)}/${encodeURIComponent(name2)}`,
|
|
78624
78665
|
name: name2,
|
|
78625
|
-
bytes:
|
|
78666
|
+
bytes: stat10.size
|
|
78626
78667
|
};
|
|
78627
78668
|
} catch {
|
|
78628
78669
|
return;
|
|
@@ -79972,14 +80013,14 @@ var ChSessions = class {
|
|
|
79972
80013
|
"Remote connections cannot open Host files."
|
|
79973
80014
|
);
|
|
79974
80015
|
let request3 = requestOf(args);
|
|
79975
|
-
if (request3.action !== void 0 || request3.application !== void 0)
|
|
80016
|
+
if (request3.action !== void 0 && request3.action !== "reveal" || request3.application !== void 0)
|
|
79976
80017
|
throw new SessionRuntimeError(
|
|
79977
80018
|
"session/open-unavailable",
|
|
79978
80019
|
"Only the system default application is supported."
|
|
79979
80020
|
);
|
|
79980
80021
|
if (!this.openFile)
|
|
79981
80022
|
throw new SessionRuntimeError("session/open-unavailable", "The native launcher is unavailable.");
|
|
79982
|
-
return this.openFile(request3.path);
|
|
80023
|
+
return this.openFile(request3.path, request3.action);
|
|
79983
80024
|
});
|
|
79984
80025
|
for (let [method2, archived] of [
|
|
79985
80026
|
["workspace/archiveSession", !0],
|
|
@@ -80877,8 +80918,8 @@ async function discoverHostClientChannel(directory) {
|
|
|
80877
80918
|
try {
|
|
80878
80919
|
let handle = await open3(path6.join(directory, name2), constants6.O_RDONLY | (constants6.O_NOFOLLOW ?? 0));
|
|
80879
80920
|
try {
|
|
80880
|
-
let
|
|
80881
|
-
if (!
|
|
80921
|
+
let stat10 = await handle.stat();
|
|
80922
|
+
if (!stat10.isFile() || stat10.size > 4096 || process.platform !== "win32" && (stat10.uid !== process.getuid?.() || (stat10.mode & 63) !== 0))
|
|
80882
80923
|
continue;
|
|
80883
80924
|
let descriptor = clientChannelDescriptorSchema.parse(JSON.parse(await handle.readFile("utf8")));
|
|
80884
80925
|
process.kill(descriptor.pid, 0), candidates.push(descriptor);
|
|
@@ -82802,7 +82843,7 @@ async function installRendererLoadedModules(renderer) {
|
|
|
82802
82843
|
contexts.clear(), contextIds.clear(), dirty.clear();
|
|
82803
82844
|
};
|
|
82804
82845
|
try {
|
|
82805
|
-
return await renderer.command("Runtime.enable"), await renderer.command("Debugger.enable"), ready = !0, await flush(), dispose;
|
|
82846
|
+
return await renderer.command("Runtime.enable"), await renderer.command("Debugger.enable", { maxScriptsCacheSize: 0 }), ready = !0, await flush(), dispose;
|
|
82806
82847
|
} catch (error51) {
|
|
82807
82848
|
throw dispose(), error51;
|
|
82808
82849
|
}
|
|
@@ -84145,8 +84186,8 @@ async function readRemoteProjectMetadata(file2 = join14(process.env.CODEX_HOME ?
|
|
|
84145
84186
|
if (!handle)
|
|
84146
84187
|
return [];
|
|
84147
84188
|
try {
|
|
84148
|
-
let
|
|
84149
|
-
if (!
|
|
84189
|
+
let stat10 = await handle.stat();
|
|
84190
|
+
if (!stat10.isFile() || stat10.size > 32 * 1024 * 1024)
|
|
84150
84191
|
throw new Error("Invalid Desktop project metadata");
|
|
84151
84192
|
let text3 = await handle.readFile("utf8");
|
|
84152
84193
|
if (Buffer.byteLength(text3) > 32 * 1024 * 1024)
|
|
@@ -84269,8 +84310,8 @@ async function requestRemoteSession(operation, path8 = remoteSessionDescriptorPa
|
|
|
84269
84310
|
return result;
|
|
84270
84311
|
}
|
|
84271
84312
|
async function readDescriptor(path8) {
|
|
84272
|
-
let
|
|
84273
|
-
if (!
|
|
84313
|
+
let stat10 = await lstat3(path8);
|
|
84314
|
+
if (!stat10.isFile() || stat10.size > 4096 || process.platform !== "win32" && (stat10.uid !== process.getuid?.() || (stat10.mode & 63) !== 0))
|
|
84274
84315
|
throw new Error("Desktop runtime descriptor is not a private owned file");
|
|
84275
84316
|
let value = JSON.parse(await readFile4(path8, "utf8"));
|
|
84276
84317
|
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))
|
|
@@ -84974,7 +85015,7 @@ var RemoteSessions = class {
|
|
|
84974
85015
|
try {
|
|
84975
85016
|
return await this.call(parsed.data);
|
|
84976
85017
|
} catch (error51) {
|
|
84977
|
-
let write = !["hosts", "list", "read", "status"].includes(operation.kind);
|
|
85018
|
+
let write = !["hosts", "list", "read", "status", "usage"].includes(operation.kind);
|
|
84978
85019
|
throw !write && error51 instanceof RemoteSessionError && ![-32090, -32093].includes(error51.code) ? new SessionRuntimeError(
|
|
84979
85020
|
error51.code === -32094 ? "remote/history-too-large" : error51.code === -32095 ? "remote/connection-changed" : error51.code === -32096 ? "remote/controller-rejected" : "remote/read-failed",
|
|
84980
85021
|
error51.message
|
|
@@ -85130,7 +85171,7 @@ var RemoteSessions = class {
|
|
|
85130
85171
|
}
|
|
85131
85172
|
offline(entry) {
|
|
85132
85173
|
let changed = entry.online;
|
|
85133
|
-
entry.online = !1;
|
|
85174
|
+
entry.online = !1, changed && delete entry.usageRequest;
|
|
85134
85175
|
let id = remoteSessionId(entry.identity.hostId, entry.identity.threadId);
|
|
85135
85176
|
this.clearPending(id), changed && !this.closed && this.events.emit("api-session/added", this.summary(id, entry)), entry.view?.log.setProjection("nativeConnection", {
|
|
85136
85177
|
state: "reconnecting",
|
|
@@ -85203,7 +85244,7 @@ var RemoteSessions = class {
|
|
|
85203
85244
|
"harnessIdentity",
|
|
85204
85245
|
"remoteHistoryError"
|
|
85205
85246
|
].includes(key) && current.view.log.setProjection(key, value);
|
|
85206
|
-
current.view.log.setProjection("harnessIdentity", remoteHarnessIdentity(current) ?? null), applyRemoteControls(current, current.view), this.interactions(id, current, snapshot.requests), (snapshot.interactionsAvailable === !1 || snapshot.requests.some(
|
|
85247
|
+
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(
|
|
85207
85248
|
(request3) => ![
|
|
85208
85249
|
"item/commandExecution/requestApproval",
|
|
85209
85250
|
"item/fileChange/requestApproval"
|
|
@@ -85224,8 +85265,23 @@ var RemoteSessions = class {
|
|
|
85224
85265
|
delete current.reading;
|
|
85225
85266
|
}), current.reading;
|
|
85226
85267
|
}
|
|
85268
|
+
loadUsage(id, entry, view, epoch) {
|
|
85269
|
+
let updatedAt = view.thread.updatedAt, lastTurnId = view.thread.turns.at(-1)?.id, previous = entry.usageRequest;
|
|
85270
|
+
if (previous?.view === view && (previous.pending || previous.updatedAt === updatedAt && previous.lastTurnId === lastTurnId && Date.now() < previous.retryAt))
|
|
85271
|
+
return;
|
|
85272
|
+
let request3 = { view, updatedAt, lastTurnId, retryAt: 0, pending: !0 };
|
|
85273
|
+
entry.usageRequest = request3;
|
|
85274
|
+
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;
|
|
85275
|
+
this.invoke({ kind: "usage", ...entry.identity, epoch }).then((raw) => {
|
|
85276
|
+
let parsed = threadUsageInspectionSchema.safeParse(raw);
|
|
85277
|
+
parsed.success && parsed.data.threadId === entry.identity.threadId && isCurrent() && matchesHistory() && applyUsageProjections(view.log, parsed.data);
|
|
85278
|
+
}).catch(() => {
|
|
85279
|
+
}).finally(() => {
|
|
85280
|
+
request3.pending = !1, request3.retryAt = Date.now() + 3e4, isCurrent() && !matchesHistory() && this.loadUsage(id, entry, view, epoch);
|
|
85281
|
+
});
|
|
85282
|
+
}
|
|
85227
85283
|
retireView(entry) {
|
|
85228
|
-
entry.view && (entry.viewOrigin = entry.view.log.lastSeq + 1, entry.view.retire(), entry.view.log.reconnectFollowers(), delete entry.view, delete entry.viewHarnessId);
|
|
85284
|
+
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);
|
|
85229
85285
|
}
|
|
85230
85286
|
createView(row, harnessId, origin = 0) {
|
|
85231
85287
|
let view = new ChThreadView(
|
|
@@ -85522,7 +85578,7 @@ async function serveChClientGateway(host, request3, response) {
|
|
|
85522
85578
|
}
|
|
85523
85579
|
|
|
85524
85580
|
// apps/web-ui/packages/host/dsh-web-backend/src/index.ts
|
|
85525
|
-
import { stat as
|
|
85581
|
+
import { stat as stat8 } from "node:fs/promises";
|
|
85526
85582
|
|
|
85527
85583
|
// apps/web-ui/packages/host/dsh-web-backend/src/plugin-runtime.ts
|
|
85528
85584
|
import { Service as Service2 } from "@deepseek-ai/cordis";
|
|
@@ -88718,7 +88774,7 @@ var WorkspaceChangeFeed = class {
|
|
|
88718
88774
|
throw error51;
|
|
88719
88775
|
});
|
|
88720
88776
|
if (target2 === void 0 || aborted2()) return;
|
|
88721
|
-
let
|
|
88777
|
+
let stat10 = async () => {
|
|
88722
88778
|
let info = await this.ctx.fs.stat(target2, signal).catch((error51) => {
|
|
88723
88779
|
if (!aborted2())
|
|
88724
88780
|
throw error51;
|
|
@@ -88731,7 +88787,7 @@ var WorkspaceChangeFeed = class {
|
|
|
88731
88787
|
);
|
|
88732
88788
|
return info;
|
|
88733
88789
|
};
|
|
88734
|
-
if (await
|
|
88790
|
+
if (await stat10(), aborted2()) return;
|
|
88735
88791
|
try {
|
|
88736
88792
|
if (unwatch = await this.ctx.fs.watch(
|
|
88737
88793
|
target2,
|
|
@@ -88753,7 +88809,7 @@ var WorkspaceChangeFeed = class {
|
|
|
88753
88809
|
yield { kind: "ready" };
|
|
88754
88810
|
for await (let [observed] of follower.read()) {
|
|
88755
88811
|
if (observed.targetKey !== target2.targetKey) continue;
|
|
88756
|
-
let info = await
|
|
88812
|
+
let info = await stat10();
|
|
88757
88813
|
if (aborted2()) return;
|
|
88758
88814
|
let absolutePath = this.ctx.fs.processPath(target2);
|
|
88759
88815
|
yield {
|
|
@@ -89894,12 +89950,12 @@ import { once as once2 } from "node:events";
|
|
|
89894
89950
|
|
|
89895
89951
|
// node_modules/chokidar/esm/index.js
|
|
89896
89952
|
import { stat as statcb } from "fs";
|
|
89897
|
-
import { stat as
|
|
89953
|
+
import { stat as stat5, readdir as readdir5 } from "fs/promises";
|
|
89898
89954
|
import { EventEmitter } from "events";
|
|
89899
89955
|
import * as sysPath2 from "path";
|
|
89900
89956
|
|
|
89901
89957
|
// node_modules/readdirp/esm/index.js
|
|
89902
|
-
import { stat as
|
|
89958
|
+
import { stat as stat3, lstat as lstat4, readdir as readdir4, realpath as realpath4 } from "node:fs/promises";
|
|
89903
89959
|
import { Readable as Readable2 } from "node:stream";
|
|
89904
89960
|
import { resolve as presolve, relative as prelative, join as pjoin, sep as psep } from "node:path";
|
|
89905
89961
|
var EntryTypes = {
|
|
@@ -89954,7 +90010,7 @@ var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR", NORMAL_FLOW_ERRORS = /* @
|
|
|
89954
90010
|
});
|
|
89955
90011
|
let opts = { ...defaultOptions, ...options }, { root, type: type2 } = opts;
|
|
89956
90012
|
this._fileFilter = normalizeFilter(opts.fileFilter), this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
89957
|
-
let statMethod = opts.lstat ? lstat4 :
|
|
90013
|
+
let statMethod = opts.lstat ? lstat4 : stat3;
|
|
89958
90014
|
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;
|
|
89959
90015
|
}
|
|
89960
90016
|
async _read(batch) {
|
|
@@ -90058,7 +90114,7 @@ function readdirp(root, options = {}) {
|
|
|
90058
90114
|
|
|
90059
90115
|
// node_modules/chokidar/esm/handler.js
|
|
90060
90116
|
import { watchFile, unwatchFile, watch as fs_watch } from "fs";
|
|
90061
|
-
import { open as open5, stat as
|
|
90117
|
+
import { open as open5, stat as stat4, lstat as lstat5, realpath as fsrealpath } from "fs/promises";
|
|
90062
90118
|
import * as sysPath from "path";
|
|
90063
90119
|
import { type as osType } from "os";
|
|
90064
90120
|
var STR_DATA = "data", STR_END = "end", STR_CLOSE = "close", EMPTY_FN = () => {
|
|
@@ -90073,7 +90129,7 @@ var pl = process.platform, isWindows = pl === "win32", isMacos = pl === "darwin"
|
|
|
90073
90129
|
UNLINK_DIR: "unlinkDir",
|
|
90074
90130
|
RAW: "raw",
|
|
90075
90131
|
ERROR: "error"
|
|
90076
|
-
}, EV = EVENTS, THROTTLE_MODE_WATCH = "watch", statMethods = { lstat: lstat5, stat:
|
|
90132
|
+
}, 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([
|
|
90077
90133
|
"3dm",
|
|
90078
90134
|
"3ds",
|
|
90079
90135
|
"3g2",
|
|
@@ -90462,7 +90518,7 @@ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
|
|
|
90462
90518
|
if (this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5)) {
|
|
90463
90519
|
if (!newStats || newStats.mtimeMs === 0)
|
|
90464
90520
|
try {
|
|
90465
|
-
let newStats2 = await
|
|
90521
|
+
let newStats2 = await stat4(file2);
|
|
90466
90522
|
if (this.fsw.closed)
|
|
90467
90523
|
return;
|
|
90468
90524
|
let at = newStats2.atimeMs, mt = newStats2.mtimeMs;
|
|
@@ -90873,7 +90929,7 @@ var unifyPaths = (paths_) => {
|
|
|
90873
90929
|
if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
|
|
90874
90930
|
let fullPath = opts.cwd ? sysPath2.join(opts.cwd, path8) : path8, stats2;
|
|
90875
90931
|
try {
|
|
90876
|
-
stats2 = await
|
|
90932
|
+
stats2 = await stat5(fullPath);
|
|
90877
90933
|
} catch {
|
|
90878
90934
|
}
|
|
90879
90935
|
if (!stats2 || this.closed)
|
|
@@ -90960,8 +91016,8 @@ var unifyPaths = (paths_) => {
|
|
|
90960
91016
|
}
|
|
90961
91017
|
return this._userIgnored(path8, stats);
|
|
90962
91018
|
}
|
|
90963
|
-
_isntIgnored(path8,
|
|
90964
|
-
return !this._isIgnored(path8,
|
|
91019
|
+
_isntIgnored(path8, stat10) {
|
|
91020
|
+
return !this._isIgnored(path8, stat10);
|
|
90965
91021
|
}
|
|
90966
91022
|
/**
|
|
90967
91023
|
* Provides a set of common helpers and properties relating to symlink handling.
|
|
@@ -92697,7 +92753,7 @@ import {
|
|
|
92697
92753
|
readdir as readdir6,
|
|
92698
92754
|
rename as rename3,
|
|
92699
92755
|
rm as rm4,
|
|
92700
|
-
stat as
|
|
92756
|
+
stat as stat6
|
|
92701
92757
|
} from "node:fs/promises";
|
|
92702
92758
|
import { basename as basename10, dirname as dirname11, isAbsolute as isAbsolute14, join as join20, resolve as resolve15, sep as sep7 } from "node:path";
|
|
92703
92759
|
import { TextDecoder as TextDecoder2, promisify as promisify6 } from "node:util";
|
|
@@ -92830,7 +92886,7 @@ async function resolveLocalTarget(cwd, path8) {
|
|
|
92830
92886
|
`cannot resolve "${displayPath}": parent traversal crosses a missing directory`,
|
|
92831
92887
|
"FS_NOT_FOUND"
|
|
92832
92888
|
);
|
|
92833
|
-
if (process.platform === "win32" && !(await
|
|
92889
|
+
if (process.platform === "win32" && !(await stat6(realAncestor)).isDirectory())
|
|
92834
92890
|
throw new FsError(
|
|
92835
92891
|
`cannot resolve "${displayPath}": a parent path segment is not a directory`,
|
|
92836
92892
|
"FS_NOT_FOUND"
|
|
@@ -92858,7 +92914,7 @@ async function probeStats(absolutePath, readStats) {
|
|
|
92858
92914
|
}
|
|
92859
92915
|
}
|
|
92860
92916
|
async function probe(absolutePath) {
|
|
92861
|
-
let info = await probeStats(absolutePath, (path8) =>
|
|
92917
|
+
let info = await probeStats(absolutePath, (path8) => stat6(path8, { bigint: !0 }));
|
|
92862
92918
|
return info ? {
|
|
92863
92919
|
version: versionOf(info),
|
|
92864
92920
|
mode: Number(info.mode & 0o777n),
|
|
@@ -92944,7 +93000,7 @@ async function statRegularFile(target2, verb, signal) {
|
|
|
92944
93000
|
throwIfAborted(signal, verb);
|
|
92945
93001
|
let info;
|
|
92946
93002
|
try {
|
|
92947
|
-
info = await
|
|
93003
|
+
info = await stat6(target2.targetKey);
|
|
92948
93004
|
} catch (error51) {
|
|
92949
93005
|
throw isENOENT(error51) ? new FsError(`cannot ${verb} "${target2.displayPath}": not found`, "FS_NOT_FOUND") : error51;
|
|
92950
93006
|
}
|
|
@@ -97130,7 +97186,7 @@ var _deepseek_ai_dsh_api_terminal_controller_terminal_attach_parameter_0$schema$
|
|
|
97130
97186
|
|
|
97131
97187
|
// apps/web-ui/packages/subprocess/subprocess-local/src/index.ts
|
|
97132
97188
|
import { constants as constants9 } from "node:fs";
|
|
97133
|
-
import { access, stat as
|
|
97189
|
+
import { access, stat as stat7 } from "node:fs/promises";
|
|
97134
97190
|
import { userInfo } from "node:os";
|
|
97135
97191
|
import { delimiter, extname as extname6, isAbsolute as isAbsolute19, resolve as resolve17 } from "node:path";
|
|
97136
97192
|
|
|
@@ -97456,8 +97512,8 @@ function linuxProcessGroupHasLiveMembers(processGroupId, internals = DEFAULT_INT
|
|
|
97456
97512
|
let matched = !1;
|
|
97457
97513
|
for (let entry of entries) {
|
|
97458
97514
|
if (!/^\d+$/.test(entry)) continue;
|
|
97459
|
-
let
|
|
97460
|
-
if (
|
|
97515
|
+
let stat10 = readLinuxStat(internals, Number(entry));
|
|
97516
|
+
if (stat10?.pgrp === processGroupId && (matched = !0, !/^[ZXx]$/.test(stat10.state)))
|
|
97461
97517
|
return !0;
|
|
97462
97518
|
}
|
|
97463
97519
|
return matched ? !1 : void 0;
|
|
@@ -97616,22 +97672,22 @@ var LinuxProcessInspector = class extends PosixProcessInspector {
|
|
|
97616
97672
|
return !1;
|
|
97617
97673
|
}
|
|
97618
97674
|
isAlive(identity2) {
|
|
97619
|
-
let
|
|
97620
|
-
return
|
|
97675
|
+
let stat10 = readLinuxStat(this.internals, identity2.pid);
|
|
97676
|
+
return stat10?.started === identity2.started && !quiescent(stat10.state);
|
|
97621
97677
|
}
|
|
97622
97678
|
snapshot() {
|
|
97623
97679
|
let pids = numericEntries(this.internals, "/proc");
|
|
97624
97680
|
if (pids === void 0)
|
|
97625
97681
|
throw new Error("Cannot inspect processes: /proc directory is unreadable");
|
|
97626
97682
|
let complete = !0, rows = pids.flatMap((pid) => {
|
|
97627
|
-
let
|
|
97628
|
-
return
|
|
97683
|
+
let stat10 = readLinuxStat(this.internals, pid);
|
|
97684
|
+
return stat10 === void 0 && (complete = !1), stat10 === void 0 ? [] : [
|
|
97629
97685
|
{
|
|
97630
97686
|
pid,
|
|
97631
|
-
parentPid:
|
|
97632
|
-
started:
|
|
97633
|
-
session:
|
|
97634
|
-
state:
|
|
97687
|
+
parentPid: stat10.parentPid,
|
|
97688
|
+
started: stat10.started,
|
|
97689
|
+
session: stat10.session,
|
|
97690
|
+
state: stat10.state
|
|
97635
97691
|
}
|
|
97636
97692
|
];
|
|
97637
97693
|
});
|
|
@@ -99720,7 +99776,7 @@ var requireNodePty = createLazyRequire("node-pty", import.meta.url), LocalSubpro
|
|
|
99720
99776
|
for (let candidate of candidates) {
|
|
99721
99777
|
signal?.throwIfAborted();
|
|
99722
99778
|
try {
|
|
99723
|
-
if (!(await
|
|
99779
|
+
if (!(await stat7(candidate)).isFile()) continue;
|
|
99724
99780
|
return await access(candidate, constants9.X_OK), signal?.throwIfAborted(), candidate;
|
|
99725
99781
|
} catch {
|
|
99726
99782
|
}
|
|
@@ -100361,7 +100417,7 @@ async function createDshWebBackend(options) {
|
|
|
100361
100417
|
async ensure(agent, signal) {
|
|
100362
100418
|
signal.throwIfAborted();
|
|
100363
100419
|
let cwd = this.get(agent.session);
|
|
100364
|
-
if (!(await
|
|
100420
|
+
if (!(await stat8(cwd)).isDirectory())
|
|
100365
100421
|
throw new Error("Terminal working directory is not a directory");
|
|
100366
100422
|
return signal.throwIfAborted(), cwd;
|
|
100367
100423
|
}
|
|
@@ -101536,8 +101592,8 @@ import { statSync as statSync11 } from "node:fs";
|
|
|
101536
101592
|
var SHELL_EVENTS_PATH = "/plugins/shell-events";
|
|
101537
101593
|
function statKey(path8) {
|
|
101538
101594
|
try {
|
|
101539
|
-
let
|
|
101540
|
-
return `${String(
|
|
101595
|
+
let stat10 = statSync11(path8);
|
|
101596
|
+
return `${String(stat10.mtimeMs)}:${String(stat10.ctimeMs)}:${String(stat10.size)}`;
|
|
101541
101597
|
} catch {
|
|
101542
101598
|
return;
|
|
101543
101599
|
}
|
|
@@ -101729,11 +101785,11 @@ function defaultWebDataDirectory(hostDataDirectory) {
|
|
|
101729
101785
|
|
|
101730
101786
|
// packages/web-server/src/packaged-host.ts
|
|
101731
101787
|
import { createHash as createHash12 } from "node:crypto";
|
|
101732
|
-
import { cp, mkdir as mkdir7, mkdtemp as mkdtemp3, readFile as readFile6, readdir as readdir8, rename as rename5, rm as rm8, stat as
|
|
101788
|
+
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";
|
|
101733
101789
|
import { join as join30 } from "node:path";
|
|
101734
101790
|
async function hashDirectory(root, hash3, relative11 = "") {
|
|
101735
101791
|
for (let name2 of (await readdir8(join30(root, relative11))).sort()) {
|
|
101736
|
-
let file2 = join30(relative11, name2), metadata = await
|
|
101792
|
+
let file2 = join30(relative11, name2), metadata = await stat9(join30(root, file2));
|
|
101737
101793
|
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))));
|
|
101738
101794
|
}
|
|
101739
101795
|
}
|
|
@@ -101754,7 +101810,7 @@ async function snapshotPackagedHost(distribution, data2) {
|
|
|
101754
101810
|
try {
|
|
101755
101811
|
await rename5(staging, destination);
|
|
101756
101812
|
} catch (error51) {
|
|
101757
|
-
if (!(await
|
|
101813
|
+
if (!(await stat9(destination).catch(() => null))?.isDirectory()) throw error51;
|
|
101758
101814
|
}
|
|
101759
101815
|
return destination;
|
|
101760
101816
|
} finally {
|
|
@@ -101863,7 +101919,7 @@ var publicUrl = background ? background.publicUrl : values["public-url"] ?? proc
|
|
|
101863
101919
|
displayEntries,
|
|
101864
101920
|
preferences,
|
|
101865
101921
|
enabledHarnesses,
|
|
101866
|
-
(path8) => openWorkspaceFile(launcher, path8)
|
|
101922
|
+
(path8, action) => openWorkspaceFile(launcher, path8, action)
|
|
101867
101923
|
), dsh = await DshWebServices.open({
|
|
101868
101924
|
workspaceRoot: resolve21(values.workspace),
|
|
101869
101925
|
threadWorkspace: (id) => sessions.terminalWorkspaceRoot(id),
|
package/bin/codexhost
CHANGED
|
Binary file
|
package/libexec/codexhost-shim
CHANGED
|
Binary file
|
|
Binary file
|