@codexhost/cli-win32-arm64 0.26.1 → 0.28.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 +1010 -592
- package/app/console-web.js +1861 -1498
- package/app/desktop-controller.mjs +488 -245
- package/app/host-runtime.mjs +9177 -4006
- package/app/plugins/antigravity/plugin.mjs +9055 -548
- package/app/plugins/claude-code/plugin.mjs +1117 -423
- package/app/plugins/codebuddy/plugin.mjs +599 -261
- package/app/plugins/codex-usage/plugin.mjs +1808 -1357
- package/app/plugins/copilot/plugin.mjs +491 -235
- package/app/plugins/cursor-cli/plugin.mjs +487 -232
- package/app/plugins/deepseek-harness/plugin.mjs +493 -235
- package/app/plugins/devin/plugin.mjs +467 -232
- package/app/plugins/grok/plugin.mjs +547 -253
- package/app/plugins/hermes/plugin.mjs +468 -232
- package/app/plugins/kimi-code/plugin.mjs +762 -439
- package/app/plugins/kiro-cli/plugin.mjs +466 -232
- package/app/plugins/omp/plugin.mjs +1705 -1356
- package/app/plugins/opencode/manifest.json +1 -1
- package/app/plugins/opencode/plugin.mjs +544 -250
- package/app/plugins/pi/plugin.mjs +761 -364
- package/app/plugins/qoder/plugin.mjs +540 -246
- package/app/plugins/qoder-cn/plugin.mjs +540 -246
- package/app/plugins/qwen-code/plugin.mjs +466 -232
- package/app/plugins/workbuddy/plugin.mjs +594 -273
- package/app/plugins/zcode/plugin.mjs +468 -232
- package/app/renderer-extension.js +2653 -657
- package/app/web/assets/index-DBPgg32z.css +1 -0
- package/app/web/assets/index-DWxiVzuS.js +204 -0
- package/app/web/codexhost-settings.js +101 -66
- package/app/web/index.html +2 -2
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +65 -65
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +69 -69
- package/app/web/plugins/deepseek-ai__dsh-client-shortcuts/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-approval/client.js +4 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +75 -75
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +73 -73
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +19 -19
- package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +5 -5
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-shortcuts/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.pdf.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-right/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +4 -4
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +71 -71
- package/app/web/plugins.json +2 -1
- package/app/web-modules/server.mjs +5065 -1964
- package/bin/codexhost.exe +0 -0
- package/libexec/codexhost-node-repl.exe +0 -0
- package/libexec/codexhost-shell.exe +0 -0
- package/libexec/codexhost-shim.exe +0 -0
- package/libexec/codexhost-updater.exe +0 -0
- package/package.json +1 -1
- package/app/web/assets/index-CR4Y8Ndj.css +0 -1
- package/app/web/assets/index-Dw-yHAxN.js +0 -196
package/app/console-server.mjs
CHANGED
|
@@ -106,7 +106,7 @@ var require_polyfills = __commonJS({
|
|
|
106
106
|
}
|
|
107
107
|
if (platform === "win32") {
|
|
108
108
|
fs.rename = typeof fs.rename !== "function" ? fs.rename : (function(fs$rename) {
|
|
109
|
-
function
|
|
109
|
+
function rename4(from, to, cb) {
|
|
110
110
|
var start = Date.now();
|
|
111
111
|
var backoff = 0;
|
|
112
112
|
fs$rename(from, to, function CB(er) {
|
|
@@ -126,8 +126,8 @@ var require_polyfills = __commonJS({
|
|
|
126
126
|
if (cb) cb(er);
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
if (Object.setPrototypeOf) Object.setPrototypeOf(
|
|
130
|
-
return
|
|
129
|
+
if (Object.setPrototypeOf) Object.setPrototypeOf(rename4, fs$rename);
|
|
130
|
+
return rename4;
|
|
131
131
|
})(fs.rename);
|
|
132
132
|
}
|
|
133
133
|
fs.read = typeof fs.read !== "function" ? fs.read : (function(fs$read) {
|
|
@@ -1627,128 +1627,6 @@ import path2 from "node:path";
|
|
|
1627
1627
|
// packages/update-manager/dist/distribution.js
|
|
1628
1628
|
import path from "node:path";
|
|
1629
1629
|
|
|
1630
|
-
// packages/update-manager/dist/status.js
|
|
1631
|
-
var STATUS_SCHEMA_VERSION = 1;
|
|
1632
|
-
var SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/u;
|
|
1633
|
-
function requireSemanticVersion(value) {
|
|
1634
|
-
if (!SEMVER_PATTERN.test(value))
|
|
1635
|
-
throw new Error("update version must be valid semantic version");
|
|
1636
|
-
return value;
|
|
1637
|
-
}
|
|
1638
|
-
function preparedStatus(version2, installation, now) {
|
|
1639
|
-
return {
|
|
1640
|
-
schemaVersion: STATUS_SCHEMA_VERSION,
|
|
1641
|
-
version: version2,
|
|
1642
|
-
installation,
|
|
1643
|
-
phase: "prepared",
|
|
1644
|
-
updatedAt: Math.floor(now / 1e3)
|
|
1645
|
-
};
|
|
1646
|
-
}
|
|
1647
|
-
function parseUpdateStatus(value) {
|
|
1648
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
1649
|
-
throw new Error("background update status must be an object");
|
|
1650
|
-
}
|
|
1651
|
-
const status = value;
|
|
1652
|
-
const allowed = [
|
|
1653
|
-
"downloadedBytes",
|
|
1654
|
-
"error",
|
|
1655
|
-
"installation",
|
|
1656
|
-
"phase",
|
|
1657
|
-
"schemaVersion",
|
|
1658
|
-
"serviceStopOutput",
|
|
1659
|
-
"totalBytes",
|
|
1660
|
-
"updatedAt",
|
|
1661
|
-
"version"
|
|
1662
|
-
];
|
|
1663
|
-
if (Object.keys(status).some((key) => !allowed.includes(key))) {
|
|
1664
|
-
throw new Error("background update status contains unknown fields");
|
|
1665
|
-
}
|
|
1666
|
-
if (status.schemaVersion !== STATUS_SCHEMA_VERSION || typeof status.version !== "string" || !SEMVER_PATTERN.test(status.version) || !["npm", "windows-installer", "macos-dmg", "linux-archive"].includes(String(status.installation)) || ![
|
|
1667
|
-
"prepared",
|
|
1668
|
-
"downloading",
|
|
1669
|
-
"waiting-for-exit",
|
|
1670
|
-
"installing",
|
|
1671
|
-
"restarting",
|
|
1672
|
-
"succeeded",
|
|
1673
|
-
"failed"
|
|
1674
|
-
].includes(String(status.phase)) || !Number.isSafeInteger(status.updatedAt) || status.downloadedBytes !== void 0 && (typeof status.downloadedBytes !== "number" || !Number.isSafeInteger(status.downloadedBytes) || status.downloadedBytes < 0) || status.totalBytes !== void 0 && (typeof status.totalBytes !== "number" || !Number.isSafeInteger(status.totalBytes) || status.totalBytes <= 0) || typeof status.downloadedBytes === "number" && typeof status.totalBytes === "number" && status.downloadedBytes > status.totalBytes || status.error !== void 0 && typeof status.error !== "string" || status.serviceStopOutput !== void 0 && typeof status.serviceStopOutput !== "string") {
|
|
1675
|
-
throw new Error("background update status is invalid");
|
|
1676
|
-
}
|
|
1677
|
-
return status;
|
|
1678
|
-
}
|
|
1679
|
-
|
|
1680
|
-
// packages/update-manager/dist/distribution.js
|
|
1681
|
-
var UPDATE_RUNTIME_ENV = Object.freeze({
|
|
1682
|
-
launcherPid: "CODEXHOST_LAUNCHER_PID",
|
|
1683
|
-
launcherExecutable: "CODEXHOST_LAUNCHER_EXECUTABLE",
|
|
1684
|
-
runtimeDescriptorPath: "CODEXHOST_RUNTIME_DESCRIPTOR_PATH",
|
|
1685
|
-
controllerPort: "CODEXHOST_CONTROL_PORT",
|
|
1686
|
-
controllerNonce: "CODEXHOST_CONTROL_NONCE",
|
|
1687
|
-
npmNodePath: "CODEXHOST_NPM_NODE_PATH",
|
|
1688
|
-
npmCliPath: "CODEXHOST_NPM_CLI_PATH",
|
|
1689
|
-
npmLauncherPath: "CODEXHOST_NPM_LAUNCHER_PATH",
|
|
1690
|
-
npmPackageRoot: "CODEXHOST_NPM_PACKAGE_ROOT",
|
|
1691
|
-
serviceManaged: "CODEXHOST_UPDATE_SERVICE"
|
|
1692
|
-
});
|
|
1693
|
-
function object(value, label) {
|
|
1694
|
-
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
1695
|
-
throw new Error(`${label} must be an object`);
|
|
1696
|
-
}
|
|
1697
|
-
return value;
|
|
1698
|
-
}
|
|
1699
|
-
function parseDistributionMetadata(value) {
|
|
1700
|
-
const metadata = object(value, "distribution metadata");
|
|
1701
|
-
const allowed = ["distribution", "schemaVersion", "target", "version"];
|
|
1702
|
-
if (Object.keys(metadata).some((key) => !allowed.includes(key))) {
|
|
1703
|
-
throw new Error("distribution metadata contains unknown fields");
|
|
1704
|
-
}
|
|
1705
|
-
if (metadata.schemaVersion !== 1 || metadata.distribution !== "npm" && metadata.distribution !== "installer" || ![
|
|
1706
|
-
"macos-arm64",
|
|
1707
|
-
"macos-x64",
|
|
1708
|
-
"windows-x64",
|
|
1709
|
-
"windows-arm64",
|
|
1710
|
-
"linux-x64",
|
|
1711
|
-
"linux-arm64"
|
|
1712
|
-
].includes(String(metadata.target)) || typeof metadata.version !== "string") {
|
|
1713
|
-
throw new Error("distribution metadata is invalid");
|
|
1714
|
-
}
|
|
1715
|
-
return {
|
|
1716
|
-
schemaVersion: 1,
|
|
1717
|
-
version: requireSemanticVersion(metadata.version),
|
|
1718
|
-
distribution: metadata.distribution,
|
|
1719
|
-
target: metadata.target
|
|
1720
|
-
};
|
|
1721
|
-
}
|
|
1722
|
-
function defaultUpdateStateDirectory(platform = process.platform, environment = process.env) {
|
|
1723
|
-
if (platform === "win32") {
|
|
1724
|
-
const root = environment.LOCALAPPDATA;
|
|
1725
|
-
if (!root || !path.isAbsolute(root))
|
|
1726
|
-
throw new Error("LOCALAPPDATA is unavailable");
|
|
1727
|
-
return path.join(root, "codexhost", "updates");
|
|
1728
|
-
}
|
|
1729
|
-
const home = environment.HOME;
|
|
1730
|
-
if (!home || !path.isAbsolute(home))
|
|
1731
|
-
throw new Error("HOME is unavailable");
|
|
1732
|
-
return platform === "darwin" ? path.join(home, "Library", "Application Support", "codexhost", "updates") : path.join(home, ".codexhost", "updates");
|
|
1733
|
-
}
|
|
1734
|
-
|
|
1735
|
-
// packages/update-manager/dist/runtime-metadata.js
|
|
1736
|
-
async function readRuntimeMetadata(entryPath2, environment = process.env) {
|
|
1737
|
-
const directory = path2.dirname(entryPath2);
|
|
1738
|
-
try {
|
|
1739
|
-
return parseDistributionMetadata(JSON.parse(await readFile(path2.join(directory, "codexhost-distribution.json"), "utf8")));
|
|
1740
|
-
} catch (error62) {
|
|
1741
|
-
if (path2.basename(directory) !== "dist" || path2.basename(path2.resolve(directory, "../..")) !== "packages")
|
|
1742
|
-
throw error62;
|
|
1743
|
-
const workspace = JSON.parse(await readFile(path2.resolve(directory, "../../../package.json"), "utf8"));
|
|
1744
|
-
if (workspace.name !== "codexhost" || typeof workspace.version !== "string")
|
|
1745
|
-
throw error62;
|
|
1746
|
-
const workspaceVersion = requireSemanticVersion(workspace.version);
|
|
1747
|
-
const version2 = environment.CODEXHOST_DEV_VERSION === void 0 ? `${workspaceVersion}-dev` : requireSemanticVersion(environment.CODEXHOST_DEV_VERSION);
|
|
1748
|
-
return { version: version2, distribution: "development" };
|
|
1749
|
-
}
|
|
1750
|
-
}
|
|
1751
|
-
|
|
1752
1630
|
// node_modules/zod/v4/classic/external.js
|
|
1753
1631
|
var external_exports = {};
|
|
1754
1632
|
__export(external_exports, {
|
|
@@ -1943,7 +1821,7 @@ __export(external_exports, {
|
|
|
1943
1821
|
nullable: () => nullable,
|
|
1944
1822
|
nullish: () => nullish2,
|
|
1945
1823
|
number: () => number2,
|
|
1946
|
-
object: () =>
|
|
1824
|
+
object: () => object,
|
|
1947
1825
|
optional: () => optional,
|
|
1948
1826
|
output: () => output,
|
|
1949
1827
|
overwrite: () => _overwrite,
|
|
@@ -18863,7 +18741,7 @@ __export(schemas_exports2, {
|
|
|
18863
18741
|
nullable: () => nullable,
|
|
18864
18742
|
nullish: () => nullish2,
|
|
18865
18743
|
number: () => number2,
|
|
18866
|
-
object: () =>
|
|
18744
|
+
object: () => object,
|
|
18867
18745
|
optional: () => optional,
|
|
18868
18746
|
partialRecord: () => partialRecord,
|
|
18869
18747
|
pipe: () => pipe,
|
|
@@ -19857,7 +19735,7 @@ var ZodObject = /* @__PURE__ */ $constructor("ZodObject", (inst, def) => {
|
|
|
19857
19735
|
return util_exports.required(ZodNonOptional, this, args[0]);
|
|
19858
19736
|
}
|
|
19859
19737
|
});
|
|
19860
|
-
function
|
|
19738
|
+
function object(shape, params) {
|
|
19861
19739
|
const def = {
|
|
19862
19740
|
type: "object",
|
|
19863
19741
|
shape: shape ?? {},
|
|
@@ -21602,6 +21480,38 @@ var threadPermissionModeSelectParamsSchema = external_exports.object({
|
|
|
21602
21480
|
// packages/shared-contracts/dist/harness-route-limit.js
|
|
21603
21481
|
var HARNESS_TRANSPORT_MODEL_ID_MAX_LENGTH = 8192;
|
|
21604
21482
|
|
|
21483
|
+
// packages/shared-contracts/dist/thread-handoff.js
|
|
21484
|
+
var nonBlankTextSchema2 = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
21485
|
+
message: "Value must not be empty or whitespace"
|
|
21486
|
+
});
|
|
21487
|
+
var THREAD_HANDOFF_METHOD = "codexhost/thread/handoff";
|
|
21488
|
+
var threadHandoffParamsSchema = external_exports.object({
|
|
21489
|
+
sourceThreadId: hostThreadIdSchema,
|
|
21490
|
+
lastTurnId: hostTurnIdSchema.optional(),
|
|
21491
|
+
targetHarnessId: harnessIdSchema,
|
|
21492
|
+
targetModel: nonBlankTextSchema2.max(1024).optional(),
|
|
21493
|
+
targetThinkingOptionId: nonBlankTextSchema2.max(128).regex(/^[A-Za-z0-9._~-]+$/u, "Thinking option ID must use transport-safe characters").optional()
|
|
21494
|
+
}).strict();
|
|
21495
|
+
var threadHandoffMetadataSchema = external_exports.object({
|
|
21496
|
+
sourceThreadId: hostThreadIdSchema,
|
|
21497
|
+
sourceHarnessId: harnessIdSchema,
|
|
21498
|
+
sourceHarnessLabel: nonBlankTextSchema2.max(256).optional(),
|
|
21499
|
+
sourceModel: nonBlankTextSchema2.max(1024).optional(),
|
|
21500
|
+
targetHarnessId: harnessIdSchema,
|
|
21501
|
+
targetHarnessLabel: nonBlankTextSchema2.max(256).optional(),
|
|
21502
|
+
targetModel: nonBlankTextSchema2.max(1024).optional(),
|
|
21503
|
+
totalTurns: external_exports.number().int().min(1),
|
|
21504
|
+
boundaryTurnNumber: external_exports.number().int().min(1),
|
|
21505
|
+
includedTurnNumbers: external_exports.array(external_exports.number().int().min(1)),
|
|
21506
|
+
omittedTurns: external_exports.number().int().min(0),
|
|
21507
|
+
preview: external_exports.string().max(32e3),
|
|
21508
|
+
createdAtMs: external_exports.number().int().nonnegative()
|
|
21509
|
+
}).strict();
|
|
21510
|
+
var threadHandoffResultSchema = external_exports.object({
|
|
21511
|
+
threadId: hostThreadIdSchema,
|
|
21512
|
+
handoff: threadHandoffMetadataSchema
|
|
21513
|
+
}).strict();
|
|
21514
|
+
|
|
21605
21515
|
// packages/shared-contracts/dist/thread-usage.js
|
|
21606
21516
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
21607
21517
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
@@ -21785,7 +21695,7 @@ var HARNESS_MODEL_REF_MAX_LENGTH = 512;
|
|
|
21785
21695
|
var HARNESS_MODEL_LABEL_MAX_LENGTH = 256;
|
|
21786
21696
|
var HARNESS_THINKING_OPTION_ID_MAX_LENGTH = 128;
|
|
21787
21697
|
var THREAD_OWNERSHIP_LIST_MAX_LENGTH = 100;
|
|
21788
|
-
var
|
|
21698
|
+
var nonBlankTextSchema3 = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
21789
21699
|
message: "Value must not be empty or whitespace"
|
|
21790
21700
|
});
|
|
21791
21701
|
var harnessModelRefIdSchema = external_exports.string().min(1).max(HARNESS_MODEL_REF_MAX_LENGTH).refine((id2) => !new RegExp("\\p{Cc}", "u").test(id2), "Model Ref must not contain control characters").brand();
|
|
@@ -21797,15 +21707,15 @@ var harnessModelRefSchema = external_exports.object({
|
|
|
21797
21707
|
function sameHarnessModelRef(left, right) {
|
|
21798
21708
|
return left?.id === right?.id && left?.serviceTier === right?.serviceTier;
|
|
21799
21709
|
}
|
|
21800
|
-
var harnessThinkingOptionIdSchema =
|
|
21801
|
-
var harnessResolvedModelLabelSchema =
|
|
21710
|
+
var harnessThinkingOptionIdSchema = nonBlankTextSchema3.max(HARNESS_THINKING_OPTION_ID_MAX_LENGTH).regex(/^[A-Za-z0-9._~-]+$/u, "Thinking option ID must use transport-safe characters").brand();
|
|
21711
|
+
var harnessResolvedModelLabelSchema = nonBlankTextSchema3.max(HARNESS_MODEL_LABEL_MAX_LENGTH);
|
|
21802
21712
|
var harnessThinkingOptionSchema = external_exports.object({
|
|
21803
21713
|
id: harnessThinkingOptionIdSchema,
|
|
21804
|
-
label:
|
|
21714
|
+
label: nonBlankTextSchema3.max(HARNESS_MODEL_LABEL_MAX_LENGTH)
|
|
21805
21715
|
}).strict();
|
|
21806
21716
|
var harnessModelSchema = external_exports.object({
|
|
21807
21717
|
ref: harnessModelRefSchema,
|
|
21808
|
-
label:
|
|
21718
|
+
label: nonBlankTextSchema3.max(HARNESS_MODEL_LABEL_MAX_LENGTH),
|
|
21809
21719
|
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
21810
21720
|
/** Optional opaque selection for this same Model with priority processing enabled. */
|
|
21811
21721
|
fastModel: harnessModelRefSchema.optional(),
|
|
@@ -21832,11 +21742,21 @@ var harnessThinkingOptionsSchema = external_exports.array(harnessThinkingOptionS
|
|
|
21832
21742
|
ids.add(option.id);
|
|
21833
21743
|
}
|
|
21834
21744
|
});
|
|
21745
|
+
var harnessThinkingOptionsScopeSchema = external_exports.enum(["catalog", "activeModel"]);
|
|
21835
21746
|
var harnessModelCatalogSchema = external_exports.object({
|
|
21836
21747
|
models: external_exports.array(harnessModelSchema),
|
|
21837
21748
|
defaultModel: harnessModelRefSchema.optional(),
|
|
21838
21749
|
thinkingOptions: harnessThinkingOptionsSchema,
|
|
21839
|
-
defaultThinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
21750
|
+
defaultThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
21751
|
+
/**
|
|
21752
|
+
* Scope of per-Model `supportedThinkingOptionIds` in this catalog.
|
|
21753
|
+
* Omitted or `"catalog"` means each Model's `supportedThinkingOptionIds`
|
|
21754
|
+
* reflects its own options (omitted or `[]` means none).
|
|
21755
|
+
* `"activeModel"` means only the active Model's Thinking options were
|
|
21756
|
+
* observed; other Models omit `supportedThinkingOptionIds` and must be
|
|
21757
|
+
* validated by the Adapter after selecting the Model.
|
|
21758
|
+
*/
|
|
21759
|
+
thinkingOptionsScope: harnessThinkingOptionsScopeSchema.optional()
|
|
21840
21760
|
}).strict().superRefine((catalog, context) => {
|
|
21841
21761
|
const refs = [];
|
|
21842
21762
|
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id: id2 }) => id2));
|
|
@@ -21969,7 +21889,7 @@ var harnessInspectionSchema = external_exports.union([
|
|
|
21969
21889
|
]);
|
|
21970
21890
|
var harnessInspectParamsSchema = external_exports.object({
|
|
21971
21891
|
harnessId: harnessIdSchema,
|
|
21972
|
-
cwd:
|
|
21892
|
+
cwd: nonBlankTextSchema3.max(16384).optional(),
|
|
21973
21893
|
refresh: external_exports.boolean().optional(),
|
|
21974
21894
|
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
21975
21895
|
purpose: external_exports.literal("availability").optional(),
|
|
@@ -21999,12 +21919,13 @@ var codexThreadInspectionSchema = external_exports.object({
|
|
|
21999
21919
|
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
22000
21920
|
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
22001
21921
|
history: harnessHistoryCapabilitiesSchema.optional(),
|
|
22002
|
-
supportsThreadReferences: external_exports.literal(true).optional()
|
|
21922
|
+
supportsThreadReferences: external_exports.literal(true).optional(),
|
|
21923
|
+
handoff: threadHandoffMetadataSchema.optional()
|
|
22003
21924
|
}).strict();
|
|
22004
21925
|
var externalThreadInspectionSchema = external_exports.object({
|
|
22005
21926
|
owner: external_exports.literal("external"),
|
|
22006
|
-
harnessId:
|
|
22007
|
-
transportModelId:
|
|
21927
|
+
harnessId: nonBlankTextSchema3.max(256),
|
|
21928
|
+
transportModelId: nonBlankTextSchema3.max(HARNESS_TRANSPORT_MODEL_ID_MAX_LENGTH),
|
|
22008
21929
|
effectiveModel: harnessModelRefSchema.optional(),
|
|
22009
21930
|
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
22010
21931
|
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
@@ -22014,6 +21935,7 @@ var externalThreadInspectionSchema = external_exports.object({
|
|
|
22014
21935
|
catalog: harnessModelCatalogSchema.optional(),
|
|
22015
21936
|
history: harnessHistoryCapabilitiesSchema,
|
|
22016
21937
|
usage: threadUsageSnapshotSchema.optional(),
|
|
21938
|
+
handoff: threadHandoffMetadataSchema.optional(),
|
|
22017
21939
|
locked: external_exports.literal(true)
|
|
22018
21940
|
}).strict();
|
|
22019
21941
|
var threadInspectionSchema = external_exports.discriminatedUnion("owner", [
|
|
@@ -22716,6 +22638,7 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
22716
22638
|
"codexhost/harness/preferences/get",
|
|
22717
22639
|
"codexhost/harness/preferences/patch",
|
|
22718
22640
|
"thread/list",
|
|
22641
|
+
"thread/metadata/update",
|
|
22719
22642
|
"codexhost/thread/catalog/read",
|
|
22720
22643
|
"thread/read",
|
|
22721
22644
|
"thread/resume",
|
|
@@ -22740,6 +22663,10 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
22740
22663
|
"thread/queue/start",
|
|
22741
22664
|
"codexhost/thread/queue/send-now",
|
|
22742
22665
|
"codexhost/workspace/read",
|
|
22666
|
+
"project/create",
|
|
22667
|
+
"project/update",
|
|
22668
|
+
"project/delete",
|
|
22669
|
+
"project/move",
|
|
22743
22670
|
"codexhost/thread/tree/read",
|
|
22744
22671
|
"codexhost/thread/pins/list",
|
|
22745
22672
|
"codexhost/thread/sections/list",
|
|
@@ -22757,6 +22684,7 @@ var CLIENT_CHANNEL_METHODS = [
|
|
|
22757
22684
|
"codexhost/harness/commands/inspect",
|
|
22758
22685
|
"codexhost/thread/command/execute",
|
|
22759
22686
|
"codexhost/thread/fork",
|
|
22687
|
+
THREAD_HANDOFF_METHOD,
|
|
22760
22688
|
"codexhost/harness/session-import/sources",
|
|
22761
22689
|
"codexhost/harness/session-import/list",
|
|
22762
22690
|
"codexhost/harness/session-import/import",
|
|
@@ -22807,7 +22735,13 @@ var clientProjectlessWorkspaceSchema = external_exports.object({
|
|
|
22807
22735
|
prompt: external_exports.string().max(16384).optional()
|
|
22808
22736
|
}).strict();
|
|
22809
22737
|
var clientWorkspaceSnapshotSchema = external_exports.object({
|
|
22810
|
-
projects: external_exports.array(external_exports.object({
|
|
22738
|
+
projects: external_exports.array(external_exports.object({
|
|
22739
|
+
id: external_exports.string(),
|
|
22740
|
+
name: external_exports.string(),
|
|
22741
|
+
rootPaths: external_exports.array(external_exports.string()),
|
|
22742
|
+
createdAt: external_exports.number().int().optional()
|
|
22743
|
+
})),
|
|
22744
|
+
nativeProjects: external_exports.literal(true).optional(),
|
|
22811
22745
|
assignments: external_exports.record(external_exports.string(), external_exports.string()),
|
|
22812
22746
|
projectless: external_exports.array(external_exports.string()),
|
|
22813
22747
|
/** Canonical external pin membership; pins/list provides the native merged order. */
|
|
@@ -22822,6 +22756,7 @@ var clientChannelCursorSchema = external_exports.object({
|
|
|
22822
22756
|
sequence: external_exports.number().int().nonnegative()
|
|
22823
22757
|
});
|
|
22824
22758
|
var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
22759
|
+
external_exports.object({ type: external_exports.literal("projects-changed"), cursor: clientChannelCursorSchema }),
|
|
22825
22760
|
external_exports.object({
|
|
22826
22761
|
type: external_exports.literal("skills-changed"),
|
|
22827
22762
|
cursor: clientChannelCursorSchema,
|
|
@@ -22985,7 +22920,8 @@ var clientThreadSnapshotSchema = external_exports.object({
|
|
|
22985
22920
|
items: external_exports.array(clientQueuedSubmissionSchema),
|
|
22986
22921
|
pausedReason: external_exports.enum(["interrupted", "outcome-unknown", "failed"]).nullable()
|
|
22987
22922
|
}).optional(),
|
|
22988
|
-
interactions: external_exports.array(clientInteractionSchema)
|
|
22923
|
+
interactions: external_exports.array(clientInteractionSchema),
|
|
22924
|
+
handoff: threadHandoffMetadataSchema.optional()
|
|
22989
22925
|
});
|
|
22990
22926
|
var clientChannelDescriptorSchema = external_exports.object({
|
|
22991
22927
|
version: external_exports.literal(CLIENT_CHANNEL_VERSION),
|
|
@@ -22994,7 +22930,10 @@ var clientChannelDescriptorSchema = external_exports.object({
|
|
|
22994
22930
|
port: external_exports.number().int().min(1).max(65535),
|
|
22995
22931
|
token: external_exports.string().regex(/^[0-9a-f]{64}$/u),
|
|
22996
22932
|
startedAt: external_exports.number(),
|
|
22997
|
-
epoch: external_exports.string().uuid()
|
|
22933
|
+
epoch: external_exports.string().uuid(),
|
|
22934
|
+
capabilities: external_exports.object({
|
|
22935
|
+
peerDelegation: external_exports.literal(1).optional()
|
|
22936
|
+
}).optional()
|
|
22998
22937
|
});
|
|
22999
22938
|
var clientChannelResponseSchema = external_exports.object({
|
|
23000
22939
|
epoch: external_exports.string().uuid(),
|
|
@@ -23013,10 +22952,18 @@ var threadCatalogReadParamsSchema = external_exports.object({
|
|
|
23013
22952
|
* `excludeCwds` folder, the branch ends, or a page bound is reached. Every row read is
|
|
23014
22953
|
* returned, so the native cursors stay contiguous.
|
|
23015
22954
|
*/
|
|
23016
|
-
scope: external_exports.
|
|
23017
|
-
|
|
23018
|
-
|
|
23019
|
-
|
|
22955
|
+
scope: external_exports.union([
|
|
22956
|
+
external_exports.object({
|
|
22957
|
+
cwd: external_exports.string().min(1).max(4096),
|
|
22958
|
+
excludeCwds: external_exports.array(external_exports.string().min(1).max(4096)).max(1024)
|
|
22959
|
+
}).strict(),
|
|
22960
|
+
external_exports.object({
|
|
22961
|
+
projectId: external_exports.string().min(1).max(1024),
|
|
22962
|
+
legacyThreadIds: external_exports.array(external_exports.string().min(1).max(1024)).max(1024),
|
|
22963
|
+
/** Roots whose Threads without a project ID belong to this project, as on Desktop. */
|
|
22964
|
+
rootPaths: external_exports.array(external_exports.string().min(1).max(4096)).max(1024).optional()
|
|
22965
|
+
}).strict()
|
|
22966
|
+
]).optional()
|
|
23020
22967
|
}).strict();
|
|
23021
22968
|
var threadCatalogReadResultSchema = external_exports.object({
|
|
23022
22969
|
threads: external_exports.array(jsonObjectSchema),
|
|
@@ -23203,94 +23150,449 @@ var delegationReadParamsSchema = external_exports.strictObject({
|
|
|
23203
23150
|
to: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional()
|
|
23204
23151
|
});
|
|
23205
23152
|
|
|
23206
|
-
// packages/shared-contracts/dist/
|
|
23207
|
-
var
|
|
23208
|
-
|
|
23209
|
-
|
|
23210
|
-
|
|
23211
|
-
|
|
23212
|
-
|
|
23213
|
-
|
|
23214
|
-
|
|
23215
|
-
|
|
23216
|
-
|
|
23217
|
-
|
|
23218
|
-
|
|
23219
|
-
|
|
23220
|
-
|
|
23221
|
-
|
|
23222
|
-
|
|
23223
|
-
|
|
23224
|
-
|
|
23225
|
-
|
|
23226
|
-
|
|
23227
|
-
|
|
23228
|
-
|
|
23229
|
-
sourceId: external_exports.string().min(1).max(256),
|
|
23230
|
-
name: credentialImportNameSchema,
|
|
23231
|
-
confirmed: external_exports.literal(true)
|
|
23232
|
-
}).strict(),
|
|
23233
|
-
external_exports.object({
|
|
23234
|
-
action: external_exports.literal("remove"),
|
|
23235
|
-
name: credentialImportNameSchema,
|
|
23236
|
-
confirmed: external_exports.literal(true)
|
|
23237
|
-
}).strict()
|
|
23153
|
+
// packages/shared-contracts/dist/remote-peers.js
|
|
23154
|
+
var REMOTE_PEER_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/u;
|
|
23155
|
+
var remotePeerIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
23156
|
+
var remotePeerNodeIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
23157
|
+
var remotePeerHostIdSchema = external_exports.string().regex(/^remote-peer:[a-zA-Z0-9_-]{1,64}$/u);
|
|
23158
|
+
var remotePeerTransportKindSchema = external_exports.enum(["relay", "tailscale", "lan", "custom"]);
|
|
23159
|
+
var REMOTE_PEER_COLORS = [
|
|
23160
|
+
"blue",
|
|
23161
|
+
"purple",
|
|
23162
|
+
"cyan",
|
|
23163
|
+
"green",
|
|
23164
|
+
"amber",
|
|
23165
|
+
"rose",
|
|
23166
|
+
"slate"
|
|
23167
|
+
];
|
|
23168
|
+
var remotePeerColorSchema = external_exports.enum(REMOTE_PEER_COLORS);
|
|
23169
|
+
var REMOTE_PEER_COLOR_SET = new Set(REMOTE_PEER_COLORS);
|
|
23170
|
+
var remotePeerStateSchema = external_exports.enum([
|
|
23171
|
+
"connected",
|
|
23172
|
+
"connecting",
|
|
23173
|
+
"auth-error",
|
|
23174
|
+
"offline",
|
|
23175
|
+
"disabled"
|
|
23238
23176
|
]);
|
|
23239
|
-
var
|
|
23240
|
-
|
|
23241
|
-
|
|
23242
|
-
|
|
23243
|
-
|
|
23244
|
-
|
|
23245
|
-
|
|
23246
|
-
|
|
23247
|
-
|
|
23248
|
-
sources: external_exports.array(credentialSourceSchema),
|
|
23249
|
-
targets: external_exports.array(external_exports.object({
|
|
23250
|
-
harnessId: external_exports.string(),
|
|
23251
|
-
providers: external_exports.array(external_exports.enum(["openai-codex", "xai"])),
|
|
23252
|
-
imports: external_exports.array(credentialImportRecordSchema),
|
|
23253
|
-
others: external_exports.array(credentialOtherLoginSchema).default([])
|
|
23254
|
-
}).strict())
|
|
23255
|
-
}).strict();
|
|
23256
|
-
var credentialImportsParamsSchema = external_exports.object({
|
|
23257
|
-
targetHarnessId: external_exports.string().min(1).max(128).optional(),
|
|
23258
|
-
request: credentialImportsRequestSchema
|
|
23259
|
-
}).strict();
|
|
23260
|
-
|
|
23261
|
-
// packages/shared-contracts/dist/harness-display-settings.js
|
|
23262
|
-
var harnessDisplayCapabilitiesSchema = external_exports.object({ events: external_exports.boolean() });
|
|
23263
|
-
var harnessDisplayEntriesSchema = external_exports.array(external_exports.strictObject({
|
|
23264
|
-
agent: external_exports.string().min(1).max(128),
|
|
23265
|
-
section: external_exports.enum(["main", "more", "auto"])
|
|
23266
|
-
})).max(256).refine((entries) => new Set(entries.map((entry) => entry.agent)).size === entries.length, "Duplicate Harness IDs");
|
|
23267
|
-
var harnessDisplaySettingsSchema = external_exports.strictObject({
|
|
23268
|
-
entries: harnessDisplayEntriesSchema.nullable()
|
|
23269
|
-
});
|
|
23270
|
-
var harnessDisplayGetSchema = external_exports.strictObject({});
|
|
23271
|
-
var harnessDisplaySetSchema = external_exports.strictObject({
|
|
23272
|
-
entries: harnessDisplayEntriesSchema,
|
|
23273
|
-
/** Import legacy Desktop preferences only if no shared settings exist yet. */
|
|
23274
|
-
initializeOnly: external_exports.boolean().optional()
|
|
23275
|
-
});
|
|
23276
|
-
|
|
23277
|
-
// packages/shared-contracts/dist/idle-release.js
|
|
23278
|
-
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
23279
|
-
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
23280
|
-
var idleReleaseSettingsSchema = external_exports.strictObject({
|
|
23177
|
+
var remotePeerSummarySchema = external_exports.object({
|
|
23178
|
+
peerId: remotePeerIdSchema,
|
|
23179
|
+
hostId: remotePeerHostIdSchema,
|
|
23180
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
23181
|
+
name: external_exports.string().min(1).max(120),
|
|
23182
|
+
color: remotePeerColorSchema.optional(),
|
|
23183
|
+
origin: external_exports.string().min(1).max(2048),
|
|
23184
|
+
transportKind: remotePeerTransportKindSchema,
|
|
23185
|
+
encrypted: external_exports.boolean(),
|
|
23281
23186
|
enabled: external_exports.boolean(),
|
|
23282
|
-
|
|
23187
|
+
state: remotePeerStateSchema,
|
|
23188
|
+
supportsPeerPairing: external_exports.boolean().optional(),
|
|
23189
|
+
/** Omitted when either side's node mapping is unknown. */
|
|
23190
|
+
pairedBack: external_exports.boolean().optional(),
|
|
23191
|
+
/** Other configured remote peerIds on this Hub present in this peer's `manifest.peerNodes`. */
|
|
23192
|
+
linkedPeerIds: external_exports.array(remotePeerIdSchema).max(128).optional(),
|
|
23193
|
+
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
23194
|
+
version: external_exports.string().max(128).optional(),
|
|
23195
|
+
platform: external_exports.string().max(64).optional(),
|
|
23196
|
+
hostname: external_exports.string().max(255).optional(),
|
|
23197
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
23198
|
+
lastError: external_exports.string().max(1e3).optional(),
|
|
23199
|
+
projectCount: external_exports.number().int().nonnegative(),
|
|
23200
|
+
createdAt: external_exports.string(),
|
|
23201
|
+
updatedAt: external_exports.string()
|
|
23283
23202
|
});
|
|
23284
|
-
var
|
|
23285
|
-
|
|
23286
|
-
timeoutMinutes: 10
|
|
23203
|
+
var remotePeerListResultSchema = external_exports.object({
|
|
23204
|
+
peers: external_exports.array(remotePeerSummarySchema)
|
|
23287
23205
|
});
|
|
23288
|
-
|
|
23289
|
-
|
|
23290
|
-
|
|
23291
|
-
|
|
23292
|
-
|
|
23293
|
-
|
|
23206
|
+
var remotePeerAddParamsSchema = external_exports.object({
|
|
23207
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
23208
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
23209
|
+
token: external_exports.string().min(1).max(2048).optional(),
|
|
23210
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
23211
|
+
color: remotePeerColorSchema.optional(),
|
|
23212
|
+
pairBack: external_exports.boolean().optional(),
|
|
23213
|
+
meshPeerIds: external_exports.array(remotePeerIdSchema).max(64).optional(),
|
|
23214
|
+
selfOrigin: external_exports.string().min(1).max(2048).optional()
|
|
23215
|
+
}).refine((input3) => Boolean(input3.connectionUrl) || Boolean(input3.origin) && Boolean(input3.token), "Provide either connectionUrl or both origin and token");
|
|
23216
|
+
var remotePeerIntroduceParamsSchema = external_exports.strictObject({
|
|
23217
|
+
origin: external_exports.string().min(1).max(2048),
|
|
23218
|
+
token: external_exports.string().min(1).max(2048),
|
|
23219
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
23220
|
+
color: remotePeerColorSchema.optional(),
|
|
23221
|
+
expectedNodeId: remotePeerNodeIdSchema.optional()
|
|
23222
|
+
});
|
|
23223
|
+
var remotePeerIntroduceResultSchema = external_exports.object({
|
|
23224
|
+
status: external_exports.enum(["added", "updated", "existing"]),
|
|
23225
|
+
peerId: remotePeerIdSchema,
|
|
23226
|
+
hostId: remotePeerHostIdSchema,
|
|
23227
|
+
nodeId: remotePeerNodeIdSchema.optional()
|
|
23228
|
+
});
|
|
23229
|
+
var remotePeerPairingStatusSchema = external_exports.enum([
|
|
23230
|
+
"added",
|
|
23231
|
+
"updated",
|
|
23232
|
+
"existing",
|
|
23233
|
+
"failed",
|
|
23234
|
+
"skipped"
|
|
23235
|
+
]);
|
|
23236
|
+
var remotePeerPairingStepSchema = external_exports.object({
|
|
23237
|
+
targetPeerId: remotePeerIdSchema,
|
|
23238
|
+
targetName: external_exports.string().min(1).max(120),
|
|
23239
|
+
introducedHost: external_exports.union([external_exports.literal("local"), remotePeerIdSchema]),
|
|
23240
|
+
introducedName: external_exports.string().min(1).max(120),
|
|
23241
|
+
status: remotePeerPairingStatusSchema,
|
|
23242
|
+
error: external_exports.string().max(1e3).optional()
|
|
23243
|
+
});
|
|
23244
|
+
var remotePeerPairingReportSchema = external_exports.object({
|
|
23245
|
+
results: external_exports.array(remotePeerPairingStepSchema)
|
|
23246
|
+
});
|
|
23247
|
+
var remotePeerSyncMeshParamsSchema = external_exports.object({
|
|
23248
|
+
peerIds: external_exports.array(remotePeerIdSchema).max(64).optional(),
|
|
23249
|
+
includeSelf: external_exports.boolean().optional(),
|
|
23250
|
+
includeMesh: external_exports.boolean().optional(),
|
|
23251
|
+
selfOrigin: external_exports.string().min(1).max(2048).optional()
|
|
23252
|
+
});
|
|
23253
|
+
var remotePeerUpdateParamsSchema = external_exports.object({
|
|
23254
|
+
peerId: remotePeerIdSchema,
|
|
23255
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
23256
|
+
color: remotePeerColorSchema.nullable().optional(),
|
|
23257
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
23258
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
23259
|
+
token: external_exports.string().min(1).max(2048).optional(),
|
|
23260
|
+
enabled: external_exports.boolean().optional()
|
|
23261
|
+
});
|
|
23262
|
+
var remotePeerIdParamsSchema = external_exports.object({
|
|
23263
|
+
peerId: remotePeerIdSchema
|
|
23264
|
+
});
|
|
23265
|
+
var remotePeerRemoveResultSchema = external_exports.object({
|
|
23266
|
+
removed: external_exports.boolean()
|
|
23267
|
+
});
|
|
23268
|
+
var remotePeerTestParamsSchema = external_exports.object({
|
|
23269
|
+
peerId: remotePeerIdSchema.optional(),
|
|
23270
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
23271
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
23272
|
+
token: external_exports.string().min(1).max(2048).optional()
|
|
23273
|
+
}).refine((input3) => Boolean(input3.peerId) || Boolean(input3.connectionUrl) || Boolean(input3.origin) && Boolean(input3.token), "Provide peerId, connectionUrl, or both origin and token");
|
|
23274
|
+
var remotePeerTestProjectSchema = external_exports.object({
|
|
23275
|
+
id: external_exports.string().min(1).max(1024),
|
|
23276
|
+
name: external_exports.string().min(1).max(512),
|
|
23277
|
+
path: external_exports.string().min(1).max(8192)
|
|
23278
|
+
});
|
|
23279
|
+
var remotePeerTestResultSchema = external_exports.object({
|
|
23280
|
+
ok: external_exports.boolean(),
|
|
23281
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
23282
|
+
supportsPeerPairing: external_exports.boolean().optional(),
|
|
23283
|
+
pairedBack: external_exports.boolean().optional(),
|
|
23284
|
+
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
23285
|
+
origin: external_exports.string().max(2048).optional(),
|
|
23286
|
+
transportKind: remotePeerTransportKindSchema.optional(),
|
|
23287
|
+
encrypted: external_exports.boolean().optional(),
|
|
23288
|
+
version: external_exports.string().max(128).optional(),
|
|
23289
|
+
platform: external_exports.string().max(64).optional(),
|
|
23290
|
+
hostname: external_exports.string().max(255).optional(),
|
|
23291
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
23292
|
+
projectCount: external_exports.number().int().nonnegative().optional(),
|
|
23293
|
+
projects: external_exports.array(remotePeerTestProjectSchema).optional(),
|
|
23294
|
+
error: external_exports.string().max(1e3).optional()
|
|
23295
|
+
});
|
|
23296
|
+
var remotePeerManifestProjectSchema = external_exports.object({
|
|
23297
|
+
id: external_exports.string().min(1).max(1024),
|
|
23298
|
+
name: external_exports.string().min(1).max(512),
|
|
23299
|
+
path: external_exports.string().min(1).max(8192),
|
|
23300
|
+
threadIds: external_exports.array(external_exports.string().min(1).max(1024))
|
|
23301
|
+
});
|
|
23302
|
+
var remotePeerCapabilitiesSchema = external_exports.object({
|
|
23303
|
+
/** /api/peer/v1/uploads, /api/peer/v1/prompt, and /api/peer/v1/file are all available. */
|
|
23304
|
+
attachments: external_exports.literal(1).optional(),
|
|
23305
|
+
/** /api/peer/v1/workspace-files/rpc and /api/peer/v1/workspace-files/download are available. */
|
|
23306
|
+
workspaceFiles: external_exports.literal(1).optional(),
|
|
23307
|
+
/** Peer supports officeToPdf/render over /api/peer/v1/workspace-files/rpc. */
|
|
23308
|
+
officePreview: external_exports.literal(1).optional(),
|
|
23309
|
+
/** /api/peer/v1/delegation is available for fixed-whitelist cross-host delegation. */
|
|
23310
|
+
delegation: external_exports.literal(1).optional(),
|
|
23311
|
+
/** POST /api/peer/v1/peers is available. */
|
|
23312
|
+
peerPairing: external_exports.literal(1).optional()
|
|
23313
|
+
});
|
|
23314
|
+
var remotePeerManifestSchema = external_exports.object({
|
|
23315
|
+
version: external_exports.string().max(128),
|
|
23316
|
+
platform: external_exports.string().max(64),
|
|
23317
|
+
hostname: external_exports.string().max(255),
|
|
23318
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
23319
|
+
epoch: external_exports.string().min(1).max(256),
|
|
23320
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
23321
|
+
peerNodes: external_exports.record(remotePeerHostIdSchema, remotePeerNodeIdSchema).refine((v) => Object.keys(v).length <= 128).optional(),
|
|
23322
|
+
projects: external_exports.array(remotePeerManifestProjectSchema),
|
|
23323
|
+
capabilities: remotePeerCapabilitiesSchema.optional()
|
|
23324
|
+
});
|
|
23325
|
+
var REMOTE_PEER_UPLOAD_SCOPE_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u;
|
|
23326
|
+
var remotePeerPromptParamsSchema = external_exports.strictObject({
|
|
23327
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
23328
|
+
scope: external_exports.string().regex(REMOTE_PEER_UPLOAD_SCOPE_PATTERN).optional(),
|
|
23329
|
+
requestId: external_exports.string().min(1).max(256).optional(),
|
|
23330
|
+
mode: external_exports.enum(["queue", "steer"]).optional(),
|
|
23331
|
+
expectedTurnId: external_exports.string().min(1).max(1024).nullable().optional(),
|
|
23332
|
+
content: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
23333
|
+
external_exports.strictObject({ type: external_exports.literal("text"), text: external_exports.string() }),
|
|
23334
|
+
external_exports.strictObject({ type: external_exports.literal("file"), receiptId: external_exports.string().min(1).max(128) })
|
|
23335
|
+
])).min(1).max(64)
|
|
23336
|
+
});
|
|
23337
|
+
var remotePeerErrorEnvelopeSchema = external_exports.object({
|
|
23338
|
+
ok: external_exports.literal(false),
|
|
23339
|
+
error: external_exports.object({
|
|
23340
|
+
code: external_exports.string(),
|
|
23341
|
+
message: external_exports.string(),
|
|
23342
|
+
details: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
23343
|
+
})
|
|
23344
|
+
});
|
|
23345
|
+
var remotePeerUploadResultSchema = external_exports.union([
|
|
23346
|
+
external_exports.object({
|
|
23347
|
+
ok: external_exports.literal(true),
|
|
23348
|
+
value: external_exports.object({
|
|
23349
|
+
receiptId: external_exports.string().min(1),
|
|
23350
|
+
file: external_exports.object({
|
|
23351
|
+
attachmentId: external_exports.string(),
|
|
23352
|
+
name: external_exports.string(),
|
|
23353
|
+
bytes: external_exports.number().int().nonnegative()
|
|
23354
|
+
})
|
|
23355
|
+
})
|
|
23356
|
+
}),
|
|
23357
|
+
remotePeerErrorEnvelopeSchema
|
|
23358
|
+
]);
|
|
23359
|
+
var remotePeerPromptResultSchema = external_exports.union([
|
|
23360
|
+
external_exports.object({
|
|
23361
|
+
ok: external_exports.literal(true),
|
|
23362
|
+
value: external_exports.object({ accepted: external_exports.literal(true) })
|
|
23363
|
+
}),
|
|
23364
|
+
remotePeerErrorEnvelopeSchema
|
|
23365
|
+
]);
|
|
23366
|
+
var remotePeerDirectoryEntrySchema = external_exports.object({
|
|
23367
|
+
name: external_exports.string().min(1).max(512),
|
|
23368
|
+
path: external_exports.string().min(1).max(8192),
|
|
23369
|
+
kind: external_exports.literal("directory")
|
|
23370
|
+
});
|
|
23371
|
+
var remotePeerListDirsParamsSchema = external_exports.object({
|
|
23372
|
+
peerId: remotePeerIdSchema,
|
|
23373
|
+
path: external_exports.string().min(1).max(8192).optional()
|
|
23374
|
+
});
|
|
23375
|
+
var remotePeerListDirsResultSchema = external_exports.object({
|
|
23376
|
+
path: external_exports.string().min(1).max(8192),
|
|
23377
|
+
parentPath: external_exports.string().min(1).max(8192).nullable(),
|
|
23378
|
+
homeDir: external_exports.string().min(1).max(8192).optional(),
|
|
23379
|
+
entries: external_exports.array(remotePeerDirectoryEntrySchema)
|
|
23380
|
+
});
|
|
23381
|
+
var remotePeerCreateDirParamsSchema = external_exports.object({
|
|
23382
|
+
peerId: remotePeerIdSchema,
|
|
23383
|
+
parentPath: external_exports.string().min(1).max(8192),
|
|
23384
|
+
name: external_exports.string().min(1).max(255).refine((value) => value.trim().length > 0, "Directory name cannot be blank")
|
|
23385
|
+
});
|
|
23386
|
+
var remotePeerCreateDirResultSchema = external_exports.object({
|
|
23387
|
+
path: external_exports.string().min(1).max(8192),
|
|
23388
|
+
name: external_exports.string().min(1).max(255)
|
|
23389
|
+
});
|
|
23390
|
+
var remotePeerCreateWorkspaceParamsSchema = external_exports.object({
|
|
23391
|
+
peerId: remotePeerIdSchema,
|
|
23392
|
+
path: external_exports.string().min(1).max(8192),
|
|
23393
|
+
title: external_exports.string().trim().min(1).max(255).optional()
|
|
23394
|
+
});
|
|
23395
|
+
var remotePeerRenameWorkspaceParamsSchema = external_exports.object({
|
|
23396
|
+
peerId: remotePeerIdSchema,
|
|
23397
|
+
workspaceId: external_exports.string().min(1).max(1024),
|
|
23398
|
+
title: external_exports.string().trim().min(1).max(255)
|
|
23399
|
+
});
|
|
23400
|
+
var remotePeerDeleteWorkspaceParamsSchema = external_exports.object({
|
|
23401
|
+
peerId: remotePeerIdSchema,
|
|
23402
|
+
workspaceId: external_exports.string().min(1).max(1024)
|
|
23403
|
+
});
|
|
23404
|
+
var remotePeerWorkspaceMutationResultSchema = external_exports.object({
|
|
23405
|
+
workspaceId: external_exports.string().min(1).max(1024).optional(),
|
|
23406
|
+
manifest: remotePeerManifestSchema
|
|
23407
|
+
});
|
|
23408
|
+
var delegationRemoteHostsParamsSchema = external_exports.object({
|
|
23409
|
+
sessionHostId: external_exports.string().min(1).max(128).optional()
|
|
23410
|
+
});
|
|
23411
|
+
var delegationRemoteHostOptionSchema = external_exports.object({
|
|
23412
|
+
hostId: external_exports.union([external_exports.literal("local"), remotePeerHostIdSchema]),
|
|
23413
|
+
name: external_exports.string().min(1).max(120),
|
|
23414
|
+
isLocal: external_exports.boolean().optional(),
|
|
23415
|
+
color: remotePeerColorSchema.optional(),
|
|
23416
|
+
hostname: external_exports.string().max(255).optional()
|
|
23417
|
+
});
|
|
23418
|
+
var delegationRemoteHostsResultSchema = external_exports.object({
|
|
23419
|
+
hosts: external_exports.array(delegationRemoteHostOptionSchema)
|
|
23420
|
+
});
|
|
23421
|
+
var delegationHostHarnessesParamsSchema = external_exports.object({
|
|
23422
|
+
hostId: external_exports.union([external_exports.literal("local"), remotePeerHostIdSchema])
|
|
23423
|
+
});
|
|
23424
|
+
var delegationHostHarnessOptionSchema = external_exports.object({
|
|
23425
|
+
id: external_exports.string().regex(/^[a-z0-9][a-z0-9-]*$/u),
|
|
23426
|
+
name: external_exports.string().min(1).max(120)
|
|
23427
|
+
});
|
|
23428
|
+
var delegationHostHarnessesResultSchema = external_exports.object({
|
|
23429
|
+
harnesses: external_exports.array(delegationHostHarnessOptionSchema)
|
|
23430
|
+
});
|
|
23431
|
+
|
|
23432
|
+
// packages/shared-contracts/dist/peer-delegation.js
|
|
23433
|
+
var PEER_DELEGATION_BRIDGE_VERSION = 1;
|
|
23434
|
+
var PEER_DELEGATION_OPERATIONS = [
|
|
23435
|
+
"listHarnesses",
|
|
23436
|
+
"inspect",
|
|
23437
|
+
"start",
|
|
23438
|
+
"send",
|
|
23439
|
+
"cancel",
|
|
23440
|
+
"read",
|
|
23441
|
+
"answer",
|
|
23442
|
+
"list"
|
|
23443
|
+
];
|
|
23444
|
+
var peerDelegationOperationSchema = external_exports.enum(PEER_DELEGATION_OPERATIONS);
|
|
23445
|
+
var peerDelegationRequestSchema = external_exports.strictObject({
|
|
23446
|
+
operation: peerDelegationOperationSchema,
|
|
23447
|
+
hopCount: external_exports.number().int().min(0).max(16),
|
|
23448
|
+
/** Opaque A-side peer pairing identifier used by B to scope implicit deduplication per Peer. */
|
|
23449
|
+
sourceId: remotePeerIdSchema.optional(),
|
|
23450
|
+
input: jsonObjectSchema
|
|
23451
|
+
});
|
|
23452
|
+
var peerDelegationErrorSchema = external_exports.strictObject({
|
|
23453
|
+
code: external_exports.string().min(1).max(128),
|
|
23454
|
+
message: external_exports.string().max(4096),
|
|
23455
|
+
details: jsonObjectSchema.optional()
|
|
23456
|
+
});
|
|
23457
|
+
var peerDelegationResponseSchema = external_exports.union([
|
|
23458
|
+
external_exports.strictObject({
|
|
23459
|
+
ok: external_exports.literal(true),
|
|
23460
|
+
value: jsonValueSchema
|
|
23461
|
+
}),
|
|
23462
|
+
external_exports.strictObject({
|
|
23463
|
+
ok: external_exports.literal(false),
|
|
23464
|
+
error: peerDelegationErrorSchema
|
|
23465
|
+
})
|
|
23466
|
+
]);
|
|
23467
|
+
var peerDelegationHostProjectSchema = external_exports.strictObject({
|
|
23468
|
+
id: external_exports.string().min(1).max(1024),
|
|
23469
|
+
name: external_exports.string().min(1).max(512),
|
|
23470
|
+
path: external_exports.string().min(1).max(8192)
|
|
23471
|
+
});
|
|
23472
|
+
var peerDelegationHostSummarySchema = external_exports.strictObject({
|
|
23473
|
+
hostId: remotePeerHostIdSchema,
|
|
23474
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
23475
|
+
displayName: external_exports.string().min(1).max(120),
|
|
23476
|
+
online: external_exports.boolean(),
|
|
23477
|
+
state: remotePeerStateSchema,
|
|
23478
|
+
delegation: external_exports.boolean(),
|
|
23479
|
+
projects: external_exports.array(peerDelegationHostProjectSchema),
|
|
23480
|
+
platform: external_exports.string().max(64).optional(),
|
|
23481
|
+
hostname: external_exports.string().max(255).optional(),
|
|
23482
|
+
homeDir: external_exports.string().max(4096).optional()
|
|
23483
|
+
});
|
|
23484
|
+
var peerDelegationHostsResultSchema = external_exports.strictObject({
|
|
23485
|
+
hosts: external_exports.array(peerDelegationHostSummarySchema)
|
|
23486
|
+
});
|
|
23487
|
+
var peerDelegationBridgeDescriptorSchema = external_exports.strictObject({
|
|
23488
|
+
version: external_exports.literal(PEER_DELEGATION_BRIDGE_VERSION),
|
|
23489
|
+
instanceId: external_exports.string().min(1).max(128),
|
|
23490
|
+
pid: external_exports.number().int().positive(),
|
|
23491
|
+
endpoint: external_exports.string().min(1).max(256),
|
|
23492
|
+
token: external_exports.string().regex(/^[0-9a-f]{64}$/u),
|
|
23493
|
+
startedAt: external_exports.number().int().nonnegative()
|
|
23494
|
+
});
|
|
23495
|
+
var peerDelegationBridgeRequestSchema = external_exports.union([
|
|
23496
|
+
external_exports.strictObject({
|
|
23497
|
+
operation: external_exports.literal("hosts")
|
|
23498
|
+
}),
|
|
23499
|
+
external_exports.strictObject({
|
|
23500
|
+
operation: peerDelegationOperationSchema,
|
|
23501
|
+
hostId: remotePeerHostIdSchema,
|
|
23502
|
+
hopCount: external_exports.number().int().min(0).max(16),
|
|
23503
|
+
timeoutMs: external_exports.number().int().min(1).max(12e4).optional(),
|
|
23504
|
+
input: jsonObjectSchema
|
|
23505
|
+
})
|
|
23506
|
+
]);
|
|
23507
|
+
|
|
23508
|
+
// packages/shared-contracts/dist/credential-imports.js
|
|
23509
|
+
var credentialSourceSchema = external_exports.object({
|
|
23510
|
+
id: external_exports.string().min(1).max(256),
|
|
23511
|
+
harnessId: external_exports.string().min(1),
|
|
23512
|
+
label: external_exports.string().min(1).max(512),
|
|
23513
|
+
provider: external_exports.enum(["openai-codex", "xai"])
|
|
23514
|
+
}).strict();
|
|
23515
|
+
var credentialImportNameSchema = external_exports.string().regex(/^[a-z][a-z0-9-]{0,47}$/);
|
|
23516
|
+
var credentialImportRecordSchema = external_exports.object({
|
|
23517
|
+
name: credentialImportNameSchema,
|
|
23518
|
+
source: credentialSourceSchema,
|
|
23519
|
+
importedAt: external_exports.string()
|
|
23520
|
+
}).strict();
|
|
23521
|
+
var credentialImportsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
23522
|
+
external_exports.object({ action: external_exports.literal("list") }).strict(),
|
|
23523
|
+
external_exports.object({
|
|
23524
|
+
action: external_exports.literal("import"),
|
|
23525
|
+
sourceId: external_exports.string().min(1).max(256),
|
|
23526
|
+
name: credentialImportNameSchema,
|
|
23527
|
+
confirmed: external_exports.literal(true)
|
|
23528
|
+
}).strict(),
|
|
23529
|
+
external_exports.object({
|
|
23530
|
+
action: external_exports.literal("reimport"),
|
|
23531
|
+
sourceId: external_exports.string().min(1).max(256),
|
|
23532
|
+
name: credentialImportNameSchema,
|
|
23533
|
+
confirmed: external_exports.literal(true)
|
|
23534
|
+
}).strict(),
|
|
23535
|
+
external_exports.object({
|
|
23536
|
+
action: external_exports.literal("remove"),
|
|
23537
|
+
name: credentialImportNameSchema,
|
|
23538
|
+
confirmed: external_exports.literal(true)
|
|
23539
|
+
}).strict()
|
|
23540
|
+
]);
|
|
23541
|
+
var credentialOtherLoginSchema = external_exports.object({
|
|
23542
|
+
provider: external_exports.string().min(1).max(128),
|
|
23543
|
+
type: external_exports.enum(["oauth", "api_key", "unknown"]),
|
|
23544
|
+
/** Best-effort account label (e.g. the email in a Codex token), derived locally when present. */
|
|
23545
|
+
label: external_exports.string().min(1).max(512).optional(),
|
|
23546
|
+
/** Recognized credential vendor, derived from the OAuth token issuer. Absent when unknown. */
|
|
23547
|
+
vendor: external_exports.enum(["openai-codex", "xai"]).optional()
|
|
23548
|
+
}).strict();
|
|
23549
|
+
var credentialImportsResultSchema = external_exports.object({
|
|
23550
|
+
sources: external_exports.array(credentialSourceSchema),
|
|
23551
|
+
targets: external_exports.array(external_exports.object({
|
|
23552
|
+
harnessId: external_exports.string(),
|
|
23553
|
+
providers: external_exports.array(external_exports.enum(["openai-codex", "xai"])),
|
|
23554
|
+
imports: external_exports.array(credentialImportRecordSchema),
|
|
23555
|
+
others: external_exports.array(credentialOtherLoginSchema).default([])
|
|
23556
|
+
}).strict())
|
|
23557
|
+
}).strict();
|
|
23558
|
+
var credentialImportsParamsSchema = external_exports.object({
|
|
23559
|
+
targetHarnessId: external_exports.string().min(1).max(128).optional(),
|
|
23560
|
+
request: credentialImportsRequestSchema
|
|
23561
|
+
}).strict();
|
|
23562
|
+
|
|
23563
|
+
// packages/shared-contracts/dist/harness-display-settings.js
|
|
23564
|
+
var harnessDisplayCapabilitiesSchema = external_exports.object({ events: external_exports.boolean() });
|
|
23565
|
+
var harnessDisplayEntriesSchema = external_exports.array(external_exports.strictObject({
|
|
23566
|
+
agent: external_exports.string().min(1).max(128),
|
|
23567
|
+
section: external_exports.enum(["main", "more", "auto"])
|
|
23568
|
+
})).max(256).refine((entries) => new Set(entries.map((entry) => entry.agent)).size === entries.length, "Duplicate Harness IDs");
|
|
23569
|
+
var harnessDisplaySettingsSchema = external_exports.strictObject({
|
|
23570
|
+
entries: harnessDisplayEntriesSchema.nullable()
|
|
23571
|
+
});
|
|
23572
|
+
var harnessDisplayGetSchema = external_exports.strictObject({});
|
|
23573
|
+
var harnessDisplaySetSchema = external_exports.strictObject({
|
|
23574
|
+
entries: harnessDisplayEntriesSchema,
|
|
23575
|
+
/** Import legacy Desktop preferences only if no shared settings exist yet. */
|
|
23576
|
+
initializeOnly: external_exports.boolean().optional()
|
|
23577
|
+
});
|
|
23578
|
+
|
|
23579
|
+
// packages/shared-contracts/dist/idle-release.js
|
|
23580
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
23581
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
23582
|
+
var idleReleaseSettingsSchema = external_exports.strictObject({
|
|
23583
|
+
enabled: external_exports.boolean(),
|
|
23584
|
+
timeoutMinutes: external_exports.number().int().min(IDLE_RELEASE_TIMEOUT_MINUTES_MIN).max(IDLE_RELEASE_TIMEOUT_MINUTES_MAX)
|
|
23585
|
+
});
|
|
23586
|
+
var DEFAULT_IDLE_RELEASE_SETTINGS = Object.freeze({
|
|
23587
|
+
enabled: true,
|
|
23588
|
+
timeoutMinutes: 10
|
|
23589
|
+
});
|
|
23590
|
+
|
|
23591
|
+
// packages/shared-contracts/dist/harness-preferences.js
|
|
23592
|
+
var harnessPreferenceScopeSchema = external_exports.string().regex(/^external$/u);
|
|
23593
|
+
var preferenceHarnessKey = harnessIdSchema.transform((id2) => String(id2));
|
|
23594
|
+
var harnessDefaultConfigurationSchema = external_exports.strictObject({
|
|
23595
|
+
model: harnessModelRefSchema.optional(),
|
|
23294
23596
|
thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
23295
23597
|
permissionModeId: harnessPermissionModeIdSchema.optional()
|
|
23296
23598
|
}).refine((value) => Boolean(value.model || value.thinkingOptionId || value.permissionModeId), "A default configuration must contain a preference");
|
|
@@ -23806,7 +24108,7 @@ var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status"
|
|
|
23806
24108
|
|
|
23807
24109
|
// packages/shared-contracts/dist/codex-accounts.js
|
|
23808
24110
|
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
23809
|
-
var
|
|
24111
|
+
var nonBlankTextSchema4 = external_exports.string().trim().min(1);
|
|
23810
24112
|
var codexAccountPlanTypeSchema = external_exports.enum([
|
|
23811
24113
|
"free",
|
|
23812
24114
|
"go",
|
|
@@ -23828,7 +24130,7 @@ var codexAccountPlanTypeSchema = external_exports.enum([
|
|
|
23828
24130
|
]);
|
|
23829
24131
|
var codexAccountSchema = external_exports.object({
|
|
23830
24132
|
accountId: accountIdSchema,
|
|
23831
|
-
label:
|
|
24133
|
+
label: nonBlankTextSchema4.max(256),
|
|
23832
24134
|
email: external_exports.string().email().max(320).optional(),
|
|
23833
24135
|
planType: codexAccountPlanTypeSchema.optional()
|
|
23834
24136
|
}).strict();
|
|
@@ -23838,7 +24140,7 @@ var codexAccountListResultSchema = external_exports.object({
|
|
|
23838
24140
|
currentAccountId: accountIdSchema.nullable(),
|
|
23839
24141
|
phase: codexAccountPhaseSchema,
|
|
23840
24142
|
revision: external_exports.number().int().nonnegative(),
|
|
23841
|
-
instanceId:
|
|
24143
|
+
instanceId: nonBlankTextSchema4.max(1024).optional(),
|
|
23842
24144
|
accounts: external_exports.array(codexAccountSchema).max(1)
|
|
23843
24145
|
}).strict();
|
|
23844
24146
|
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
@@ -23856,13 +24158,13 @@ var HARNESS_SESSION_IMPORT_CWD_MAX_LENGTH = 16384;
|
|
|
23856
24158
|
var HARNESS_SESSION_IMPORT_TITLE_MAX_LENGTH = 4096;
|
|
23857
24159
|
var HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH = 1e3;
|
|
23858
24160
|
var HARNESS_SESSION_IMPORT_UPDATED_AT_MAX = 864e13;
|
|
23859
|
-
var
|
|
23860
|
-
var harnessSessionImportIdSchema =
|
|
24161
|
+
var nonBlankTextSchema5 = external_exports.string().refine((value) => value.trim().length > 0, "Value must not be empty or whitespace").refine((value) => !value.includes("\0"), "Value must not contain NUL");
|
|
24162
|
+
var harnessSessionImportIdSchema = nonBlankTextSchema5.max(HARNESS_SESSION_IMPORT_ID_MAX_LENGTH);
|
|
23861
24163
|
var harnessSessionImportCandidateSchema = external_exports.object({
|
|
23862
24164
|
nativeSessionId: harnessSessionImportIdSchema,
|
|
23863
|
-
title:
|
|
24165
|
+
title: nonBlankTextSchema5.max(HARNESS_SESSION_IMPORT_TITLE_MAX_LENGTH).nullable(),
|
|
23864
24166
|
updatedAt: external_exports.number().int().nonnegative().max(HARNESS_SESSION_IMPORT_UPDATED_AT_MAX),
|
|
23865
|
-
cwd:
|
|
24167
|
+
cwd: nonBlankTextSchema5.max(HARNESS_SESSION_IMPORT_CWD_MAX_LENGTH),
|
|
23866
24168
|
// Native file discovery cannot reliably observe another process's activity.
|
|
23867
24169
|
running: external_exports.boolean().nullable()
|
|
23868
24170
|
}).strict();
|
|
@@ -23870,7 +24172,7 @@ var harnessSessionImportSourcesParamsSchema = external_exports.object({}).strict
|
|
|
23870
24172
|
var harnessSessionImportSourcesResultSchema = external_exports.object({
|
|
23871
24173
|
harnesses: external_exports.array(external_exports.object({
|
|
23872
24174
|
harnessId: harnessPluginIdSchema,
|
|
23873
|
-
name:
|
|
24175
|
+
name: nonBlankTextSchema5.max(128)
|
|
23874
24176
|
}).strict()).max(128)
|
|
23875
24177
|
}).strict();
|
|
23876
24178
|
var harnessSessionListParamsSchema = external_exports.object({
|
|
@@ -23888,13 +24190,13 @@ var harnessSessionImportParamsSchema = external_exports.object({
|
|
|
23888
24190
|
nativeSessionId: harnessSessionImportIdSchema
|
|
23889
24191
|
}).strict();
|
|
23890
24192
|
var harnessSessionImportResultSchema = external_exports.object({
|
|
23891
|
-
threadId:
|
|
24193
|
+
threadId: nonBlankTextSchema5.max(1024).pipe(hostThreadIdSchema)
|
|
23892
24194
|
}).strict();
|
|
23893
24195
|
|
|
23894
24196
|
// packages/shared-contracts/dist/deepseek-modern-sessions.js
|
|
23895
24197
|
var DEEPSEEK_MODERN_SESSION_LIST_MAX_LENGTH = HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH;
|
|
23896
24198
|
var DEEPSEEK_MODERN_HOST_THREAD_ID_MAX_LENGTH = 1024;
|
|
23897
|
-
var
|
|
24199
|
+
var nonBlankTextSchema6 = external_exports.string().refine((value) => value.trim().length > 0, "Value must not be empty or whitespace").refine((value) => !value.includes("\0"), "Value must not contain NUL");
|
|
23898
24200
|
var deepSeekModernSessionIdSchema = harnessSessionImportIdSchema;
|
|
23899
24201
|
var deepSeekModernSessionCandidateSchema = harnessSessionImportCandidateSchema;
|
|
23900
24202
|
var deepSeekModernSessionListParamsSchema = external_exports.object({}).strict();
|
|
@@ -23905,7 +24207,7 @@ var deepSeekModernSessionImportParamsSchema = external_exports.object({
|
|
|
23905
24207
|
nativeSessionId: deepSeekModernSessionIdSchema
|
|
23906
24208
|
}).strict();
|
|
23907
24209
|
var deepSeekModernSessionImportResultSchema = external_exports.object({
|
|
23908
|
-
threadId:
|
|
24210
|
+
threadId: nonBlankTextSchema6.max(DEEPSEEK_MODERN_HOST_THREAD_ID_MAX_LENGTH).pipe(hostThreadIdSchema)
|
|
23909
24211
|
}).strict();
|
|
23910
24212
|
|
|
23911
24213
|
// packages/shared-contracts/dist/external-thread-fork.js
|
|
@@ -23940,9 +24242,10 @@ var harnessCommandCatalogSchema = external_exports.object({
|
|
|
23940
24242
|
/** Partial discovery failures; valid commands remain available. */
|
|
23941
24243
|
warnings: external_exports.array(external_exports.string().min(1)).optional(),
|
|
23942
24244
|
/**
|
|
23943
|
-
* `live` when
|
|
23944
|
-
* workspace (
|
|
23945
|
-
*
|
|
24245
|
+
* `live` when a native Session has reported its live catalog for the
|
|
24246
|
+
* workspace (even when filtering leaves only built-ins); `static` for
|
|
24247
|
+
* Adapter built-ins only before live commands arrive. Adapters may set
|
|
24248
|
+
* `live` once their Session's live catalog has loaded.
|
|
23946
24249
|
*/
|
|
23947
24250
|
source: external_exports.enum(["live", "static"]).optional()
|
|
23948
24251
|
}).strict().superRefine((catalog, context) => {
|
|
@@ -24069,6 +24372,13 @@ var updatePhaseSchema = external_exports.enum([
|
|
|
24069
24372
|
"succeeded",
|
|
24070
24373
|
"failed"
|
|
24071
24374
|
]);
|
|
24375
|
+
var npmDownloadProgressSchema = external_exports.strictObject({
|
|
24376
|
+
completed: external_exports.number().int().nonnegative(),
|
|
24377
|
+
total: external_exports.number().int().positive()
|
|
24378
|
+
}).refine((progress) => progress.completed <= progress.total, {
|
|
24379
|
+
path: ["completed"],
|
|
24380
|
+
message: "completed must not exceed total"
|
|
24381
|
+
});
|
|
24072
24382
|
var updateStatusSchema = external_exports.strictObject({
|
|
24073
24383
|
version: updateSemanticVersionSchema,
|
|
24074
24384
|
installation: updateInstallationSchema,
|
|
@@ -24076,6 +24386,7 @@ var updateStatusSchema = external_exports.strictObject({
|
|
|
24076
24386
|
updatedAt: external_exports.number().int().nonnegative(),
|
|
24077
24387
|
downloadedBytes: external_exports.number().int().nonnegative().optional(),
|
|
24078
24388
|
totalBytes: external_exports.number().int().positive().optional(),
|
|
24389
|
+
npmDownload: npmDownloadProgressSchema.optional(),
|
|
24079
24390
|
error: external_exports.string().min(1).max(UPDATE_ERROR_MAX_LENGTH).nullable(),
|
|
24080
24391
|
serviceStopOutput: external_exports.string().optional()
|
|
24081
24392
|
}).superRefine((status, context) => {
|
|
@@ -24294,7 +24605,8 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
|
24294
24605
|
kind: external_exports.literal("start"),
|
|
24295
24606
|
itemId: identity,
|
|
24296
24607
|
onlyIfHead: external_exports.literal(true).optional()
|
|
24297
|
-
})
|
|
24608
|
+
}),
|
|
24609
|
+
external_exports.strictObject({ kind: external_exports.literal("sendNow"), itemId: identity })
|
|
24298
24610
|
])
|
|
24299
24611
|
}),
|
|
24300
24612
|
external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
|
|
@@ -24378,240 +24690,154 @@ var localizedTextSchema2 = external_exports.union([
|
|
|
24378
24690
|
var webUiExtensionMetaSchema = external_exports.object({
|
|
24379
24691
|
title: localizedTextSchema2.optional(),
|
|
24380
24692
|
description: localizedTextSchema2.optional(),
|
|
24381
|
-
icon: external_exports.string().max(Math.ceil(256 * 1024 / 3) * 4 + 64).regex(/^data:image\/(?:svg\+xml|png|jpeg|webp);base64,[A-Za-z0-9+/]*={0,2}$/u).optional(),
|
|
24382
|
-
error: external_exports.string().optional()
|
|
24383
|
-
});
|
|
24384
|
-
var webUiExtensionSchema = external_exports.object({
|
|
24385
|
-
id: webUiExtensionIdSchema,
|
|
24386
|
-
name: external_exports.string().min(1).max(214),
|
|
24387
|
-
version: external_exports.string().min(1).max(128),
|
|
24388
|
-
format: external_exports.literal("dsh"),
|
|
24389
|
-
supportedTargets: external_exports.tuple([external_exports.literal("web")]),
|
|
24390
|
-
enabledTargets: external_exports.array(external_exports.literal("web")).max(1),
|
|
24391
|
-
source: external_exports.string().min(1).max(4096),
|
|
24392
|
-
/** Public project page, derived from installed package metadata and its source. */
|
|
24393
|
-
projectUrl: external_exports.string().max(4096).url({ protocol: /^https?$/u }).optional(),
|
|
24394
|
-
installedAt: external_exports.string(),
|
|
24395
|
-
meta: webUiExtensionMetaSchema.optional(),
|
|
24396
|
-
loadError: external_exports.string().optional()
|
|
24397
|
-
});
|
|
24398
|
-
var webUiExtensionsStateSchema = external_exports.object({
|
|
24399
|
-
extensions: external_exports.array(webUiExtensionSchema),
|
|
24400
|
-
loadedIds: external_exports.array(webUiExtensionIdSchema),
|
|
24401
|
-
safeMode: external_exports.boolean(),
|
|
24402
|
-
storeError: external_exports.string().optional()
|
|
24403
|
-
});
|
|
24404
|
-
var webUiExtensionRegistrySchema = external_exports.string().trim().max(2048).url({ protocol: /^https?$/u, normalize: true }).refine((value) => !/[\s\\?#]/u.test(value) && !value.split("/")[2]?.includes("@"), "Use an HTTP(S) registry URL without credentials, a query, or a fragment.").transform((value) => value.endsWith("/") ? value : `${value}/`);
|
|
24405
|
-
var webUiExtensionInstallSchema = external_exports.object({
|
|
24406
|
-
spec: external_exports.string().trim().min(1).max(4096),
|
|
24407
|
-
registry: webUiExtensionRegistrySchema.optional()
|
|
24408
|
-
}).strict();
|
|
24409
|
-
var webUiExtensionEnabledSchema = external_exports.object({ id: webUiExtensionIdSchema, enabled: external_exports.boolean() }).strict();
|
|
24410
|
-
var webUiExtensionRemoveSchema = external_exports.object({ id: webUiExtensionIdSchema }).strict();
|
|
24411
|
-
|
|
24412
|
-
// packages/shared-contracts/dist/remote-peers.js
|
|
24413
|
-
var REMOTE_PEER_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/u;
|
|
24414
|
-
var remotePeerIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
24415
|
-
var remotePeerHostIdSchema = external_exports.string().regex(/^remote-peer:[a-zA-Z0-9_-]{1,64}$/u);
|
|
24416
|
-
var remotePeerTransportKindSchema = external_exports.enum(["relay", "tailscale", "lan", "custom"]);
|
|
24417
|
-
var REMOTE_PEER_COLORS = [
|
|
24418
|
-
"blue",
|
|
24419
|
-
"purple",
|
|
24420
|
-
"cyan",
|
|
24421
|
-
"green",
|
|
24422
|
-
"amber",
|
|
24423
|
-
"rose",
|
|
24424
|
-
"slate"
|
|
24425
|
-
];
|
|
24426
|
-
var remotePeerColorSchema = external_exports.enum(REMOTE_PEER_COLORS);
|
|
24427
|
-
var REMOTE_PEER_COLOR_SET = new Set(REMOTE_PEER_COLORS);
|
|
24428
|
-
var remotePeerStateSchema = external_exports.enum([
|
|
24429
|
-
"connected",
|
|
24430
|
-
"connecting",
|
|
24431
|
-
"auth-error",
|
|
24432
|
-
"offline",
|
|
24433
|
-
"disabled"
|
|
24434
|
-
]);
|
|
24435
|
-
var remotePeerSummarySchema = external_exports.object({
|
|
24436
|
-
peerId: remotePeerIdSchema,
|
|
24437
|
-
hostId: remotePeerHostIdSchema,
|
|
24438
|
-
name: external_exports.string().min(1).max(120),
|
|
24439
|
-
color: remotePeerColorSchema.optional(),
|
|
24440
|
-
origin: external_exports.string().min(1).max(2048),
|
|
24441
|
-
transportKind: remotePeerTransportKindSchema,
|
|
24442
|
-
encrypted: external_exports.boolean(),
|
|
24443
|
-
enabled: external_exports.boolean(),
|
|
24444
|
-
state: remotePeerStateSchema,
|
|
24445
|
-
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
24446
|
-
version: external_exports.string().max(128).optional(),
|
|
24447
|
-
platform: external_exports.string().max(64).optional(),
|
|
24448
|
-
hostname: external_exports.string().max(255).optional(),
|
|
24449
|
-
homeDir: external_exports.string().max(4096).optional(),
|
|
24450
|
-
lastError: external_exports.string().max(1e3).optional(),
|
|
24451
|
-
projectCount: external_exports.number().int().nonnegative(),
|
|
24452
|
-
createdAt: external_exports.string(),
|
|
24453
|
-
updatedAt: external_exports.string()
|
|
24454
|
-
});
|
|
24455
|
-
var remotePeerListResultSchema = external_exports.object({
|
|
24456
|
-
peers: external_exports.array(remotePeerSummarySchema)
|
|
24457
|
-
});
|
|
24458
|
-
var remotePeerAddParamsSchema = external_exports.object({
|
|
24459
|
-
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
24460
|
-
origin: external_exports.string().min(1).max(2048).optional(),
|
|
24461
|
-
token: external_exports.string().min(1).max(2048).optional(),
|
|
24462
|
-
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
24463
|
-
color: remotePeerColorSchema.optional()
|
|
24464
|
-
}).refine((input3) => Boolean(input3.connectionUrl) || Boolean(input3.origin) && Boolean(input3.token), "Provide either connectionUrl or both origin and token");
|
|
24465
|
-
var remotePeerUpdateParamsSchema = external_exports.object({
|
|
24466
|
-
peerId: remotePeerIdSchema,
|
|
24467
|
-
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
24468
|
-
color: remotePeerColorSchema.nullable().optional(),
|
|
24469
|
-
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
24470
|
-
origin: external_exports.string().min(1).max(2048).optional(),
|
|
24471
|
-
token: external_exports.string().min(1).max(2048).optional(),
|
|
24472
|
-
enabled: external_exports.boolean().optional()
|
|
24473
|
-
});
|
|
24474
|
-
var remotePeerIdParamsSchema = external_exports.object({
|
|
24475
|
-
peerId: remotePeerIdSchema
|
|
24476
|
-
});
|
|
24477
|
-
var remotePeerRemoveResultSchema = external_exports.object({
|
|
24478
|
-
removed: external_exports.boolean()
|
|
24479
|
-
});
|
|
24480
|
-
var remotePeerTestParamsSchema = external_exports.object({
|
|
24481
|
-
peerId: remotePeerIdSchema.optional(),
|
|
24482
|
-
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
24483
|
-
origin: external_exports.string().min(1).max(2048).optional(),
|
|
24484
|
-
token: external_exports.string().min(1).max(2048).optional()
|
|
24485
|
-
}).refine((input3) => Boolean(input3.peerId) || Boolean(input3.connectionUrl) || Boolean(input3.origin) && Boolean(input3.token), "Provide peerId, connectionUrl, or both origin and token");
|
|
24486
|
-
var remotePeerTestProjectSchema = external_exports.object({
|
|
24487
|
-
id: external_exports.string().min(1).max(1024),
|
|
24488
|
-
name: external_exports.string().min(1).max(512),
|
|
24489
|
-
path: external_exports.string().min(1).max(8192)
|
|
24490
|
-
});
|
|
24491
|
-
var remotePeerTestResultSchema = external_exports.object({
|
|
24492
|
-
ok: external_exports.boolean(),
|
|
24493
|
-
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
24494
|
-
origin: external_exports.string().max(2048).optional(),
|
|
24495
|
-
transportKind: remotePeerTransportKindSchema.optional(),
|
|
24496
|
-
encrypted: external_exports.boolean().optional(),
|
|
24497
|
-
version: external_exports.string().max(128).optional(),
|
|
24498
|
-
platform: external_exports.string().max(64).optional(),
|
|
24499
|
-
hostname: external_exports.string().max(255).optional(),
|
|
24500
|
-
homeDir: external_exports.string().max(4096).optional(),
|
|
24501
|
-
projectCount: external_exports.number().int().nonnegative().optional(),
|
|
24502
|
-
projects: external_exports.array(remotePeerTestProjectSchema).optional(),
|
|
24503
|
-
error: external_exports.string().max(1e3).optional()
|
|
24504
|
-
});
|
|
24505
|
-
var remotePeerManifestProjectSchema = external_exports.object({
|
|
24506
|
-
id: external_exports.string().min(1).max(1024),
|
|
24507
|
-
name: external_exports.string().min(1).max(512),
|
|
24508
|
-
path: external_exports.string().min(1).max(8192),
|
|
24509
|
-
threadIds: external_exports.array(external_exports.string().min(1).max(1024))
|
|
24510
|
-
});
|
|
24511
|
-
var remotePeerCapabilitiesSchema = external_exports.object({
|
|
24512
|
-
/** /api/peer/v1/uploads, /api/peer/v1/prompt, and /api/peer/v1/file are all available. */
|
|
24513
|
-
attachments: external_exports.literal(1).optional(),
|
|
24514
|
-
/** /api/peer/v1/workspace-files/rpc and /api/peer/v1/workspace-files/download are available. */
|
|
24515
|
-
workspaceFiles: external_exports.literal(1).optional(),
|
|
24516
|
-
/** Peer supports officeToPdf/render over /api/peer/v1/workspace-files/rpc. */
|
|
24517
|
-
officePreview: external_exports.literal(1).optional()
|
|
24518
|
-
});
|
|
24519
|
-
var remotePeerManifestSchema = external_exports.object({
|
|
24520
|
-
version: external_exports.string().max(128),
|
|
24521
|
-
platform: external_exports.string().max(64),
|
|
24522
|
-
hostname: external_exports.string().max(255),
|
|
24523
|
-
homeDir: external_exports.string().max(4096).optional(),
|
|
24524
|
-
epoch: external_exports.string().min(1).max(256),
|
|
24525
|
-
projects: external_exports.array(remotePeerManifestProjectSchema),
|
|
24526
|
-
capabilities: remotePeerCapabilitiesSchema.optional()
|
|
24527
|
-
});
|
|
24528
|
-
var REMOTE_PEER_UPLOAD_SCOPE_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u;
|
|
24529
|
-
var remotePeerPromptParamsSchema = external_exports.strictObject({
|
|
24530
|
-
threadId: external_exports.string().min(1).max(1024),
|
|
24531
|
-
scope: external_exports.string().regex(REMOTE_PEER_UPLOAD_SCOPE_PATTERN).optional(),
|
|
24532
|
-
requestId: external_exports.string().min(1).max(256).optional(),
|
|
24533
|
-
mode: external_exports.enum(["queue", "steer"]).optional(),
|
|
24534
|
-
expectedTurnId: external_exports.string().min(1).max(1024).nullable().optional(),
|
|
24535
|
-
content: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
24536
|
-
external_exports.strictObject({ type: external_exports.literal("text"), text: external_exports.string() }),
|
|
24537
|
-
external_exports.strictObject({ type: external_exports.literal("file"), receiptId: external_exports.string().min(1).max(128) })
|
|
24538
|
-
])).min(1).max(64)
|
|
24539
|
-
});
|
|
24540
|
-
var remotePeerErrorEnvelopeSchema = external_exports.object({
|
|
24541
|
-
ok: external_exports.literal(false),
|
|
24542
|
-
error: external_exports.object({
|
|
24543
|
-
code: external_exports.string(),
|
|
24544
|
-
message: external_exports.string(),
|
|
24545
|
-
details: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
24546
|
-
})
|
|
24547
|
-
});
|
|
24548
|
-
var remotePeerUploadResultSchema = external_exports.union([
|
|
24549
|
-
external_exports.object({
|
|
24550
|
-
ok: external_exports.literal(true),
|
|
24551
|
-
value: external_exports.object({
|
|
24552
|
-
receiptId: external_exports.string().min(1),
|
|
24553
|
-
file: external_exports.object({
|
|
24554
|
-
attachmentId: external_exports.string(),
|
|
24555
|
-
name: external_exports.string(),
|
|
24556
|
-
bytes: external_exports.number().int().nonnegative()
|
|
24557
|
-
})
|
|
24558
|
-
})
|
|
24559
|
-
}),
|
|
24560
|
-
remotePeerErrorEnvelopeSchema
|
|
24561
|
-
]);
|
|
24562
|
-
var remotePeerPromptResultSchema = external_exports.union([
|
|
24563
|
-
external_exports.object({
|
|
24564
|
-
ok: external_exports.literal(true),
|
|
24565
|
-
value: external_exports.object({ accepted: external_exports.literal(true) })
|
|
24566
|
-
}),
|
|
24567
|
-
remotePeerErrorEnvelopeSchema
|
|
24568
|
-
]);
|
|
24569
|
-
var remotePeerDirectoryEntrySchema = external_exports.object({
|
|
24570
|
-
name: external_exports.string().min(1).max(512),
|
|
24571
|
-
path: external_exports.string().min(1).max(8192),
|
|
24572
|
-
kind: external_exports.literal("directory")
|
|
24573
|
-
});
|
|
24574
|
-
var remotePeerListDirsParamsSchema = external_exports.object({
|
|
24575
|
-
peerId: remotePeerIdSchema,
|
|
24576
|
-
path: external_exports.string().min(1).max(8192).optional()
|
|
24577
|
-
});
|
|
24578
|
-
var remotePeerListDirsResultSchema = external_exports.object({
|
|
24579
|
-
path: external_exports.string().min(1).max(8192),
|
|
24580
|
-
parentPath: external_exports.string().min(1).max(8192).nullable(),
|
|
24581
|
-
homeDir: external_exports.string().min(1).max(8192).optional(),
|
|
24582
|
-
entries: external_exports.array(remotePeerDirectoryEntrySchema)
|
|
24583
|
-
});
|
|
24584
|
-
var remotePeerCreateDirParamsSchema = external_exports.object({
|
|
24585
|
-
peerId: remotePeerIdSchema,
|
|
24586
|
-
parentPath: external_exports.string().min(1).max(8192),
|
|
24587
|
-
name: external_exports.string().min(1).max(255).refine((value) => value.trim().length > 0, "Directory name cannot be blank")
|
|
24588
|
-
});
|
|
24589
|
-
var remotePeerCreateDirResultSchema = external_exports.object({
|
|
24590
|
-
path: external_exports.string().min(1).max(8192),
|
|
24591
|
-
name: external_exports.string().min(1).max(255)
|
|
24592
|
-
});
|
|
24593
|
-
var remotePeerCreateWorkspaceParamsSchema = external_exports.object({
|
|
24594
|
-
peerId: remotePeerIdSchema,
|
|
24595
|
-
path: external_exports.string().min(1).max(8192),
|
|
24596
|
-
title: external_exports.string().trim().min(1).max(255).optional()
|
|
24597
|
-
});
|
|
24598
|
-
var remotePeerRenameWorkspaceParamsSchema = external_exports.object({
|
|
24599
|
-
peerId: remotePeerIdSchema,
|
|
24600
|
-
workspaceId: external_exports.string().min(1).max(1024),
|
|
24601
|
-
title: external_exports.string().trim().min(1).max(255)
|
|
24693
|
+
icon: external_exports.string().max(Math.ceil(256 * 1024 / 3) * 4 + 64).regex(/^data:image\/(?:svg\+xml|png|jpeg|webp);base64,[A-Za-z0-9+/]*={0,2}$/u).optional(),
|
|
24694
|
+
error: external_exports.string().optional()
|
|
24602
24695
|
});
|
|
24603
|
-
var
|
|
24604
|
-
|
|
24605
|
-
|
|
24696
|
+
var webUiExtensionSchema = external_exports.object({
|
|
24697
|
+
id: webUiExtensionIdSchema,
|
|
24698
|
+
name: external_exports.string().min(1).max(214),
|
|
24699
|
+
version: external_exports.string().min(1).max(128),
|
|
24700
|
+
format: external_exports.literal("dsh"),
|
|
24701
|
+
supportedTargets: external_exports.tuple([external_exports.literal("web")]),
|
|
24702
|
+
enabledTargets: external_exports.array(external_exports.literal("web")).max(1),
|
|
24703
|
+
source: external_exports.string().min(1).max(4096),
|
|
24704
|
+
/** Public project page, derived from installed package metadata and its source. */
|
|
24705
|
+
projectUrl: external_exports.string().max(4096).url({ protocol: /^https?$/u }).optional(),
|
|
24706
|
+
installedAt: external_exports.string(),
|
|
24707
|
+
meta: webUiExtensionMetaSchema.optional(),
|
|
24708
|
+
loadError: external_exports.string().optional()
|
|
24606
24709
|
});
|
|
24607
|
-
var
|
|
24608
|
-
|
|
24609
|
-
|
|
24710
|
+
var webUiExtensionsStateSchema = external_exports.object({
|
|
24711
|
+
extensions: external_exports.array(webUiExtensionSchema),
|
|
24712
|
+
loadedIds: external_exports.array(webUiExtensionIdSchema),
|
|
24713
|
+
safeMode: external_exports.boolean(),
|
|
24714
|
+
storeError: external_exports.string().optional()
|
|
24610
24715
|
});
|
|
24716
|
+
var webUiExtensionRegistrySchema = external_exports.string().trim().max(2048).url({ protocol: /^https?$/u, normalize: true }).refine((value) => !/[\s\\?#]/u.test(value) && !value.split("/")[2]?.includes("@"), "Use an HTTP(S) registry URL without credentials, a query, or a fragment.").transform((value) => value.endsWith("/") ? value : `${value}/`);
|
|
24717
|
+
var webUiExtensionInstallSchema = external_exports.object({
|
|
24718
|
+
spec: external_exports.string().trim().min(1).max(4096),
|
|
24719
|
+
registry: webUiExtensionRegistrySchema.optional()
|
|
24720
|
+
}).strict();
|
|
24721
|
+
var webUiExtensionEnabledSchema = external_exports.object({ id: webUiExtensionIdSchema, enabled: external_exports.boolean() }).strict();
|
|
24722
|
+
var webUiExtensionRemoveSchema = external_exports.object({ id: webUiExtensionIdSchema }).strict();
|
|
24611
24723
|
|
|
24612
24724
|
// packages/shared-contracts/dist/index.js
|
|
24613
24725
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
24614
24726
|
|
|
24727
|
+
// packages/update-manager/dist/status.js
|
|
24728
|
+
var STATUS_SCHEMA_VERSION = 1;
|
|
24729
|
+
var SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/u;
|
|
24730
|
+
function requireSemanticVersion(value) {
|
|
24731
|
+
if (!SEMVER_PATTERN.test(value))
|
|
24732
|
+
throw new Error("update version must be valid semantic version");
|
|
24733
|
+
return value;
|
|
24734
|
+
}
|
|
24735
|
+
function parseUpdateStatus(value) {
|
|
24736
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
24737
|
+
throw new Error("background update status must be an object");
|
|
24738
|
+
}
|
|
24739
|
+
const status = value;
|
|
24740
|
+
const allowed = [
|
|
24741
|
+
"downloadedBytes",
|
|
24742
|
+
"error",
|
|
24743
|
+
"installation",
|
|
24744
|
+
"npmDownload",
|
|
24745
|
+
"phase",
|
|
24746
|
+
"schemaVersion",
|
|
24747
|
+
"serviceStopOutput",
|
|
24748
|
+
"totalBytes",
|
|
24749
|
+
"updatedAt",
|
|
24750
|
+
"version"
|
|
24751
|
+
];
|
|
24752
|
+
if (Object.keys(status).some((key) => !allowed.includes(key))) {
|
|
24753
|
+
throw new Error("background update status contains unknown fields");
|
|
24754
|
+
}
|
|
24755
|
+
if (status.schemaVersion !== STATUS_SCHEMA_VERSION || typeof status.version !== "string" || !SEMVER_PATTERN.test(status.version) || !["npm", "windows-installer", "macos-dmg", "linux-archive"].includes(String(status.installation)) || ![
|
|
24756
|
+
"prepared",
|
|
24757
|
+
"downloading",
|
|
24758
|
+
"waiting-for-exit",
|
|
24759
|
+
"installing",
|
|
24760
|
+
"restarting",
|
|
24761
|
+
"succeeded",
|
|
24762
|
+
"failed"
|
|
24763
|
+
].includes(String(status.phase)) || !Number.isSafeInteger(status.updatedAt) || status.downloadedBytes !== void 0 && (typeof status.downloadedBytes !== "number" || !Number.isSafeInteger(status.downloadedBytes) || status.downloadedBytes < 0) || status.totalBytes !== void 0 && (typeof status.totalBytes !== "number" || !Number.isSafeInteger(status.totalBytes) || status.totalBytes <= 0) || typeof status.downloadedBytes === "number" && typeof status.totalBytes === "number" && status.downloadedBytes > status.totalBytes || status.npmDownload !== void 0 && !npmDownloadProgressSchema.safeParse(status.npmDownload).success || status.error !== void 0 && typeof status.error !== "string" || status.serviceStopOutput !== void 0 && typeof status.serviceStopOutput !== "string") {
|
|
24764
|
+
throw new Error("background update status is invalid");
|
|
24765
|
+
}
|
|
24766
|
+
return status;
|
|
24767
|
+
}
|
|
24768
|
+
|
|
24769
|
+
// packages/update-manager/dist/distribution.js
|
|
24770
|
+
var UPDATE_RUNTIME_ENV = Object.freeze({
|
|
24771
|
+
launcherPid: "CODEXHOST_LAUNCHER_PID",
|
|
24772
|
+
launcherExecutable: "CODEXHOST_LAUNCHER_EXECUTABLE",
|
|
24773
|
+
runtimeDescriptorPath: "CODEXHOST_RUNTIME_DESCRIPTOR_PATH",
|
|
24774
|
+
controllerPort: "CODEXHOST_CONTROL_PORT",
|
|
24775
|
+
controllerNonce: "CODEXHOST_CONTROL_NONCE",
|
|
24776
|
+
npmNodePath: "CODEXHOST_NPM_NODE_PATH",
|
|
24777
|
+
npmCliPath: "CODEXHOST_NPM_CLI_PATH",
|
|
24778
|
+
npmLauncherPath: "CODEXHOST_NPM_LAUNCHER_PATH",
|
|
24779
|
+
npmPackageRoot: "CODEXHOST_NPM_PACKAGE_ROOT",
|
|
24780
|
+
serviceManaged: "CODEXHOST_UPDATE_SERVICE"
|
|
24781
|
+
});
|
|
24782
|
+
function object2(value, label) {
|
|
24783
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
24784
|
+
throw new Error(`${label} must be an object`);
|
|
24785
|
+
}
|
|
24786
|
+
return value;
|
|
24787
|
+
}
|
|
24788
|
+
function parseDistributionMetadata(value) {
|
|
24789
|
+
const metadata = object2(value, "distribution metadata");
|
|
24790
|
+
const allowed = ["distribution", "schemaVersion", "target", "version"];
|
|
24791
|
+
if (Object.keys(metadata).some((key) => !allowed.includes(key))) {
|
|
24792
|
+
throw new Error("distribution metadata contains unknown fields");
|
|
24793
|
+
}
|
|
24794
|
+
if (metadata.schemaVersion !== 1 || metadata.distribution !== "npm" && metadata.distribution !== "installer" || ![
|
|
24795
|
+
"macos-arm64",
|
|
24796
|
+
"macos-x64",
|
|
24797
|
+
"windows-x64",
|
|
24798
|
+
"windows-arm64",
|
|
24799
|
+
"linux-x64",
|
|
24800
|
+
"linux-arm64"
|
|
24801
|
+
].includes(String(metadata.target)) || typeof metadata.version !== "string") {
|
|
24802
|
+
throw new Error("distribution metadata is invalid");
|
|
24803
|
+
}
|
|
24804
|
+
return {
|
|
24805
|
+
schemaVersion: 1,
|
|
24806
|
+
version: requireSemanticVersion(metadata.version),
|
|
24807
|
+
distribution: metadata.distribution,
|
|
24808
|
+
target: metadata.target
|
|
24809
|
+
};
|
|
24810
|
+
}
|
|
24811
|
+
function defaultUpdateStateDirectory(platform = process.platform, environment = process.env) {
|
|
24812
|
+
if (platform === "win32") {
|
|
24813
|
+
const root = environment.LOCALAPPDATA;
|
|
24814
|
+
if (!root || !path.isAbsolute(root))
|
|
24815
|
+
throw new Error("LOCALAPPDATA is unavailable");
|
|
24816
|
+
return path.join(root, "codexhost", "updates");
|
|
24817
|
+
}
|
|
24818
|
+
const home = environment.HOME;
|
|
24819
|
+
if (!home || !path.isAbsolute(home))
|
|
24820
|
+
throw new Error("HOME is unavailable");
|
|
24821
|
+
return platform === "darwin" ? path.join(home, "Library", "Application Support", "codexhost", "updates") : path.join(home, ".codexhost", "updates");
|
|
24822
|
+
}
|
|
24823
|
+
|
|
24824
|
+
// packages/update-manager/dist/runtime-metadata.js
|
|
24825
|
+
async function readRuntimeMetadata(entryPath2, environment = process.env) {
|
|
24826
|
+
const directory = path2.dirname(entryPath2);
|
|
24827
|
+
try {
|
|
24828
|
+
return parseDistributionMetadata(JSON.parse(await readFile(path2.join(directory, "codexhost-distribution.json"), "utf8")));
|
|
24829
|
+
} catch (error62) {
|
|
24830
|
+
if (path2.basename(directory) !== "dist" || path2.basename(path2.resolve(directory, "../..")) !== "packages")
|
|
24831
|
+
throw error62;
|
|
24832
|
+
const workspace = JSON.parse(await readFile(path2.resolve(directory, "../../../package.json"), "utf8"));
|
|
24833
|
+
if (workspace.name !== "codexhost" || typeof workspace.version !== "string")
|
|
24834
|
+
throw error62;
|
|
24835
|
+
const workspaceVersion = requireSemanticVersion(workspace.version);
|
|
24836
|
+
const version2 = environment.CODEXHOST_DEV_VERSION === void 0 ? `${workspaceVersion}-dev` : requireSemanticVersion(environment.CODEXHOST_DEV_VERSION);
|
|
24837
|
+
return { version: version2, distribution: "development" };
|
|
24838
|
+
}
|
|
24839
|
+
}
|
|
24840
|
+
|
|
24615
24841
|
// packages/update-manager/dist/release-announcement.js
|
|
24616
24842
|
var graphemes = new Intl.Segmenter();
|
|
24617
24843
|
|
|
@@ -24794,13 +25020,21 @@ async function releaseInstallable(target2, run2) {
|
|
|
24794
25020
|
}
|
|
24795
25021
|
return true;
|
|
24796
25022
|
}
|
|
24797
|
-
async function prefetchNpmRelease(target2, run2 = runNpmCommand) {
|
|
24798
|
-
const
|
|
24799
|
-
|
|
24800
|
-
|
|
24801
|
-
|
|
24802
|
-
|
|
24803
|
-
|
|
25023
|
+
async function prefetchNpmRelease(target2, run2 = runNpmCommand, onProgress) {
|
|
25024
|
+
const specs = npmReleasePackages(target2.packageRoot, target2.version);
|
|
25025
|
+
const deadline = Date.now() + PREFETCH_TIMEOUT_MS;
|
|
25026
|
+
await onProgress?.({ completed: 0, total: specs.length });
|
|
25027
|
+
for (const [index, spec] of specs.entries()) {
|
|
25028
|
+
const remaining = deadline - Date.now();
|
|
25029
|
+
if (remaining <= 0)
|
|
25030
|
+
throw new Error("npm update download timed out");
|
|
25031
|
+
const result = await run2(target2, ["cache", "add", spec], remaining);
|
|
25032
|
+
if (missingFromRegistry(result) && result.code !== 0)
|
|
25033
|
+
throw new Error(`npm registry does not have codexhost ${target2.version} yet; retry later`);
|
|
25034
|
+
if (result.code !== 0)
|
|
25035
|
+
throw new Error(`npm could not download the update: ${firstErrorLine(result)}`);
|
|
25036
|
+
await onProgress?.({ completed: index + 1, total: specs.length });
|
|
25037
|
+
}
|
|
24804
25038
|
}
|
|
24805
25039
|
function createNpmReleaseAvailability(run2 = runNpmCommand, now = Date.now) {
|
|
24806
25040
|
const answers = /* @__PURE__ */ new Map();
|
|
@@ -25305,7 +25539,7 @@ function createBackgroundUpdateManager(dependencies = {}) {
|
|
|
25305
25539
|
const randomId = dependencies.randomId ?? randomUUID2;
|
|
25306
25540
|
const download2 = dependencies.download ?? downloadArtifact;
|
|
25307
25541
|
const spawnUpdater = dependencies.spawnUpdater ?? defaultSpawnUpdater;
|
|
25308
|
-
const prefetchNpm = dependencies.prefetchNpm ?? ((target2) => prefetchNpmRelease(target2));
|
|
25542
|
+
const prefetchNpm = dependencies.prefetchNpm ?? ((target2, onProgress) => prefetchNpmRelease(target2, void 0, onProgress));
|
|
25309
25543
|
const now = dependencies.now ?? Date.now;
|
|
25310
25544
|
const preparedRequests = /* @__PURE__ */ new Set();
|
|
25311
25545
|
async function writeStatusSnapshot(statusPath, status) {
|
|
@@ -25383,7 +25617,7 @@ function createBackgroundUpdateManager(dependencies = {}) {
|
|
|
25383
25617
|
await chmod(helperPath, 448);
|
|
25384
25618
|
const requestPath = path6.join(workDirectory, "request-v1.json");
|
|
25385
25619
|
const statusPath = path6.join(workDirectory, "status-v1.json");
|
|
25386
|
-
await writePrivateJson(statusPath,
|
|
25620
|
+
await writePrivateJson(statusPath, statusSnapshot(version2, installation, "downloading"));
|
|
25387
25621
|
await options.onPrepared?.({ version: version2, installation, statusPath });
|
|
25388
25622
|
return {
|
|
25389
25623
|
version: version2,
|
|
@@ -25400,11 +25634,12 @@ function createBackgroundUpdateManager(dependencies = {}) {
|
|
|
25400
25634
|
};
|
|
25401
25635
|
}
|
|
25402
25636
|
async function prepareArtifact(common, installation, sourceValue, fileName) {
|
|
25403
|
-
const source = validateArtifact(sourceValue);
|
|
25404
25637
|
const temporaryPath = path6.join(common.workDirectory, `.${fileName}.download`);
|
|
25405
25638
|
const artifactPath = path6.join(common.workDirectory, fileName);
|
|
25406
|
-
|
|
25639
|
+
let progress;
|
|
25407
25640
|
try {
|
|
25641
|
+
const source = validateArtifact(sourceValue);
|
|
25642
|
+
progress = progressReporter(common.statusPath, common.version, installation, source.size);
|
|
25408
25643
|
const result = await download2(source, temporaryPath, progress.update);
|
|
25409
25644
|
progress.update({ downloadedBytes: result.bytes, totalBytes: source.size });
|
|
25410
25645
|
await progress.flush();
|
|
@@ -25417,7 +25652,7 @@ function createBackgroundUpdateManager(dependencies = {}) {
|
|
|
25417
25652
|
return { source, artifactPath };
|
|
25418
25653
|
} catch (error62) {
|
|
25419
25654
|
await rm2(temporaryPath, { force: true });
|
|
25420
|
-
await progress
|
|
25655
|
+
await progress?.flush();
|
|
25421
25656
|
await writeFailedStatus(common.statusPath, common.version, installation, error62);
|
|
25422
25657
|
throw error62;
|
|
25423
25658
|
}
|
|
@@ -25435,8 +25670,13 @@ function createBackgroundUpdateManager(dependencies = {}) {
|
|
|
25435
25670
|
...common.dataDirectory ? { data_directory: common.dataDirectory } : {},
|
|
25436
25671
|
installation
|
|
25437
25672
|
};
|
|
25438
|
-
|
|
25439
|
-
|
|
25673
|
+
try {
|
|
25674
|
+
await writePrivateJson(common.requestPath, request);
|
|
25675
|
+
await writeStatusSnapshot(common.statusPath, statusSnapshot(common.version, installation.kind, "prepared"));
|
|
25676
|
+
} catch (error62) {
|
|
25677
|
+
await writeFailedStatus(common.statusPath, common.version, installation.kind, error62);
|
|
25678
|
+
throw error62;
|
|
25679
|
+
}
|
|
25440
25680
|
preparedRequests.add(common.requestPath);
|
|
25441
25681
|
return Object.freeze({
|
|
25442
25682
|
version: common.version,
|
|
@@ -25454,8 +25694,10 @@ function createBackgroundUpdateManager(dependencies = {}) {
|
|
|
25454
25694
|
const nodePath = await requireRegularFile(options.nodePath, "npm Node.js executable");
|
|
25455
25695
|
const npmCliPath = await requireRegularFile(options.npmCliPath, "npm CLI");
|
|
25456
25696
|
const packageRoot = requireAbsolutePath(options.packageRoot, "npm platform package root");
|
|
25457
|
-
await
|
|
25458
|
-
|
|
25697
|
+
await prefetchNpm({ nodePath, npmCliPath, packageRoot, version: common.version }, (npmDownload) => writeStatusSnapshot(common.statusPath, {
|
|
25698
|
+
...statusSnapshot(common.version, "npm", "downloading"),
|
|
25699
|
+
npmDownload
|
|
25700
|
+
}).catch(() => void 0));
|
|
25459
25701
|
return await finalize2(common, {
|
|
25460
25702
|
kind: "npm",
|
|
25461
25703
|
node_path: nodePath,
|
|
@@ -25471,23 +25713,24 @@ function createBackgroundUpdateManager(dependencies = {}) {
|
|
|
25471
25713
|
async prepareWindowsInstaller(options) {
|
|
25472
25714
|
if (platform !== "win32")
|
|
25473
25715
|
throw new Error("Windows installer updates require Windows");
|
|
25716
|
+
const installRoot = requireAbsolutePath(options.installRoot, "Windows install root");
|
|
25474
25717
|
const common = await prepareCommon(options, "windows-installer");
|
|
25475
25718
|
const artifact = await prepareArtifact(common, "windows-installer", options.artifact, "update.exe");
|
|
25476
25719
|
return finalize2(common, {
|
|
25477
25720
|
kind: "windows-installer",
|
|
25478
25721
|
installer_path: artifact.artifactPath,
|
|
25479
25722
|
artifact_sha256: artifact.source.sha256,
|
|
25480
|
-
install_root:
|
|
25723
|
+
install_root: installRoot
|
|
25481
25724
|
}, artifact.artifactPath);
|
|
25482
25725
|
},
|
|
25483
25726
|
async prepareMacOsDmg(options) {
|
|
25484
25727
|
if (platform !== "darwin")
|
|
25485
25728
|
throw new Error("macOS DMG updates require macOS");
|
|
25486
|
-
const common = await prepareCommon(options, "macos-dmg");
|
|
25487
25729
|
const appPath = requireAbsolutePath(options.appPath, "macOS application path");
|
|
25488
25730
|
if (path6.extname(appPath) !== ".app") {
|
|
25489
25731
|
throw new Error("macOS application path must end in .app");
|
|
25490
25732
|
}
|
|
25733
|
+
const common = await prepareCommon(options, "macos-dmg");
|
|
25491
25734
|
const artifact = await prepareArtifact(common, "macos-dmg", options.artifact, "update.dmg");
|
|
25492
25735
|
return finalize2(common, {
|
|
25493
25736
|
kind: "macos-dmg",
|
|
@@ -25499,13 +25742,14 @@ function createBackgroundUpdateManager(dependencies = {}) {
|
|
|
25499
25742
|
async prepareLinuxArchive(options) {
|
|
25500
25743
|
if (platform !== "linux")
|
|
25501
25744
|
throw new Error("Linux archive updates require Linux");
|
|
25745
|
+
const installRoot = requireAbsolutePath(options.installRoot, "Linux install root");
|
|
25502
25746
|
const common = await prepareCommon(options, "linux-archive");
|
|
25503
25747
|
const artifact = await prepareArtifact(common, "linux-archive", options.artifact, "update.tar.gz");
|
|
25504
25748
|
return finalize2(common, {
|
|
25505
25749
|
kind: "linux-archive",
|
|
25506
25750
|
archive_path: artifact.artifactPath,
|
|
25507
25751
|
artifact_sha256: artifact.source.sha256,
|
|
25508
|
-
install_root:
|
|
25752
|
+
install_root: installRoot
|
|
25509
25753
|
}, artifact.artifactPath);
|
|
25510
25754
|
},
|
|
25511
25755
|
async start(prepared, transferOwnership) {
|
|
@@ -25761,10 +26005,10 @@ var HarnessLaunchSettingsStore = class {
|
|
|
25761
26005
|
};
|
|
25762
26006
|
|
|
25763
26007
|
// packages/harness-plugin-files/dist/host-extension-io.js
|
|
26008
|
+
var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
|
|
25764
26009
|
import { constants } from "node:fs";
|
|
25765
|
-
import { lstat as lstat4, mkdir as mkdir4, open as open5, realpath as realpath3,
|
|
26010
|
+
import { lstat as lstat4, mkdir as mkdir4, open as open5, realpath as realpath3, rm as rm4, writeFile as writeFile4 } from "node:fs/promises";
|
|
25766
26011
|
import path10 from "node:path";
|
|
25767
|
-
var import_proper_lockfile = __toESM(require_proper_lockfile(), 1);
|
|
25768
26012
|
function extensionFileMissing(error62) {
|
|
25769
26013
|
return error62 instanceof Error && "code" in error62 && error62.code === "ENOENT";
|
|
25770
26014
|
}
|
|
@@ -25852,8 +26096,137 @@ var jpegSignature = Buffer.from([255, 216, 255]);
|
|
|
25852
26096
|
var riffSignature = Buffer.from("RIFF");
|
|
25853
26097
|
var webpSignature = Buffer.from("WEBP");
|
|
25854
26098
|
|
|
25855
|
-
// packages/harness-plugin-files/dist/
|
|
25856
|
-
import {
|
|
26099
|
+
// packages/harness-plugin-files/dist/desktop-extension-download.js
|
|
26100
|
+
import { setTimeout as delay3 } from "node:timers/promises";
|
|
26101
|
+
var githubHeaders = {
|
|
26102
|
+
accept: "application/vnd.github+json",
|
|
26103
|
+
"user-agent": "codexhost-desktop-extensions"
|
|
26104
|
+
};
|
|
26105
|
+
var DEFAULT_TIMEOUT_MS = 12e3;
|
|
26106
|
+
var DEFAULT_RETRY_BASE_DELAY_MS = 400;
|
|
26107
|
+
var RETRYABLE_HTTP_STATUSES = /* @__PURE__ */ new Set([408, 429, 500, 502, 503, 504]);
|
|
26108
|
+
var ExtensionDownloadError = class extends Error {
|
|
26109
|
+
};
|
|
26110
|
+
var ExtensionHttpError = class extends ExtensionDownloadError {
|
|
26111
|
+
status;
|
|
26112
|
+
constructor(status) {
|
|
26113
|
+
super(`Download returned HTTP ${status}`);
|
|
26114
|
+
this.status = status;
|
|
26115
|
+
}
|
|
26116
|
+
};
|
|
26117
|
+
function isRetryableDownloadError(error62) {
|
|
26118
|
+
if (error62 instanceof ExtensionHttpError)
|
|
26119
|
+
return RETRYABLE_HTTP_STATUSES.has(error62.status);
|
|
26120
|
+
return !(error62 instanceof ExtensionDownloadError);
|
|
26121
|
+
}
|
|
26122
|
+
async function downloadExtensionBytes(url2, limit, headers, { signal: callerSignal, allowUrl, timeoutMs = DEFAULT_TIMEOUT_MS, idleTimeoutMs, retries = 0, retryBaseDelayMs = DEFAULT_RETRY_BASE_DELAY_MS }) {
|
|
26123
|
+
const parsed = desktopExtensionHttpUrlSchema.safeParse(url2);
|
|
26124
|
+
if (!parsed.success)
|
|
26125
|
+
throw new ExtensionDownloadError("Expected a credential-free HTTP(S) URL");
|
|
26126
|
+
const initialTarget = new URL(parsed.data);
|
|
26127
|
+
const requestHeaders = headers ?? (isGitHubDesktopExtensionZipballUrl(initialTarget) ? githubHeaders : void 0);
|
|
26128
|
+
const effectiveIdleMs = Math.min(idleTimeoutMs ?? timeoutMs, timeoutMs);
|
|
26129
|
+
const totalTimeout = AbortSignal.timeout(timeoutMs);
|
|
26130
|
+
const overallSignal = callerSignal ? AbortSignal.any([totalTimeout, callerSignal]) : totalTimeout;
|
|
26131
|
+
for (let attempt = 0; ; attempt++) {
|
|
26132
|
+
if (callerSignal?.aborted)
|
|
26133
|
+
throw new ExtensionDownloadError("Download aborted", { cause: callerSignal.reason });
|
|
26134
|
+
if (totalTimeout.aborted)
|
|
26135
|
+
throw new ExtensionDownloadError("Download timed out", { cause: totalTimeout.reason });
|
|
26136
|
+
const attemptController = new AbortController();
|
|
26137
|
+
const signal = AbortSignal.any([overallSignal, attemptController.signal]);
|
|
26138
|
+
let idleTimedOut = false;
|
|
26139
|
+
let idleTimer;
|
|
26140
|
+
const resetIdle = () => {
|
|
26141
|
+
if (idleTimer !== void 0)
|
|
26142
|
+
clearTimeout(idleTimer);
|
|
26143
|
+
idleTimer = setTimeout(() => {
|
|
26144
|
+
idleTimedOut = true;
|
|
26145
|
+
attemptController.abort(new Error("Download timed out"));
|
|
26146
|
+
}, effectiveIdleMs);
|
|
26147
|
+
};
|
|
26148
|
+
const clearIdle = () => {
|
|
26149
|
+
if (idleTimer !== void 0) {
|
|
26150
|
+
clearTimeout(idleTimer);
|
|
26151
|
+
idleTimer = void 0;
|
|
26152
|
+
}
|
|
26153
|
+
};
|
|
26154
|
+
try {
|
|
26155
|
+
let target2 = new URL(initialTarget.href);
|
|
26156
|
+
let response;
|
|
26157
|
+
for (let redirects = 0; ; redirects++) {
|
|
26158
|
+
if (!allowUrl(target2) || target2.username || target2.password)
|
|
26159
|
+
throw new ExtensionDownloadError("Unsafe download URL");
|
|
26160
|
+
resetIdle();
|
|
26161
|
+
response = await fetch(target2.href, {
|
|
26162
|
+
signal,
|
|
26163
|
+
redirect: "manual",
|
|
26164
|
+
...requestHeaders ? { headers: requestHeaders } : {}
|
|
26165
|
+
});
|
|
26166
|
+
const location = response.headers.get("location");
|
|
26167
|
+
if (!location || ![301, 302, 303, 307, 308].includes(response.status))
|
|
26168
|
+
break;
|
|
26169
|
+
await response.body?.cancel().catch(() => void 0);
|
|
26170
|
+
if (redirects >= 4)
|
|
26171
|
+
throw new ExtensionDownloadError("Too many download redirects");
|
|
26172
|
+
try {
|
|
26173
|
+
target2 = new URL(location, target2);
|
|
26174
|
+
} catch {
|
|
26175
|
+
throw new ExtensionDownloadError("Invalid download redirect URL");
|
|
26176
|
+
}
|
|
26177
|
+
}
|
|
26178
|
+
const body = response.body;
|
|
26179
|
+
if (!response.ok || !body || Number(response.headers.get("content-length")) > limit) {
|
|
26180
|
+
await body?.cancel().catch(() => void 0);
|
|
26181
|
+
if (!response.ok)
|
|
26182
|
+
throw new ExtensionHttpError(response.status);
|
|
26183
|
+
throw new ExtensionDownloadError("Download is empty or exceeds the size limit");
|
|
26184
|
+
}
|
|
26185
|
+
const reader = body.getReader();
|
|
26186
|
+
const chunks = [];
|
|
26187
|
+
let size = 0;
|
|
26188
|
+
try {
|
|
26189
|
+
for (; ; ) {
|
|
26190
|
+
resetIdle();
|
|
26191
|
+
const { done, value } = await reader.read();
|
|
26192
|
+
if (done)
|
|
26193
|
+
break;
|
|
26194
|
+
size += value.byteLength;
|
|
26195
|
+
if (size > limit)
|
|
26196
|
+
throw new ExtensionDownloadError("Download exceeds the size limit");
|
|
26197
|
+
chunks.push(value);
|
|
26198
|
+
}
|
|
26199
|
+
} finally {
|
|
26200
|
+
clearIdle();
|
|
26201
|
+
await reader.cancel().catch(() => void 0);
|
|
26202
|
+
}
|
|
26203
|
+
return Buffer.concat(chunks, size);
|
|
26204
|
+
} catch (error62) {
|
|
26205
|
+
clearIdle();
|
|
26206
|
+
if (callerSignal?.aborted)
|
|
26207
|
+
throw new ExtensionDownloadError("Download aborted", { cause: callerSignal.reason });
|
|
26208
|
+
if (totalTimeout.aborted)
|
|
26209
|
+
throw new ExtensionDownloadError("Download timed out", { cause: totalTimeout.reason });
|
|
26210
|
+
if (attempt < retries && isRetryableDownloadError(error62)) {
|
|
26211
|
+
const waitMs = retryBaseDelayMs * 2 ** attempt;
|
|
26212
|
+
try {
|
|
26213
|
+
if (waitMs > 0)
|
|
26214
|
+
await delay3(waitMs, void 0, { signal: overallSignal });
|
|
26215
|
+
} catch (delayError) {
|
|
26216
|
+
if (callerSignal?.aborted)
|
|
26217
|
+
throw new ExtensionDownloadError("Download aborted", { cause: callerSignal.reason });
|
|
26218
|
+
throw new ExtensionDownloadError("Download timed out", { cause: delayError });
|
|
26219
|
+
}
|
|
26220
|
+
continue;
|
|
26221
|
+
}
|
|
26222
|
+
if (error62 instanceof ExtensionDownloadError)
|
|
26223
|
+
throw error62;
|
|
26224
|
+
throw new ExtensionDownloadError(idleTimedOut ? "Download timed out" : "Download failed", {
|
|
26225
|
+
cause: error62
|
|
26226
|
+
});
|
|
26227
|
+
}
|
|
26228
|
+
}
|
|
26229
|
+
}
|
|
25857
26230
|
|
|
25858
26231
|
// packages/harness-plugin-files/dist/host-extension-package.js
|
|
25859
26232
|
import { createHash as createHash2 } from "node:crypto";
|
|
@@ -25947,6 +26320,7 @@ async function validateHostPackageEntries(manifest, read) {
|
|
|
25947
26320
|
}
|
|
25948
26321
|
|
|
25949
26322
|
// packages/harness-plugin-files/dist/host-extension-files.js
|
|
26323
|
+
import { mkdir as mkdir5, mkdtemp, readdir as readdir3, rm as rm5, writeFile as writeFile5 } from "node:fs/promises";
|
|
25950
26324
|
var ACTIVE = "active.json";
|
|
25951
26325
|
var ENABLED = "enabled.json";
|
|
25952
26326
|
var activeFields = hostExtensionInstallationSchema.omit({ manifest: true, id: true });
|
|
@@ -26040,78 +26414,6 @@ async function discoverHostExtensions(dataDir) {
|
|
|
26040
26414
|
return { configuration, installations, extensions, diagnostics };
|
|
26041
26415
|
}
|
|
26042
26416
|
|
|
26043
|
-
// packages/harness-plugin-files/dist/desktop-extension-download.js
|
|
26044
|
-
var githubHeaders = {
|
|
26045
|
-
accept: "application/vnd.github+json",
|
|
26046
|
-
"user-agent": "codexhost-desktop-extensions"
|
|
26047
|
-
};
|
|
26048
|
-
var ExtensionDownloadError = class extends Error {
|
|
26049
|
-
};
|
|
26050
|
-
var ExtensionHttpError = class extends ExtensionDownloadError {
|
|
26051
|
-
status;
|
|
26052
|
-
constructor(status) {
|
|
26053
|
-
super(`Download returned HTTP ${status}`);
|
|
26054
|
-
this.status = status;
|
|
26055
|
-
}
|
|
26056
|
-
};
|
|
26057
|
-
async function downloadExtensionBytes(url2, limit, headers, { signal: callerSignal, allowUrl }) {
|
|
26058
|
-
const parsed = desktopExtensionHttpUrlSchema.safeParse(url2);
|
|
26059
|
-
if (!parsed.success)
|
|
26060
|
-
throw new ExtensionDownloadError("Expected a credential-free HTTP(S) URL");
|
|
26061
|
-
try {
|
|
26062
|
-
let target2 = new URL(parsed.data);
|
|
26063
|
-
if (isGitHubDesktopExtensionZipballUrl(target2))
|
|
26064
|
-
headers ??= githubHeaders;
|
|
26065
|
-
const timeout = AbortSignal.timeout(12e3);
|
|
26066
|
-
const signal = callerSignal ? AbortSignal.any([timeout, callerSignal]) : timeout;
|
|
26067
|
-
let response;
|
|
26068
|
-
for (let redirects = 0; ; redirects++) {
|
|
26069
|
-
if (!allowUrl(target2))
|
|
26070
|
-
throw new ExtensionDownloadError("Unsafe download URL");
|
|
26071
|
-
response = await fetch(target2.href, {
|
|
26072
|
-
signal,
|
|
26073
|
-
redirect: "manual",
|
|
26074
|
-
...headers ? { headers } : {}
|
|
26075
|
-
});
|
|
26076
|
-
const location = response.headers.get("location");
|
|
26077
|
-
if (!location || ![301, 302, 303, 307, 308].includes(response.status))
|
|
26078
|
-
break;
|
|
26079
|
-
await response.body?.cancel();
|
|
26080
|
-
if (redirects >= 4)
|
|
26081
|
-
throw new ExtensionDownloadError("Too many download redirects");
|
|
26082
|
-
target2 = new URL(location, target2);
|
|
26083
|
-
}
|
|
26084
|
-
const body = response.body;
|
|
26085
|
-
if (!response.ok || !body || Number(response.headers.get("content-length")) > limit) {
|
|
26086
|
-
await body?.cancel().catch(() => void 0);
|
|
26087
|
-
if (!response.ok)
|
|
26088
|
-
throw new ExtensionHttpError(response.status);
|
|
26089
|
-
throw new ExtensionDownloadError("Download is empty or exceeds the size limit");
|
|
26090
|
-
}
|
|
26091
|
-
const reader = body.getReader();
|
|
26092
|
-
const chunks = [];
|
|
26093
|
-
let size = 0;
|
|
26094
|
-
try {
|
|
26095
|
-
for (; ; ) {
|
|
26096
|
-
const { done, value } = await reader.read();
|
|
26097
|
-
if (done)
|
|
26098
|
-
break;
|
|
26099
|
-
size += value.byteLength;
|
|
26100
|
-
if (size > limit)
|
|
26101
|
-
throw new ExtensionDownloadError("Download exceeds the size limit");
|
|
26102
|
-
chunks.push(value);
|
|
26103
|
-
}
|
|
26104
|
-
} finally {
|
|
26105
|
-
await reader.cancel().catch(() => void 0);
|
|
26106
|
-
}
|
|
26107
|
-
return Buffer.concat(chunks, size);
|
|
26108
|
-
} catch (error62) {
|
|
26109
|
-
if (error62 instanceof ExtensionDownloadError)
|
|
26110
|
-
throw error62;
|
|
26111
|
-
throw new ExtensionDownloadError("Download failed or timed out", { cause: error62 });
|
|
26112
|
-
}
|
|
26113
|
-
}
|
|
26114
|
-
|
|
26115
26417
|
// packages/harness-plugin-files/dist/extension-zip.js
|
|
26116
26418
|
import { promisify } from "node:util";
|
|
26117
26419
|
import { crc32, inflateRaw, inflateRawSync } from "node:zlib";
|
|
@@ -26122,13 +26424,35 @@ var inflate = promisify(inflateRaw);
|
|
|
26122
26424
|
|
|
26123
26425
|
// packages/harness-plugin-files/dist/host-extension-sources.js
|
|
26124
26426
|
var TTL = 5 * 60 * 1e3;
|
|
26427
|
+
var STALE_FALLBACK_MAX_AGE_MS = 30 * 60 * 1e3;
|
|
26428
|
+
var CATALOG_TIMEOUT_MS = 12e3;
|
|
26429
|
+
var CATALOG_RETRIES = 1;
|
|
26125
26430
|
var httpsDownload = (url2) => url2.protocol === "https:" && !url2.username && !url2.password;
|
|
26126
26431
|
var cache;
|
|
26127
26432
|
var pending;
|
|
26433
|
+
var catalogGeneration = 0;
|
|
26434
|
+
var cacheWrittenGeneration = 0;
|
|
26128
26435
|
var PRIMARY_GRACE_MS = 1500;
|
|
26129
26436
|
var PRIMARY_FORCE_REFRESH_GRACE_MS = 3e3;
|
|
26130
26437
|
var STATS_MAX_BYTES = 256 * 1024;
|
|
26131
26438
|
var STATS_TIMEOUT_MS = 2e3;
|
|
26439
|
+
function raceWithSignal(promise2, signal) {
|
|
26440
|
+
if (!signal)
|
|
26441
|
+
return promise2;
|
|
26442
|
+
if (signal.aborted)
|
|
26443
|
+
return Promise.reject(new ExtensionDownloadError("Download aborted", { cause: signal.reason }));
|
|
26444
|
+
return new Promise((resolve, reject) => {
|
|
26445
|
+
const onAbort = () => reject(new ExtensionDownloadError("Download aborted", { cause: signal.reason }));
|
|
26446
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
26447
|
+
promise2.then((value) => {
|
|
26448
|
+
signal.removeEventListener("abort", onAbort);
|
|
26449
|
+
resolve(value);
|
|
26450
|
+
}, (error62) => {
|
|
26451
|
+
signal.removeEventListener("abort", onAbort);
|
|
26452
|
+
reject(error62);
|
|
26453
|
+
});
|
|
26454
|
+
});
|
|
26455
|
+
}
|
|
26132
26456
|
function catalogGeneratedAtMs(result) {
|
|
26133
26457
|
const parsed = Date.parse(result.generatedAt);
|
|
26134
26458
|
return Number.isFinite(parsed) ? parsed : 0;
|
|
@@ -26142,7 +26466,9 @@ async function fetchCatalogFrom(catalogUrl, signal, forceRefresh) {
|
|
|
26142
26466
|
...forceRefresh ? { "cache-control": "no-cache" } : {}
|
|
26143
26467
|
}, {
|
|
26144
26468
|
signal,
|
|
26145
|
-
allowUrl: (url2) => url2.origin === new URL(catalogUrl).origin && httpsDownload(url2)
|
|
26469
|
+
allowUrl: (url2) => url2.origin === new URL(catalogUrl).origin && httpsDownload(url2),
|
|
26470
|
+
timeoutMs: CATALOG_TIMEOUT_MS,
|
|
26471
|
+
retries: CATALOG_RETRIES
|
|
26146
26472
|
});
|
|
26147
26473
|
return {
|
|
26148
26474
|
...hostExtensionCatalogSchema.parse(JSON.parse(utf8.decode(bytes))),
|
|
@@ -26234,22 +26560,46 @@ function mergeLiveDownloadStats(catalog, liveDownloads) {
|
|
|
26234
26560
|
})
|
|
26235
26561
|
};
|
|
26236
26562
|
}
|
|
26237
|
-
async function fetchHostExtensionCatalog({ forceRefresh = false } = {}) {
|
|
26563
|
+
async function fetchHostExtensionCatalog({ forceRefresh = false, fallbackToCache = false, signal } = {}) {
|
|
26238
26564
|
if (!forceRefresh && cache && Date.now() < cache.expires)
|
|
26239
26565
|
return { ...structuredClone(cache.result), cached: true };
|
|
26240
|
-
if (
|
|
26241
|
-
|
|
26242
|
-
|
|
26243
|
-
|
|
26244
|
-
|
|
26245
|
-
|
|
26246
|
-
|
|
26566
|
+
if (signal?.aborted)
|
|
26567
|
+
throw new ExtensionDownloadError("Download aborted", { cause: signal.reason });
|
|
26568
|
+
let request;
|
|
26569
|
+
if (pending && (!forceRefresh || pending.forceRefresh)) {
|
|
26570
|
+
request = pending.promise;
|
|
26571
|
+
} else {
|
|
26572
|
+
const generation = ++catalogGeneration;
|
|
26573
|
+
const created = Promise.all([
|
|
26574
|
+
raceCatalog(forceRefresh),
|
|
26575
|
+
fetchLiveDownloadStats(resolveHostExtensionStatsUrl(), forceRefresh)
|
|
26576
|
+
]).then(([catalog, liveDownloads]) => {
|
|
26577
|
+
const merged = mergeLiveDownloadStats(catalog, liveDownloads);
|
|
26578
|
+
if (generation >= cacheWrittenGeneration) {
|
|
26579
|
+
cacheWrittenGeneration = generation;
|
|
26580
|
+
const now = Date.now();
|
|
26581
|
+
cache = {
|
|
26582
|
+
result: merged,
|
|
26583
|
+
expires: now + TTL,
|
|
26584
|
+
staleUntil: now + STALE_FALLBACK_MAX_AGE_MS
|
|
26585
|
+
};
|
|
26586
|
+
}
|
|
26587
|
+
return merged;
|
|
26588
|
+
}).finally(() => {
|
|
26589
|
+
if (pending?.promise === created)
|
|
26590
|
+
pending = void 0;
|
|
26591
|
+
});
|
|
26592
|
+
created.catch(() => void 0);
|
|
26593
|
+
pending = { forceRefresh, promise: created };
|
|
26594
|
+
request = created;
|
|
26595
|
+
}
|
|
26247
26596
|
try {
|
|
26248
|
-
const result = await request;
|
|
26249
|
-
cache = { result, expires: Date.now() + TTL };
|
|
26597
|
+
const result = await raceWithSignal(request, signal);
|
|
26250
26598
|
return structuredClone(result);
|
|
26251
|
-
}
|
|
26252
|
-
|
|
26599
|
+
} catch (error62) {
|
|
26600
|
+
if (fallbackToCache && !signal?.aborted && cache && Date.now() <= cache.staleUntil)
|
|
26601
|
+
return { ...structuredClone(cache.result), cached: true };
|
|
26602
|
+
throw error62;
|
|
26253
26603
|
}
|
|
26254
26604
|
}
|
|
26255
26605
|
var DEFAULT_HOST_EXTENSION_STATS_URL = "https://ext-stats.chost.dev";
|
|
@@ -27031,6 +27381,7 @@ function publicStatus(status) {
|
|
|
27031
27381
|
updatedAt: status.updatedAt,
|
|
27032
27382
|
...status.downloadedBytes === void 0 ? {} : { downloadedBytes: status.downloadedBytes },
|
|
27033
27383
|
...status.totalBytes === void 0 ? {} : { totalBytes: status.totalBytes },
|
|
27384
|
+
...status.npmDownload === void 0 ? {} : { npmDownload: status.npmDownload },
|
|
27034
27385
|
error: status.error?.slice(0, ERROR_MAX_LENGTH) ?? null,
|
|
27035
27386
|
...status.serviceStopOutput === void 0 ? {} : { serviceStopOutput: status.serviceStopOutput }
|
|
27036
27387
|
};
|
|
@@ -27939,7 +28290,22 @@ async function openConsole(options) {
|
|
|
27939
28290
|
}
|
|
27940
28291
|
|
|
27941
28292
|
// packages/console-server/src/update-cli.ts
|
|
27942
|
-
|
|
28293
|
+
import { setTimeout as delay4 } from "node:timers/promises";
|
|
28294
|
+
var POLL_INTERVAL_MS = 500;
|
|
28295
|
+
var DOWNLOAD_IDLE_TIMEOUT_MS = 15 * 6e4;
|
|
28296
|
+
function downloadMessage(status) {
|
|
28297
|
+
const prefix = "Downloading update...";
|
|
28298
|
+
if (status.npmDownload) {
|
|
28299
|
+
return `${prefix} ${status.npmDownload.completed}/${status.npmDownload.total} npm packages ready`;
|
|
28300
|
+
}
|
|
28301
|
+
if (status.downloadedBytes === void 0) return prefix;
|
|
28302
|
+
const mib = (bytes) => `${(bytes / (1024 * 1024)).toFixed(1)} MiB`;
|
|
28303
|
+
const downloaded = mib(status.downloadedBytes);
|
|
28304
|
+
if (status.totalBytes === void 0) return `${prefix} ${downloaded}`;
|
|
28305
|
+
const percent = Math.floor(status.downloadedBytes / status.totalBytes * 100);
|
|
28306
|
+
return `${prefix} ${percent}% (${downloaded} / ${mib(status.totalBytes)})`;
|
|
28307
|
+
}
|
|
28308
|
+
async function runUpdateCommand(target2, updates, write = (message) => console.log(message)) {
|
|
27943
28309
|
write("Checking for codexhost updates...");
|
|
27944
28310
|
const checked = await updates.check(target2);
|
|
27945
28311
|
if (checked.error) throw new Error(checked.error);
|
|
@@ -27953,8 +28319,37 @@ async function runUpdateCommand(target2, updates, write = console.log) {
|
|
|
27953
28319
|
);
|
|
27954
28320
|
}
|
|
27955
28321
|
write(`Updating codexhost ${checked.currentVersion} → ${checked.latestVersion}...`);
|
|
27956
|
-
|
|
28322
|
+
let lastProgress;
|
|
28323
|
+
const report = (status2) => {
|
|
28324
|
+
if (status2?.phase !== "downloading" || status2.version !== checked.latestVersion) return;
|
|
28325
|
+
const message = downloadMessage(status2);
|
|
28326
|
+
if (message === lastProgress) return;
|
|
28327
|
+
lastProgress = message;
|
|
28328
|
+
write(message, true);
|
|
28329
|
+
};
|
|
28330
|
+
const starting = updates.start(target2).then(({ status: status2 }) => status2);
|
|
28331
|
+
const startOrPoll = () => Promise.race([starting, delay4(POLL_INTERVAL_MS, null, { ref: false })]);
|
|
28332
|
+
let status = await startOrPoll();
|
|
28333
|
+
while (status === null) {
|
|
28334
|
+
report((await updates.status()).status);
|
|
28335
|
+
status = await startOrPoll();
|
|
28336
|
+
}
|
|
28337
|
+
const waitingSince = Date.now();
|
|
28338
|
+
while (status.phase === "downloading") {
|
|
28339
|
+
report(status);
|
|
28340
|
+
if (Date.now() - Math.max(waitingSince, status.updatedAt * 1e3) >= DOWNLOAD_IDLE_TIMEOUT_MS)
|
|
28341
|
+
throw new Error("Timed out waiting for download progress");
|
|
28342
|
+
await delay4(POLL_INTERVAL_MS);
|
|
28343
|
+
const current = (await updates.status()).status;
|
|
28344
|
+
if (current?.version === status.version && current.installation === status.installation)
|
|
28345
|
+
status = current;
|
|
28346
|
+
}
|
|
27957
28347
|
if (status.phase === "failed") throw new Error(status.error ?? "Update failed");
|
|
28348
|
+
if (lastProgress) write("Download complete.");
|
|
28349
|
+
if (status.phase === "succeeded") {
|
|
28350
|
+
write(`Update ${status.version}: installed successfully.`);
|
|
28351
|
+
return;
|
|
28352
|
+
}
|
|
27958
28353
|
write(
|
|
27959
28354
|
`Update ${status.version}: ${status.phase}. The update request was accepted; installation is not complete yet. The background updater will install it and restart codexhost.`
|
|
27960
28355
|
);
|
|
@@ -27969,17 +28364,40 @@ async function updateFromCommand(appDirectory2, arguments_) {
|
|
|
27969
28364
|
updateAppDirectory: appDirectory2
|
|
27970
28365
|
});
|
|
27971
28366
|
const inspected = await inspectInstallation(installation.launcherExecutable);
|
|
27972
|
-
|
|
27973
|
-
|
|
27974
|
-
|
|
27975
|
-
|
|
27976
|
-
|
|
27977
|
-
|
|
27978
|
-
|
|
27979
|
-
|
|
27980
|
-
|
|
27981
|
-
|
|
27982
|
-
|
|
28367
|
+
const local = createConsoleUpdates({ waitForHandoff: true, onHandedOff() {
|
|
28368
|
+
} });
|
|
28369
|
+
const updates = await host.available() ? { ...createHostUpdates(host), status: local.status } : local;
|
|
28370
|
+
const output2 = process.stdout;
|
|
28371
|
+
let progressVisible = false;
|
|
28372
|
+
const clearProgress = () => {
|
|
28373
|
+
if (!progressVisible) return;
|
|
28374
|
+
output2.clearLine(0);
|
|
28375
|
+
output2.cursorTo(0);
|
|
28376
|
+
progressVisible = false;
|
|
28377
|
+
};
|
|
28378
|
+
try {
|
|
28379
|
+
await runUpdateCommand(
|
|
28380
|
+
{
|
|
28381
|
+
...installation,
|
|
28382
|
+
runtimeDescriptorPath: inspected.runtime.descriptorPath,
|
|
28383
|
+
codexhostRunning: inspected.runtime.running,
|
|
28384
|
+
dataDirectory: paths.dataDirectory,
|
|
28385
|
+
restartTarget: inspected.desktop === null ? "web" : "desktop"
|
|
28386
|
+
},
|
|
28387
|
+
updates,
|
|
28388
|
+
(message, live) => {
|
|
28389
|
+
clearProgress();
|
|
28390
|
+
if (live && output2.isTTY) {
|
|
28391
|
+
output2.write(message);
|
|
28392
|
+
progressVisible = true;
|
|
28393
|
+
} else {
|
|
28394
|
+
console.log(message);
|
|
28395
|
+
}
|
|
28396
|
+
}
|
|
28397
|
+
);
|
|
28398
|
+
} finally {
|
|
28399
|
+
clearProgress();
|
|
28400
|
+
}
|
|
27983
28401
|
}
|
|
27984
28402
|
|
|
27985
28403
|
// packages/console-server/src/main.ts
|