@codexhost/cli-darwin-x64 0.8.0 → 0.9.1
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/THIRD_PARTY_NOTICES.txt +12 -0
- package/app/codexhost-distribution.json +1 -1
- package/app/desktop-controller.mjs +67 -26
- package/app/host-runtime.mjs +3774 -6483
- package/app/plugins/antigravity/plugin.mjs +114 -93
- package/app/plugins/claude-code/plugin.mjs +480 -239
- package/app/plugins/codebuddy/plugin.mjs +2177 -846
- package/app/plugins/cursor-cli/plugin.mjs +35065 -10156
- package/app/plugins/deepseek-harness/plugin.mjs +72 -84
- package/app/plugins/enabled.json +4 -1
- package/app/plugins/grok/plugin.mjs +60 -78
- package/app/plugins/hermes/plugin.mjs +2431 -174
- package/app/plugins/kiro-cli/plugin.mjs +67 -80
- package/app/plugins/omp/plugin.mjs +106 -91
- package/app/plugins/opencode/plugin.mjs +109 -123
- package/app/plugins/pi/plugin.mjs +71 -84
- package/app/plugins/qoder/assets/icon.svg +1 -0
- package/app/plugins/qoder/manifest.json +12 -0
- package/app/plugins/qoder/plugin.mjs +52267 -0
- package/app/plugins/qoder-cn/assets/icon.svg +1 -0
- package/app/plugins/qoder-cn/manifest.json +12 -0
- package/app/plugins/qoder-cn/plugin.mjs +52265 -0
- package/app/plugins/workbuddy/assets/icon.svg +29 -0
- package/app/plugins/workbuddy/manifest.json +14 -0
- package/app/plugins/workbuddy/plugin.mjs +24818 -0
- package/app/renderer-extension.js +3182 -960
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/licenses/Qoder-Agent-SDK-LICENSE.txt +7 -0
- package/licenses/QoderCN-Agent-SDK-LICENSE.txt +7 -0
- package/licenses/tailwindcss-LICENSE.txt +21 -0
- package/package.json +1 -1
|
@@ -8,7 +8,7 @@ var __export = (target, all) => {
|
|
|
8
8
|
// dist/opencode-adapter.js
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
10
|
import fs4 from "node:fs";
|
|
11
|
-
import
|
|
11
|
+
import path6 from "node:path";
|
|
12
12
|
|
|
13
13
|
// ../../../node_modules/zod/v4/classic/external.js
|
|
14
14
|
var external_exports = {};
|
|
@@ -776,10 +776,10 @@ function mergeDefs(...defs) {
|
|
|
776
776
|
function cloneDef(schema) {
|
|
777
777
|
return mergeDefs(schema._zod.def);
|
|
778
778
|
}
|
|
779
|
-
function getElementAtPath(obj,
|
|
780
|
-
if (!
|
|
779
|
+
function getElementAtPath(obj, path7) {
|
|
780
|
+
if (!path7)
|
|
781
781
|
return obj;
|
|
782
|
-
return
|
|
782
|
+
return path7.reduce((acc, key) => acc?.[key], obj);
|
|
783
783
|
}
|
|
784
784
|
function promiseAllObject(promisesObj) {
|
|
785
785
|
const keys = Object.keys(promisesObj);
|
|
@@ -1188,11 +1188,11 @@ function explicitlyAborted(x, startIndex = 0) {
|
|
|
1188
1188
|
}
|
|
1189
1189
|
return false;
|
|
1190
1190
|
}
|
|
1191
|
-
function prefixIssues(
|
|
1191
|
+
function prefixIssues(path7, issues) {
|
|
1192
1192
|
return issues.map((iss) => {
|
|
1193
1193
|
var _a3;
|
|
1194
1194
|
(_a3 = iss).path ?? (_a3.path = []);
|
|
1195
|
-
iss.path.unshift(
|
|
1195
|
+
iss.path.unshift(path7);
|
|
1196
1196
|
return iss;
|
|
1197
1197
|
});
|
|
1198
1198
|
}
|
|
@@ -1339,16 +1339,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1339
1339
|
}
|
|
1340
1340
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
1341
1341
|
const fieldErrors = { _errors: [] };
|
|
1342
|
-
const processError = (error52,
|
|
1342
|
+
const processError = (error52, path7 = []) => {
|
|
1343
1343
|
for (const issue2 of error52.issues) {
|
|
1344
1344
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1345
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1345
|
+
issue2.errors.map((issues) => processError({ issues }, [...path7, ...issue2.path]));
|
|
1346
1346
|
} else if (issue2.code === "invalid_key") {
|
|
1347
|
-
processError({ issues: issue2.issues }, [...
|
|
1347
|
+
processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
|
|
1348
1348
|
} else if (issue2.code === "invalid_element") {
|
|
1349
|
-
processError({ issues: issue2.issues }, [...
|
|
1349
|
+
processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
|
|
1350
1350
|
} else {
|
|
1351
|
-
const fullpath = [...
|
|
1351
|
+
const fullpath = [...path7, ...issue2.path];
|
|
1352
1352
|
if (fullpath.length === 0) {
|
|
1353
1353
|
fieldErrors._errors.push(mapper(issue2));
|
|
1354
1354
|
} else {
|
|
@@ -1375,17 +1375,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1375
1375
|
}
|
|
1376
1376
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
1377
1377
|
const result = { errors: [] };
|
|
1378
|
-
const processError = (error52,
|
|
1378
|
+
const processError = (error52, path7 = []) => {
|
|
1379
1379
|
var _a3, _b;
|
|
1380
1380
|
for (const issue2 of error52.issues) {
|
|
1381
1381
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1382
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1382
|
+
issue2.errors.map((issues) => processError({ issues }, [...path7, ...issue2.path]));
|
|
1383
1383
|
} else if (issue2.code === "invalid_key") {
|
|
1384
|
-
processError({ issues: issue2.issues }, [...
|
|
1384
|
+
processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
|
|
1385
1385
|
} else if (issue2.code === "invalid_element") {
|
|
1386
|
-
processError({ issues: issue2.issues }, [...
|
|
1386
|
+
processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
|
|
1387
1387
|
} else {
|
|
1388
|
-
const fullpath = [...
|
|
1388
|
+
const fullpath = [...path7, ...issue2.path];
|
|
1389
1389
|
if (fullpath.length === 0) {
|
|
1390
1390
|
result.errors.push(mapper(issue2));
|
|
1391
1391
|
continue;
|
|
@@ -1417,8 +1417,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
1417
1417
|
}
|
|
1418
1418
|
function toDotPath(_path) {
|
|
1419
1419
|
const segs = [];
|
|
1420
|
-
const
|
|
1421
|
-
for (const seg of
|
|
1420
|
+
const path7 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1421
|
+
for (const seg of path7) {
|
|
1422
1422
|
if (typeof seg === "number")
|
|
1423
1423
|
segs.push(`[${seg}]`);
|
|
1424
1424
|
else if (typeof seg === "symbol")
|
|
@@ -14110,13 +14110,13 @@ function resolveRef(ref, ctx) {
|
|
|
14110
14110
|
if (!ref.startsWith("#")) {
|
|
14111
14111
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
14112
14112
|
}
|
|
14113
|
-
const
|
|
14114
|
-
if (
|
|
14113
|
+
const path7 = ref.slice(1).split("/").filter(Boolean);
|
|
14114
|
+
if (path7.length === 0) {
|
|
14115
14115
|
return ctx.rootSchema;
|
|
14116
14116
|
}
|
|
14117
14117
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
14118
|
-
if (
|
|
14119
|
-
const key =
|
|
14118
|
+
if (path7[0] === defsKey) {
|
|
14119
|
+
const key = path7[1];
|
|
14120
14120
|
if (!key || !ctx.defs[key]) {
|
|
14121
14121
|
throw new Error(`Reference not found: ${ref}`);
|
|
14122
14122
|
}
|
|
@@ -14527,6 +14527,46 @@ config(en_default());
|
|
|
14527
14527
|
// ../../shared-contracts/dist/version.js
|
|
14528
14528
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
14529
14529
|
|
|
14530
|
+
// ../../shared-contracts/dist/idle-release.js
|
|
14531
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
14532
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
14533
|
+
var idleReleaseSettingsSchema = external_exports.strictObject({
|
|
14534
|
+
enabled: external_exports.boolean(),
|
|
14535
|
+
timeoutMinutes: external_exports.number().int().min(IDLE_RELEASE_TIMEOUT_MINUTES_MIN).max(IDLE_RELEASE_TIMEOUT_MINUTES_MAX)
|
|
14536
|
+
});
|
|
14537
|
+
var DEFAULT_IDLE_RELEASE_SETTINGS = Object.freeze({
|
|
14538
|
+
enabled: false,
|
|
14539
|
+
timeoutMinutes: 30
|
|
14540
|
+
});
|
|
14541
|
+
|
|
14542
|
+
// ../../shared-contracts/dist/loaded-sessions.js
|
|
14543
|
+
var loadedSessionStateSchema = external_exports.enum([
|
|
14544
|
+
"idle",
|
|
14545
|
+
"running",
|
|
14546
|
+
"busy",
|
|
14547
|
+
"closing",
|
|
14548
|
+
"failed",
|
|
14549
|
+
"blocked"
|
|
14550
|
+
]);
|
|
14551
|
+
var loadedSessionReasonSchema = external_exports.enum([
|
|
14552
|
+
"none",
|
|
14553
|
+
"disabled",
|
|
14554
|
+
"timeout",
|
|
14555
|
+
"operation",
|
|
14556
|
+
"background",
|
|
14557
|
+
"identity",
|
|
14558
|
+
"persistence",
|
|
14559
|
+
"closeFailed"
|
|
14560
|
+
]);
|
|
14561
|
+
var loadedSessionsSchema = external_exports.array(external_exports.strictObject({
|
|
14562
|
+
threadId: external_exports.string(),
|
|
14563
|
+
title: external_exports.string(),
|
|
14564
|
+
harnessId: external_exports.string(),
|
|
14565
|
+
state: loadedSessionStateSchema,
|
|
14566
|
+
reason: loadedSessionReasonSchema,
|
|
14567
|
+
inactiveMs: external_exports.number().nonnegative()
|
|
14568
|
+
}));
|
|
14569
|
+
|
|
14530
14570
|
// ../../shared-contracts/dist/ids.js
|
|
14531
14571
|
var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
14532
14572
|
message: "Identifier must not be empty or whitespace"
|
|
@@ -15012,6 +15052,8 @@ var pluginPresentationShape = {
|
|
|
15012
15052
|
id: harnessPluginIdSchema,
|
|
15013
15053
|
name: external_exports.string().trim().min(1).max(128),
|
|
15014
15054
|
version: external_exports.string().min(1).max(128),
|
|
15055
|
+
/** The factory accepts a persisted local entrypoint through its construction context. */
|
|
15056
|
+
launchCommand: external_exports.literal(true).optional(),
|
|
15015
15057
|
links: external_exports.object({
|
|
15016
15058
|
documentation: documentationUrlSchema.optional(),
|
|
15017
15059
|
installation: documentationUrlSchema.optional()
|
|
@@ -15049,6 +15091,19 @@ var harnessPluginRouteSchema = external_exports.object({
|
|
|
15049
15091
|
permissionModeId: harnessPermissionModeIdSchema.optional()
|
|
15050
15092
|
}).strict();
|
|
15051
15093
|
|
|
15094
|
+
// ../../shared-contracts/dist/harness-launch-settings.js
|
|
15095
|
+
var harnessLaunchPathSchema = external_exports.string().trim().min(1).max(4096).refine((value) => !/[\u0000\r\n]/u.test(value), "Invalid entrypoint path");
|
|
15096
|
+
var harnessLaunchSettingsGetSchema = external_exports.object({
|
|
15097
|
+
harnessId: harnessPluginIdSchema
|
|
15098
|
+
}).strict();
|
|
15099
|
+
var harnessLaunchSettingsSetSchema = harnessLaunchSettingsGetSchema.extend({
|
|
15100
|
+
path: harnessLaunchPathSchema.nullable()
|
|
15101
|
+
});
|
|
15102
|
+
var harnessLaunchSettingsSchema = external_exports.object({
|
|
15103
|
+
path: harnessLaunchPathSchema.nullable(),
|
|
15104
|
+
restartRequired: external_exports.boolean()
|
|
15105
|
+
}).strict();
|
|
15106
|
+
|
|
15052
15107
|
// ../../shared-contracts/dist/codex-accounts.js
|
|
15053
15108
|
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
15054
15109
|
var nonBlankTextSchema3 = external_exports.string().trim().min(1);
|
|
@@ -15077,75 +15132,15 @@ var codexAccountSchema = external_exports.object({
|
|
|
15077
15132
|
email: external_exports.string().email().max(320).optional(),
|
|
15078
15133
|
planType: codexAccountPlanTypeSchema.optional()
|
|
15079
15134
|
}).strict();
|
|
15080
|
-
var codexAccountPhaseSchema = external_exports.enum(["ready", "
|
|
15081
|
-
var codexAccountPendingOperationSchema = external_exports.object({
|
|
15082
|
-
operationId: nonBlankTextSchema3.max(1024),
|
|
15083
|
-
kind: external_exports.enum(["login", "switch", "logout", "recovery"])
|
|
15084
|
-
}).strict();
|
|
15085
|
-
var codexAccountCapabilitiesSchema = external_exports.object({
|
|
15086
|
-
manage: external_exports.boolean(),
|
|
15087
|
-
switch: external_exports.boolean(),
|
|
15088
|
-
login: external_exports.boolean(),
|
|
15089
|
-
delete: external_exports.boolean(),
|
|
15090
|
-
recover: external_exports.boolean().optional(),
|
|
15091
|
-
logout: external_exports.boolean().optional(),
|
|
15092
|
-
reason: external_exports.enum([
|
|
15093
|
-
"ssh-single-account",
|
|
15094
|
-
"unsupported-storage",
|
|
15095
|
-
"unsupported-version",
|
|
15096
|
-
"recovery-required",
|
|
15097
|
-
"keyring-unavailable",
|
|
15098
|
-
"migration-required"
|
|
15099
|
-
]).optional()
|
|
15100
|
-
}).strict();
|
|
15135
|
+
var codexAccountPhaseSchema = external_exports.enum(["ready", "unavailable"]);
|
|
15101
15136
|
var codexAccountListResultSchema = external_exports.object({
|
|
15102
15137
|
version: external_exports.literal(2),
|
|
15103
15138
|
currentAccountId: accountIdSchema.nullable(),
|
|
15104
15139
|
phase: codexAccountPhaseSchema,
|
|
15105
15140
|
revision: external_exports.number().int().nonnegative(),
|
|
15106
15141
|
instanceId: nonBlankTextSchema3.max(1024).optional(),
|
|
15107
|
-
|
|
15108
|
-
/** Credentials were adopted; other native homes/history remain unmerged. */
|
|
15109
|
-
legacyHistoryPreserved: external_exports.boolean().optional(),
|
|
15110
|
-
pendingOperation: codexAccountPendingOperationSchema.optional(),
|
|
15111
|
-
capabilities: codexAccountCapabilitiesSchema,
|
|
15112
|
-
accounts: external_exports.array(codexAccountSchema).max(128)
|
|
15113
|
-
}).strict();
|
|
15114
|
-
var codexAccountActivateParamsSchema = external_exports.object({ accountId: accountIdSchema }).strict();
|
|
15115
|
-
var codexAccountSwitchParamsSchema = external_exports.object({ accountId: accountIdSchema }).strict();
|
|
15116
|
-
var codexAccountReadyMutationResultShape = {
|
|
15117
|
-
phase: external_exports.literal("ready"),
|
|
15118
|
-
revision: external_exports.number().int().nonnegative()
|
|
15119
|
-
};
|
|
15120
|
-
var codexAccountSwitchResultSchema = external_exports.object({
|
|
15121
|
-
currentAccountId: accountIdSchema,
|
|
15122
|
-
...codexAccountReadyMutationResultShape
|
|
15123
|
-
}).strict();
|
|
15124
|
-
var codexAccountDeleteParamsSchema = external_exports.object({ accountId: accountIdSchema }).strict();
|
|
15125
|
-
var codexAccountDeleteResultSchema = external_exports.object({ deletedAccountId: accountIdSchema }).strict();
|
|
15126
|
-
var codexAccountLoginStartParamsSchema = external_exports.object({ accountId: accountIdSchema.optional() }).strict();
|
|
15127
|
-
var codexAccountLoginStartResultSchema = external_exports.object({
|
|
15128
|
-
accountId: accountIdSchema,
|
|
15129
|
-
loginId: nonBlankTextSchema3.max(1024),
|
|
15130
|
-
verificationUrl: external_exports.string().url().max(16384),
|
|
15131
|
-
userCode: nonBlankTextSchema3.max(1024)
|
|
15132
|
-
}).strict();
|
|
15133
|
-
var codexAccountLoginCancelParamsSchema = external_exports.object({ loginId: nonBlankTextSchema3.max(1024) }).strict();
|
|
15134
|
-
var codexAccountLoginCancelResultSchema = external_exports.object({ cancelled: external_exports.boolean() }).strict();
|
|
15135
|
-
var codexAccountLoginCompletedSchema = external_exports.object({
|
|
15136
|
-
accountId: accountIdSchema,
|
|
15137
|
-
loginId: nonBlankTextSchema3.max(1024),
|
|
15138
|
-
success: external_exports.boolean(),
|
|
15139
|
-
error: external_exports.string().max(4096).nullable(),
|
|
15140
|
-
saved: external_exports.boolean().optional(),
|
|
15141
|
-
cleanupRequired: external_exports.boolean().optional()
|
|
15142
|
-
}).strict();
|
|
15143
|
-
var codexAccountLogoutParamsSchema = external_exports.object({}).strict();
|
|
15144
|
-
var codexAccountLogoutResultSchema = external_exports.object({
|
|
15145
|
-
currentAccountId: external_exports.null(),
|
|
15146
|
-
...codexAccountReadyMutationResultShape
|
|
15142
|
+
accounts: external_exports.array(codexAccountSchema).max(1)
|
|
15147
15143
|
}).strict();
|
|
15148
|
-
var codexAccountRecoverParamsSchema = external_exports.object({}).strict();
|
|
15149
15144
|
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
15150
15145
|
var codexAccountUsageResultSchema = external_exports.object({
|
|
15151
15146
|
accountId: accountIdSchema,
|
|
@@ -15154,21 +15149,6 @@ var codexAccountUsageResultSchema = external_exports.object({
|
|
|
15154
15149
|
freshness: external_exports.enum(["live", "cached"]),
|
|
15155
15150
|
observedAt: external_exports.string().datetime().nullable()
|
|
15156
15151
|
}).strict();
|
|
15157
|
-
var codexAccountResetCreditConsumeParamsSchema = external_exports.object({
|
|
15158
|
-
accountId: accountIdSchema,
|
|
15159
|
-
idempotencyKey: external_exports.string().uuid().optional()
|
|
15160
|
-
}).strict();
|
|
15161
|
-
var codexAccountResetCreditConsumeOutcomeSchema = external_exports.enum([
|
|
15162
|
-
"reset",
|
|
15163
|
-
"nothingToReset",
|
|
15164
|
-
"noCredit",
|
|
15165
|
-
"alreadyRedeemed"
|
|
15166
|
-
]);
|
|
15167
|
-
var codexAccountResetCreditConsumeResultSchema = external_exports.object({
|
|
15168
|
-
accountId: accountIdSchema,
|
|
15169
|
-
outcome: codexAccountResetCreditConsumeOutcomeSchema,
|
|
15170
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15171
|
-
}).strict();
|
|
15172
15152
|
|
|
15173
15153
|
// ../../shared-contracts/dist/harness-session-import.js
|
|
15174
15154
|
var HARNESS_SESSION_IMPORT_ID_MAX_LENGTH = 1024;
|
|
@@ -15906,6 +15886,7 @@ function projectOpenCodeHistory(input) {
|
|
|
15906
15886
|
const item = {
|
|
15907
15887
|
type: "fileChange",
|
|
15908
15888
|
itemId: itemId(`opencode-diff:${userEntry.info.id}`),
|
|
15889
|
+
sourceItemIds: items.map(({ item: item2 }) => item2.itemId),
|
|
15909
15890
|
changes
|
|
15910
15891
|
};
|
|
15911
15892
|
items.push({ item, outcome: { status: "succeeded" } });
|
|
@@ -16027,6 +16008,7 @@ import { randomBytes } from "node:crypto";
|
|
|
16027
16008
|
import { spawn, spawnSync } from "node:child_process";
|
|
16028
16009
|
import fs2 from "node:fs";
|
|
16029
16010
|
import { homedir, tmpdir } from "node:os";
|
|
16011
|
+
import path4 from "node:path";
|
|
16030
16012
|
|
|
16031
16013
|
// ../../../node_modules/@opencode-ai/sdk/dist/v2/gen/core/serverSentEvents.gen.js
|
|
16032
16014
|
var createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url: url2, ...options }) => {
|
|
@@ -16252,7 +16234,7 @@ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueO
|
|
|
16252
16234
|
|
|
16253
16235
|
// ../../../node_modules/@opencode-ai/sdk/dist/v2/gen/core/utils.gen.js
|
|
16254
16236
|
var PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
16255
|
-
var defaultPathSerializer = ({ path:
|
|
16237
|
+
var defaultPathSerializer = ({ path: path7, url: _url2 }) => {
|
|
16256
16238
|
let url2 = _url2;
|
|
16257
16239
|
const matches = _url2.match(PATH_PARAM_RE);
|
|
16258
16240
|
if (matches) {
|
|
@@ -16271,7 +16253,7 @@ var defaultPathSerializer = ({ path: path6, url: _url2 }) => {
|
|
|
16271
16253
|
name = name.substring(1);
|
|
16272
16254
|
style = "matrix";
|
|
16273
16255
|
}
|
|
16274
|
-
const value =
|
|
16256
|
+
const value = path7[name];
|
|
16275
16257
|
if (value === void 0 || value === null) {
|
|
16276
16258
|
continue;
|
|
16277
16259
|
}
|
|
@@ -16302,11 +16284,11 @@ var defaultPathSerializer = ({ path: path6, url: _url2 }) => {
|
|
|
16302
16284
|
}
|
|
16303
16285
|
return url2;
|
|
16304
16286
|
};
|
|
16305
|
-
var getUrl = ({ baseUrl, path:
|
|
16287
|
+
var getUrl = ({ baseUrl, path: path7, query, querySerializer, url: _url2 }) => {
|
|
16306
16288
|
const pathUrl = _url2.startsWith("/") ? _url2 : `/${_url2}`;
|
|
16307
16289
|
let url2 = (baseUrl ?? "") + pathUrl;
|
|
16308
|
-
if (
|
|
16309
|
-
url2 = defaultPathSerializer({ path:
|
|
16290
|
+
if (path7) {
|
|
16291
|
+
url2 = defaultPathSerializer({ path: path7, url: url2 });
|
|
16310
16292
|
}
|
|
16311
16293
|
let search = query ? querySerializer(query) : "";
|
|
16312
16294
|
if (search.startsWith("?")) {
|
|
@@ -21769,7 +21751,7 @@ function signalProcessTree(child, signal) {
|
|
|
21769
21751
|
function safeOpenCodeServerCwd(environment) {
|
|
21770
21752
|
const candidates = [environment.USERPROFILE, environment.HOME, homedir(), tmpdir()];
|
|
21771
21753
|
for (const candidate of candidates) {
|
|
21772
|
-
if (!candidate)
|
|
21754
|
+
if (!candidate || !path4.isAbsolute(candidate))
|
|
21773
21755
|
continue;
|
|
21774
21756
|
try {
|
|
21775
21757
|
if (!fs2.statSync(candidate).isDirectory())
|
|
@@ -21878,7 +21860,10 @@ var OpenCodeServerConnection = class {
|
|
|
21878
21860
|
OPENCODE_SERVER_PASSWORD: password
|
|
21879
21861
|
};
|
|
21880
21862
|
const invocation = openCodeServerInvocation(executable, environment);
|
|
21881
|
-
const serverCwd = safeOpenCodeServerCwd(environment);
|
|
21863
|
+
const serverCwd = (this.#dependencies.resolveServerCwd ?? safeOpenCodeServerCwd)(environment);
|
|
21864
|
+
if (!serverCwd) {
|
|
21865
|
+
throw new OpenCodeTransportError("unavailable", "OpenCode Server requires a writable startup directory");
|
|
21866
|
+
}
|
|
21882
21867
|
let child;
|
|
21883
21868
|
try {
|
|
21884
21869
|
child = this.#dependencies.spawn(invocation.command, invocation.arguments, {
|
|
@@ -21887,7 +21872,7 @@ var OpenCodeServerConnection = class {
|
|
|
21887
21872
|
detached: process.platform !== "win32",
|
|
21888
21873
|
windowsHide: true,
|
|
21889
21874
|
windowsVerbatimArguments: invocation.windowsVerbatimArguments,
|
|
21890
|
-
|
|
21875
|
+
cwd: serverCwd
|
|
21891
21876
|
});
|
|
21892
21877
|
} catch (error51) {
|
|
21893
21878
|
throw new OpenCodeTransportError(isMissingExecutable(error51) ? "notInstalled" : "unavailable", isMissingExecutable(error51) ? "OpenCode CLI is not installed" : "OpenCode Server failed to start", { cause: error51 });
|
|
@@ -22199,7 +22184,7 @@ var SdkOpenCodeTransport = class {
|
|
|
22199
22184
|
|
|
22200
22185
|
// dist/file-change-verification.js
|
|
22201
22186
|
import fs3 from "node:fs";
|
|
22202
|
-
import
|
|
22187
|
+
import path5 from "node:path";
|
|
22203
22188
|
function missingPath(error51) {
|
|
22204
22189
|
if (!error51 || typeof error51 !== "object")
|
|
22205
22190
|
return false;
|
|
@@ -22211,33 +22196,33 @@ function hasDotPathSegment(value) {
|
|
|
22211
22196
|
return segments.some((segment) => segment === "." || segment === "..");
|
|
22212
22197
|
}
|
|
22213
22198
|
function canonicalDirectoryPath(value) {
|
|
22214
|
-
let candidate =
|
|
22199
|
+
let candidate = path5.resolve(value);
|
|
22215
22200
|
const missingSegments = [];
|
|
22216
22201
|
for (; ; ) {
|
|
22217
22202
|
try {
|
|
22218
|
-
return
|
|
22203
|
+
return path5.join(fs3.realpathSync.native(candidate), ...missingSegments);
|
|
22219
22204
|
} catch (error51) {
|
|
22220
22205
|
if (!missingPath(error51))
|
|
22221
22206
|
return void 0;
|
|
22222
|
-
const parent =
|
|
22207
|
+
const parent = path5.dirname(candidate);
|
|
22223
22208
|
if (parent === candidate)
|
|
22224
22209
|
return void 0;
|
|
22225
|
-
missingSegments.unshift(
|
|
22210
|
+
missingSegments.unshift(path5.basename(candidate));
|
|
22226
22211
|
candidate = parent;
|
|
22227
22212
|
}
|
|
22228
22213
|
}
|
|
22229
22214
|
}
|
|
22230
22215
|
function canonicalFilePath(value) {
|
|
22231
|
-
const absolute =
|
|
22232
|
-
const parent = canonicalDirectoryPath(
|
|
22233
|
-
return parent ?
|
|
22216
|
+
const absolute = path5.resolve(value);
|
|
22217
|
+
const parent = canonicalDirectoryPath(path5.dirname(absolute));
|
|
22218
|
+
return parent ? path5.join(parent, path5.basename(absolute)) : void 0;
|
|
22234
22219
|
}
|
|
22235
22220
|
function pathIsWithin(root, candidate, allowRoot) {
|
|
22236
|
-
const relative =
|
|
22237
|
-
return allowRoot && relative === "" || relative !== "" && relative !== ".." && !relative.startsWith(`..${
|
|
22221
|
+
const relative = path5.relative(root, candidate);
|
|
22222
|
+
return allowRoot && relative === "" || relative !== "" && relative !== ".." && !relative.startsWith(`..${path5.sep}`) && !path5.isAbsolute(relative);
|
|
22238
22223
|
}
|
|
22239
22224
|
function verifiedOpenCodeWorktree(sessionDirectory, paths) {
|
|
22240
|
-
if (!paths || typeof paths !== "object" || typeof sessionDirectory !== "string" || typeof paths.directory !== "string" || typeof paths.worktree !== "string" || hasDotPathSegment(sessionDirectory) || hasDotPathSegment(paths.directory) || hasDotPathSegment(paths.worktree) || !
|
|
22225
|
+
if (!paths || typeof paths !== "object" || typeof sessionDirectory !== "string" || typeof paths.directory !== "string" || typeof paths.worktree !== "string" || hasDotPathSegment(sessionDirectory) || hasDotPathSegment(paths.directory) || hasDotPathSegment(paths.worktree) || !path5.isAbsolute(sessionDirectory) || !path5.isAbsolute(paths.directory) || !path5.isAbsolute(paths.worktree)) {
|
|
22241
22226
|
return void 0;
|
|
22242
22227
|
}
|
|
22243
22228
|
const session = canonicalDirectoryPath(sessionDirectory);
|
|
@@ -22249,10 +22234,10 @@ function verifiedOpenCodeWorktree(sessionDirectory, paths) {
|
|
|
22249
22234
|
return worktree;
|
|
22250
22235
|
}
|
|
22251
22236
|
function openCodeFileIdentity(file2, worktree) {
|
|
22252
|
-
if (typeof file2 !== "string" || typeof worktree !== "string" || hasDotPathSegment(file2) || hasDotPathSegment(worktree) || !
|
|
22237
|
+
if (typeof file2 !== "string" || typeof worktree !== "string" || hasDotPathSegment(file2) || hasDotPathSegment(worktree) || !path5.isAbsolute(worktree) || !file2 || file2.includes("\0") || file2.includes("\n") || file2.includes("\r")) {
|
|
22253
22238
|
return void 0;
|
|
22254
22239
|
}
|
|
22255
|
-
const candidate = canonicalFilePath(
|
|
22240
|
+
const candidate = canonicalFilePath(path5.isAbsolute(file2) ? file2 : path5.resolve(worktree, file2));
|
|
22256
22241
|
return candidate && pathIsWithin(worktree, candidate, false) ? candidate : void 0;
|
|
22257
22242
|
}
|
|
22258
22243
|
|
|
@@ -22542,7 +22527,7 @@ function sameCwd(left, right) {
|
|
|
22542
22527
|
try {
|
|
22543
22528
|
return fs4.realpathSync.native(value);
|
|
22544
22529
|
} catch {
|
|
22545
|
-
return
|
|
22530
|
+
return path6.resolve(value);
|
|
22546
22531
|
}
|
|
22547
22532
|
};
|
|
22548
22533
|
return canonical(left) === canonical(right);
|
|
@@ -22895,7 +22880,7 @@ var OpenCodeHarnessSession = class {
|
|
|
22895
22880
|
}
|
|
22896
22881
|
}
|
|
22897
22882
|
async #selectModel(command) {
|
|
22898
|
-
if (this.#
|
|
22883
|
+
if (this.#configuring) {
|
|
22899
22884
|
return {
|
|
22900
22885
|
ok: false,
|
|
22901
22886
|
error: {
|
|
@@ -22939,7 +22924,7 @@ var OpenCodeHarnessSession = class {
|
|
|
22939
22924
|
if (!this.capabilities.configuration.selectThinkingOption) {
|
|
22940
22925
|
return { ok: false, error: unsupported("OpenCode Model variants are unavailable") };
|
|
22941
22926
|
}
|
|
22942
|
-
if (this.#
|
|
22927
|
+
if (this.#configuring) {
|
|
22943
22928
|
return {
|
|
22944
22929
|
ok: false,
|
|
22945
22930
|
error: {
|
|
@@ -23394,6 +23379,7 @@ var OpenCodeHarnessSession = class {
|
|
|
23394
23379
|
const item = {
|
|
23395
23380
|
type: "fileChange",
|
|
23396
23381
|
itemId: hostItemIdSchema.parse(id),
|
|
23382
|
+
sourceItemIds: [...active.items.values()].map(({ item: item2 }) => item2.itemId),
|
|
23397
23383
|
changes
|
|
23398
23384
|
};
|
|
23399
23385
|
active.items.set(id, { item, completed: false });
|