@codexhost/cli-linux-arm64 0.7.1 → 0.9.1-test.2
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 +16 -0
- package/app/codexhost-distribution.json +1 -1
- package/app/desktop-controller.mjs +185 -47
- package/app/host-runtime.mjs +5084 -3890
- package/app/plugins/antigravity/plugin.mjs +71 -62
- package/app/plugins/claude-code/plugin.mjs +512 -217
- package/app/plugins/codebuddy/plugin.mjs +103 -70
- package/app/plugins/cursor-cli/plugin.mjs +70 -51
- package/app/plugins/deepseek-harness/plugin.mjs +82 -54
- package/app/plugins/enabled.json +4 -1
- package/app/plugins/grok/plugin.mjs +70 -48
- package/app/plugins/hermes/manifest.json +11 -0
- package/app/plugins/hermes/plugin.mjs +21680 -0
- package/app/plugins/kiro-cli/plugin.mjs +77 -50
- package/app/plugins/omp/plugin.mjs +80 -53
- package/app/plugins/opencode/plugin.mjs +139 -94
- package/app/plugins/pi/plugin.mjs +80 -53
- package/app/plugins/qoder/assets/icon.svg +1 -0
- package/app/plugins/qoder/manifest.json +12 -0
- package/app/plugins/qoder/plugin.mjs +52260 -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 +52258 -0
- package/app/renderer-extension.js +3389 -1036
- 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/opencodex-LICENSE.txt +21 -0
- package/licenses/tailwindcss-LICENSE.txt +21 -0
- package/package.json +1 -1
|
@@ -7,8 +7,8 @@ var __export = (target, all) => {
|
|
|
7
7
|
|
|
8
8
|
// dist/opencode-adapter.js
|
|
9
9
|
import { randomUUID } from "node:crypto";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import fs4 from "node:fs";
|
|
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"
|
|
@@ -14631,12 +14671,21 @@ var harnessAccountSnapshotSchema = external_exports.object({
|
|
|
14631
14671
|
plan: external_exports.string().trim().min(1).max(128).optional(),
|
|
14632
14672
|
credits: accountCreditsSnapshotSchema
|
|
14633
14673
|
}).strict();
|
|
14634
|
-
var
|
|
14674
|
+
var harnessAccountIdentityShape = {
|
|
14675
|
+
harnessId: harnessIdSchema,
|
|
14676
|
+
harnessName: external_exports.string().trim().min(1).max(128)
|
|
14677
|
+
};
|
|
14678
|
+
var harnessAccountSourceSchema = external_exports.object(harnessAccountIdentityShape).strict();
|
|
14679
|
+
var harnessAccountSourceListParamsSchema = external_exports.object({}).strict();
|
|
14680
|
+
var harnessAccountSourceListResultSchema = external_exports.object({ sources: external_exports.array(harnessAccountSourceSchema).max(128) }).strict();
|
|
14681
|
+
var harnessAccountInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
14682
|
+
var harnessAccountInspectResultSchema = external_exports.object({
|
|
14683
|
+
...harnessAccountIdentityShape,
|
|
14684
|
+
account: harnessAccountSnapshotSchema.nullable()
|
|
14685
|
+
}).strict();
|
|
14686
|
+
var harnessAccountListParamsSchema = external_exports.object({ refresh: external_exports.boolean().optional() }).strict();
|
|
14635
14687
|
var harnessAccountListResultSchema = external_exports.object({
|
|
14636
|
-
accounts: external_exports.array(harnessAccountSnapshotSchema.extend(
|
|
14637
|
-
harnessId: harnessIdSchema,
|
|
14638
|
-
harnessName: external_exports.string().min(1)
|
|
14639
|
-
})).max(128)
|
|
14688
|
+
accounts: external_exports.array(harnessAccountSnapshotSchema.extend(harnessAccountIdentityShape)).max(128)
|
|
14640
14689
|
}).strict();
|
|
14641
14690
|
|
|
14642
14691
|
// ../../shared-contracts/dist/json-value.js
|
|
@@ -14929,7 +14978,6 @@ var threadInspectionParamsSchema = external_exports.object({
|
|
|
14929
14978
|
}).strict();
|
|
14930
14979
|
var codexThreadInspectionSchema = external_exports.object({
|
|
14931
14980
|
owner: external_exports.literal("codex"),
|
|
14932
|
-
accountId: nonBlankTextSchema2.optional(),
|
|
14933
14981
|
locked: external_exports.literal(true)
|
|
14934
14982
|
}).strict();
|
|
14935
14983
|
var externalThreadInspectionSchema = external_exports.object({
|
|
@@ -15067,52 +15115,24 @@ var codexAccountSchema = external_exports.object({
|
|
|
15067
15115
|
accountId: accountIdSchema,
|
|
15068
15116
|
label: nonBlankTextSchema3.max(256),
|
|
15069
15117
|
email: external_exports.string().email().max(320).optional(),
|
|
15070
|
-
planType: codexAccountPlanTypeSchema.optional()
|
|
15071
|
-
codexHome: nonBlankTextSchema3.max(16384),
|
|
15072
|
-
active: external_exports.boolean(),
|
|
15073
|
-
isDefault: external_exports.boolean()
|
|
15118
|
+
planType: codexAccountPlanTypeSchema.optional()
|
|
15074
15119
|
}).strict();
|
|
15075
|
-
var
|
|
15076
|
-
var
|
|
15077
|
-
|
|
15078
|
-
|
|
15079
|
-
|
|
15080
|
-
|
|
15081
|
-
|
|
15082
|
-
|
|
15083
|
-
accountId: accountIdSchema,
|
|
15084
|
-
loginId: nonBlankTextSchema3.max(1024),
|
|
15085
|
-
verificationUrl: external_exports.string().url().max(16384),
|
|
15086
|
-
userCode: nonBlankTextSchema3.max(1024)
|
|
15120
|
+
var codexAccountPhaseSchema = external_exports.enum(["ready", "unavailable"]);
|
|
15121
|
+
var codexAccountListResultSchema = external_exports.object({
|
|
15122
|
+
version: external_exports.literal(2),
|
|
15123
|
+
currentAccountId: accountIdSchema.nullable(),
|
|
15124
|
+
phase: codexAccountPhaseSchema,
|
|
15125
|
+
revision: external_exports.number().int().nonnegative(),
|
|
15126
|
+
instanceId: nonBlankTextSchema3.max(1024).optional(),
|
|
15127
|
+
accounts: external_exports.array(codexAccountSchema).max(1)
|
|
15087
15128
|
}).strict();
|
|
15088
|
-
var
|
|
15089
|
-
var codexAccountLoginCancelResultSchema = external_exports.object({ cancelled: external_exports.boolean() }).strict();
|
|
15090
|
-
var codexAccountLoginCompletedSchema = external_exports.object({
|
|
15091
|
-
accountId: accountIdSchema,
|
|
15092
|
-
loginId: nonBlankTextSchema3.max(1024),
|
|
15093
|
-
success: external_exports.boolean(),
|
|
15094
|
-
error: external_exports.string().max(4096).nullable()
|
|
15095
|
-
}).strict();
|
|
15096
|
-
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema }).strict();
|
|
15129
|
+
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
15097
15130
|
var codexAccountUsageResultSchema = external_exports.object({
|
|
15098
15131
|
accountId: accountIdSchema,
|
|
15099
15132
|
usage: threadUsageSnapshotSchema.nullable(),
|
|
15100
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15101
|
-
|
|
15102
|
-
|
|
15103
|
-
accountId: accountIdSchema,
|
|
15104
|
-
idempotencyKey: external_exports.string().uuid().optional()
|
|
15105
|
-
}).strict();
|
|
15106
|
-
var codexAccountResetCreditConsumeOutcomeSchema = external_exports.enum([
|
|
15107
|
-
"reset",
|
|
15108
|
-
"nothingToReset",
|
|
15109
|
-
"noCredit",
|
|
15110
|
-
"alreadyRedeemed"
|
|
15111
|
-
]);
|
|
15112
|
-
var codexAccountResetCreditConsumeResultSchema = external_exports.object({
|
|
15113
|
-
accountId: accountIdSchema,
|
|
15114
|
-
outcome: codexAccountResetCreditConsumeOutcomeSchema,
|
|
15115
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15133
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
15134
|
+
freshness: external_exports.enum(["live", "cached"]),
|
|
15135
|
+
observedAt: external_exports.string().datetime().nullable()
|
|
15116
15136
|
}).strict();
|
|
15117
15137
|
|
|
15118
15138
|
// ../../shared-contracts/dist/harness-session-import.js
|
|
@@ -15851,6 +15871,7 @@ function projectOpenCodeHistory(input) {
|
|
|
15851
15871
|
const item = {
|
|
15852
15872
|
type: "fileChange",
|
|
15853
15873
|
itemId: itemId(`opencode-diff:${userEntry.info.id}`),
|
|
15874
|
+
sourceItemIds: items.map(({ item: item2 }) => item2.itemId),
|
|
15854
15875
|
changes
|
|
15855
15876
|
};
|
|
15856
15877
|
items.push({ item, outcome: { status: "succeeded" } });
|
|
@@ -15970,6 +15991,9 @@ var OpenCodeTransportError = class extends Error {
|
|
|
15970
15991
|
// dist/server-connection.js
|
|
15971
15992
|
import { randomBytes } from "node:crypto";
|
|
15972
15993
|
import { spawn, spawnSync } from "node:child_process";
|
|
15994
|
+
import fs2 from "node:fs";
|
|
15995
|
+
import { homedir, tmpdir } from "node:os";
|
|
15996
|
+
import path4 from "node:path";
|
|
15973
15997
|
|
|
15974
15998
|
// ../../../node_modules/@opencode-ai/sdk/dist/v2/gen/core/serverSentEvents.gen.js
|
|
15975
15999
|
var createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url: url2, ...options }) => {
|
|
@@ -16195,7 +16219,7 @@ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueO
|
|
|
16195
16219
|
|
|
16196
16220
|
// ../../../node_modules/@opencode-ai/sdk/dist/v2/gen/core/utils.gen.js
|
|
16197
16221
|
var PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
16198
|
-
var defaultPathSerializer = ({ path:
|
|
16222
|
+
var defaultPathSerializer = ({ path: path7, url: _url2 }) => {
|
|
16199
16223
|
let url2 = _url2;
|
|
16200
16224
|
const matches = _url2.match(PATH_PARAM_RE);
|
|
16201
16225
|
if (matches) {
|
|
@@ -16214,7 +16238,7 @@ var defaultPathSerializer = ({ path: path6, url: _url2 }) => {
|
|
|
16214
16238
|
name = name.substring(1);
|
|
16215
16239
|
style = "matrix";
|
|
16216
16240
|
}
|
|
16217
|
-
const value =
|
|
16241
|
+
const value = path7[name];
|
|
16218
16242
|
if (value === void 0 || value === null) {
|
|
16219
16243
|
continue;
|
|
16220
16244
|
}
|
|
@@ -16245,11 +16269,11 @@ var defaultPathSerializer = ({ path: path6, url: _url2 }) => {
|
|
|
16245
16269
|
}
|
|
16246
16270
|
return url2;
|
|
16247
16271
|
};
|
|
16248
|
-
var getUrl = ({ baseUrl, path:
|
|
16272
|
+
var getUrl = ({ baseUrl, path: path7, query, querySerializer, url: _url2 }) => {
|
|
16249
16273
|
const pathUrl = _url2.startsWith("/") ? _url2 : `/${_url2}`;
|
|
16250
16274
|
let url2 = (baseUrl ?? "") + pathUrl;
|
|
16251
|
-
if (
|
|
16252
|
-
url2 = defaultPathSerializer({ path:
|
|
16275
|
+
if (path7) {
|
|
16276
|
+
url2 = defaultPathSerializer({ path: path7, url: url2 });
|
|
16253
16277
|
}
|
|
16254
16278
|
let search = query ? querySerializer(query) : "";
|
|
16255
16279
|
if (search.startsWith("?")) {
|
|
@@ -21709,6 +21733,21 @@ function signalProcessTree(child, signal) {
|
|
|
21709
21733
|
throw error51;
|
|
21710
21734
|
}
|
|
21711
21735
|
}
|
|
21736
|
+
function safeOpenCodeServerCwd(environment) {
|
|
21737
|
+
const candidates = [environment.USERPROFILE, environment.HOME, homedir(), tmpdir()];
|
|
21738
|
+
for (const candidate of candidates) {
|
|
21739
|
+
if (!candidate || !path4.isAbsolute(candidate))
|
|
21740
|
+
continue;
|
|
21741
|
+
try {
|
|
21742
|
+
if (!fs2.statSync(candidate).isDirectory())
|
|
21743
|
+
continue;
|
|
21744
|
+
fs2.accessSync(candidate, fs2.constants.R_OK | fs2.constants.W_OK);
|
|
21745
|
+
return candidate;
|
|
21746
|
+
} catch {
|
|
21747
|
+
}
|
|
21748
|
+
}
|
|
21749
|
+
return void 0;
|
|
21750
|
+
}
|
|
21712
21751
|
function managedOpenCodeEnvironment(environment, executionPolicy = "default") {
|
|
21713
21752
|
const merged = { ...environment ?? process.env };
|
|
21714
21753
|
const undefinedKeys = Object.entries(merged).filter(([, value]) => value === void 0).map(([key]) => key);
|
|
@@ -21806,6 +21845,10 @@ var OpenCodeServerConnection = class {
|
|
|
21806
21845
|
OPENCODE_SERVER_PASSWORD: password
|
|
21807
21846
|
};
|
|
21808
21847
|
const invocation = openCodeServerInvocation(executable, environment);
|
|
21848
|
+
const serverCwd = (this.#dependencies.resolveServerCwd ?? safeOpenCodeServerCwd)(environment);
|
|
21849
|
+
if (!serverCwd) {
|
|
21850
|
+
throw new OpenCodeTransportError("unavailable", "OpenCode Server requires a writable startup directory");
|
|
21851
|
+
}
|
|
21809
21852
|
let child;
|
|
21810
21853
|
try {
|
|
21811
21854
|
child = this.#dependencies.spawn(invocation.command, invocation.arguments, {
|
|
@@ -21813,7 +21856,8 @@ var OpenCodeServerConnection = class {
|
|
|
21813
21856
|
stdio: "pipe",
|
|
21814
21857
|
detached: process.platform !== "win32",
|
|
21815
21858
|
windowsHide: true,
|
|
21816
|
-
windowsVerbatimArguments: invocation.windowsVerbatimArguments
|
|
21859
|
+
windowsVerbatimArguments: invocation.windowsVerbatimArguments,
|
|
21860
|
+
cwd: serverCwd
|
|
21817
21861
|
});
|
|
21818
21862
|
} catch (error51) {
|
|
21819
21863
|
throw new OpenCodeTransportError(isMissingExecutable(error51) ? "notInstalled" : "unavailable", isMissingExecutable(error51) ? "OpenCode CLI is not installed" : "OpenCode Server failed to start", { cause: error51 });
|
|
@@ -22124,8 +22168,8 @@ var SdkOpenCodeTransport = class {
|
|
|
22124
22168
|
};
|
|
22125
22169
|
|
|
22126
22170
|
// dist/file-change-verification.js
|
|
22127
|
-
import
|
|
22128
|
-
import
|
|
22171
|
+
import fs3 from "node:fs";
|
|
22172
|
+
import path5 from "node:path";
|
|
22129
22173
|
function missingPath(error51) {
|
|
22130
22174
|
if (!error51 || typeof error51 !== "object")
|
|
22131
22175
|
return false;
|
|
@@ -22137,33 +22181,33 @@ function hasDotPathSegment(value) {
|
|
|
22137
22181
|
return segments.some((segment) => segment === "." || segment === "..");
|
|
22138
22182
|
}
|
|
22139
22183
|
function canonicalDirectoryPath(value) {
|
|
22140
|
-
let candidate =
|
|
22184
|
+
let candidate = path5.resolve(value);
|
|
22141
22185
|
const missingSegments = [];
|
|
22142
22186
|
for (; ; ) {
|
|
22143
22187
|
try {
|
|
22144
|
-
return
|
|
22188
|
+
return path5.join(fs3.realpathSync.native(candidate), ...missingSegments);
|
|
22145
22189
|
} catch (error51) {
|
|
22146
22190
|
if (!missingPath(error51))
|
|
22147
22191
|
return void 0;
|
|
22148
|
-
const parent =
|
|
22192
|
+
const parent = path5.dirname(candidate);
|
|
22149
22193
|
if (parent === candidate)
|
|
22150
22194
|
return void 0;
|
|
22151
|
-
missingSegments.unshift(
|
|
22195
|
+
missingSegments.unshift(path5.basename(candidate));
|
|
22152
22196
|
candidate = parent;
|
|
22153
22197
|
}
|
|
22154
22198
|
}
|
|
22155
22199
|
}
|
|
22156
22200
|
function canonicalFilePath(value) {
|
|
22157
|
-
const absolute =
|
|
22158
|
-
const parent = canonicalDirectoryPath(
|
|
22159
|
-
return parent ?
|
|
22201
|
+
const absolute = path5.resolve(value);
|
|
22202
|
+
const parent = canonicalDirectoryPath(path5.dirname(absolute));
|
|
22203
|
+
return parent ? path5.join(parent, path5.basename(absolute)) : void 0;
|
|
22160
22204
|
}
|
|
22161
22205
|
function pathIsWithin(root, candidate, allowRoot) {
|
|
22162
|
-
const relative =
|
|
22163
|
-
return allowRoot && relative === "" || relative !== "" && relative !== ".." && !relative.startsWith(`..${
|
|
22206
|
+
const relative = path5.relative(root, candidate);
|
|
22207
|
+
return allowRoot && relative === "" || relative !== "" && relative !== ".." && !relative.startsWith(`..${path5.sep}`) && !path5.isAbsolute(relative);
|
|
22164
22208
|
}
|
|
22165
22209
|
function verifiedOpenCodeWorktree(sessionDirectory, paths) {
|
|
22166
|
-
if (!paths || typeof paths !== "object" || typeof sessionDirectory !== "string" || typeof paths.directory !== "string" || typeof paths.worktree !== "string" || hasDotPathSegment(sessionDirectory) || hasDotPathSegment(paths.directory) || hasDotPathSegment(paths.worktree) || !
|
|
22210
|
+
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)) {
|
|
22167
22211
|
return void 0;
|
|
22168
22212
|
}
|
|
22169
22213
|
const session = canonicalDirectoryPath(sessionDirectory);
|
|
@@ -22175,10 +22219,10 @@ function verifiedOpenCodeWorktree(sessionDirectory, paths) {
|
|
|
22175
22219
|
return worktree;
|
|
22176
22220
|
}
|
|
22177
22221
|
function openCodeFileIdentity(file2, worktree) {
|
|
22178
|
-
if (typeof file2 !== "string" || typeof worktree !== "string" || hasDotPathSegment(file2) || hasDotPathSegment(worktree) || !
|
|
22222
|
+
if (typeof file2 !== "string" || typeof worktree !== "string" || hasDotPathSegment(file2) || hasDotPathSegment(worktree) || !path5.isAbsolute(worktree) || !file2 || file2.includes("\0") || file2.includes("\n") || file2.includes("\r")) {
|
|
22179
22223
|
return void 0;
|
|
22180
22224
|
}
|
|
22181
|
-
const candidate = canonicalFilePath(
|
|
22225
|
+
const candidate = canonicalFilePath(path5.isAbsolute(file2) ? file2 : path5.resolve(worktree, file2));
|
|
22182
22226
|
return candidate && pathIsWithin(worktree, candidate, false) ? candidate : void 0;
|
|
22183
22227
|
}
|
|
22184
22228
|
|
|
@@ -22466,9 +22510,9 @@ function normalizeError(error51, fallback) {
|
|
|
22466
22510
|
function sameCwd(left, right) {
|
|
22467
22511
|
const canonical = (value) => {
|
|
22468
22512
|
try {
|
|
22469
|
-
return
|
|
22513
|
+
return fs4.realpathSync.native(value);
|
|
22470
22514
|
} catch {
|
|
22471
|
-
return
|
|
22515
|
+
return path6.resolve(value);
|
|
22472
22516
|
}
|
|
22473
22517
|
};
|
|
22474
22518
|
return canonical(left) === canonical(right);
|
|
@@ -22821,7 +22865,7 @@ var OpenCodeHarnessSession = class {
|
|
|
22821
22865
|
}
|
|
22822
22866
|
}
|
|
22823
22867
|
async #selectModel(command) {
|
|
22824
|
-
if (this.#
|
|
22868
|
+
if (this.#configuring) {
|
|
22825
22869
|
return {
|
|
22826
22870
|
ok: false,
|
|
22827
22871
|
error: {
|
|
@@ -22865,7 +22909,7 @@ var OpenCodeHarnessSession = class {
|
|
|
22865
22909
|
if (!this.capabilities.configuration.selectThinkingOption) {
|
|
22866
22910
|
return { ok: false, error: unsupported("OpenCode Model variants are unavailable") };
|
|
22867
22911
|
}
|
|
22868
|
-
if (this.#
|
|
22912
|
+
if (this.#configuring) {
|
|
22869
22913
|
return {
|
|
22870
22914
|
ok: false,
|
|
22871
22915
|
error: {
|
|
@@ -23320,6 +23364,7 @@ var OpenCodeHarnessSession = class {
|
|
|
23320
23364
|
const item = {
|
|
23321
23365
|
type: "fileChange",
|
|
23322
23366
|
itemId: hostItemIdSchema.parse(id),
|
|
23367
|
+
sourceItemIds: [...active.items.values()].map(({ item: item2 }) => item2.itemId),
|
|
23323
23368
|
changes
|
|
23324
23369
|
};
|
|
23325
23370
|
active.items.set(id, { item, completed: false });
|
|
@@ -14526,6 +14526,46 @@ config(en_default());
|
|
|
14526
14526
|
// ../../shared-contracts/dist/version.js
|
|
14527
14527
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
14528
14528
|
|
|
14529
|
+
// ../../shared-contracts/dist/idle-release.js
|
|
14530
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
14531
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
14532
|
+
var idleReleaseSettingsSchema = external_exports.strictObject({
|
|
14533
|
+
enabled: external_exports.boolean(),
|
|
14534
|
+
timeoutMinutes: external_exports.number().int().min(IDLE_RELEASE_TIMEOUT_MINUTES_MIN).max(IDLE_RELEASE_TIMEOUT_MINUTES_MAX)
|
|
14535
|
+
});
|
|
14536
|
+
var DEFAULT_IDLE_RELEASE_SETTINGS = Object.freeze({
|
|
14537
|
+
enabled: false,
|
|
14538
|
+
timeoutMinutes: 30
|
|
14539
|
+
});
|
|
14540
|
+
|
|
14541
|
+
// ../../shared-contracts/dist/loaded-sessions.js
|
|
14542
|
+
var loadedSessionStateSchema = external_exports.enum([
|
|
14543
|
+
"idle",
|
|
14544
|
+
"running",
|
|
14545
|
+
"busy",
|
|
14546
|
+
"closing",
|
|
14547
|
+
"failed",
|
|
14548
|
+
"blocked"
|
|
14549
|
+
]);
|
|
14550
|
+
var loadedSessionReasonSchema = external_exports.enum([
|
|
14551
|
+
"none",
|
|
14552
|
+
"disabled",
|
|
14553
|
+
"timeout",
|
|
14554
|
+
"operation",
|
|
14555
|
+
"background",
|
|
14556
|
+
"identity",
|
|
14557
|
+
"persistence",
|
|
14558
|
+
"closeFailed"
|
|
14559
|
+
]);
|
|
14560
|
+
var loadedSessionsSchema = external_exports.array(external_exports.strictObject({
|
|
14561
|
+
threadId: external_exports.string(),
|
|
14562
|
+
title: external_exports.string(),
|
|
14563
|
+
harnessId: external_exports.string(),
|
|
14564
|
+
state: loadedSessionStateSchema,
|
|
14565
|
+
reason: loadedSessionReasonSchema,
|
|
14566
|
+
inactiveMs: external_exports.number().nonnegative()
|
|
14567
|
+
}));
|
|
14568
|
+
|
|
14529
14569
|
// ../../shared-contracts/dist/ids.js
|
|
14530
14570
|
var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
14531
14571
|
message: "Identifier must not be empty or whitespace"
|
|
@@ -14630,12 +14670,21 @@ var harnessAccountSnapshotSchema = external_exports.object({
|
|
|
14630
14670
|
plan: external_exports.string().trim().min(1).max(128).optional(),
|
|
14631
14671
|
credits: accountCreditsSnapshotSchema
|
|
14632
14672
|
}).strict();
|
|
14633
|
-
var
|
|
14673
|
+
var harnessAccountIdentityShape = {
|
|
14674
|
+
harnessId: harnessIdSchema,
|
|
14675
|
+
harnessName: external_exports.string().trim().min(1).max(128)
|
|
14676
|
+
};
|
|
14677
|
+
var harnessAccountSourceSchema = external_exports.object(harnessAccountIdentityShape).strict();
|
|
14678
|
+
var harnessAccountSourceListParamsSchema = external_exports.object({}).strict();
|
|
14679
|
+
var harnessAccountSourceListResultSchema = external_exports.object({ sources: external_exports.array(harnessAccountSourceSchema).max(128) }).strict();
|
|
14680
|
+
var harnessAccountInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
14681
|
+
var harnessAccountInspectResultSchema = external_exports.object({
|
|
14682
|
+
...harnessAccountIdentityShape,
|
|
14683
|
+
account: harnessAccountSnapshotSchema.nullable()
|
|
14684
|
+
}).strict();
|
|
14685
|
+
var harnessAccountListParamsSchema = external_exports.object({ refresh: external_exports.boolean().optional() }).strict();
|
|
14634
14686
|
var harnessAccountListResultSchema = external_exports.object({
|
|
14635
|
-
accounts: external_exports.array(harnessAccountSnapshotSchema.extend(
|
|
14636
|
-
harnessId: harnessIdSchema,
|
|
14637
|
-
harnessName: external_exports.string().min(1)
|
|
14638
|
-
})).max(128)
|
|
14687
|
+
accounts: external_exports.array(harnessAccountSnapshotSchema.extend(harnessAccountIdentityShape)).max(128)
|
|
14639
14688
|
}).strict();
|
|
14640
14689
|
|
|
14641
14690
|
// ../../shared-contracts/dist/json-value.js
|
|
@@ -14928,7 +14977,6 @@ var threadInspectionParamsSchema = external_exports.object({
|
|
|
14928
14977
|
}).strict();
|
|
14929
14978
|
var codexThreadInspectionSchema = external_exports.object({
|
|
14930
14979
|
owner: external_exports.literal("codex"),
|
|
14931
|
-
accountId: nonBlankTextSchema2.optional(),
|
|
14932
14980
|
locked: external_exports.literal(true)
|
|
14933
14981
|
}).strict();
|
|
14934
14982
|
var externalThreadInspectionSchema = external_exports.object({
|
|
@@ -15066,52 +15114,24 @@ var codexAccountSchema = external_exports.object({
|
|
|
15066
15114
|
accountId: accountIdSchema,
|
|
15067
15115
|
label: nonBlankTextSchema3.max(256),
|
|
15068
15116
|
email: external_exports.string().email().max(320).optional(),
|
|
15069
|
-
planType: codexAccountPlanTypeSchema.optional()
|
|
15070
|
-
codexHome: nonBlankTextSchema3.max(16384),
|
|
15071
|
-
active: external_exports.boolean(),
|
|
15072
|
-
isDefault: external_exports.boolean()
|
|
15117
|
+
planType: codexAccountPlanTypeSchema.optional()
|
|
15073
15118
|
}).strict();
|
|
15074
|
-
var
|
|
15075
|
-
var
|
|
15076
|
-
|
|
15077
|
-
|
|
15078
|
-
|
|
15079
|
-
|
|
15080
|
-
|
|
15081
|
-
|
|
15082
|
-
accountId: accountIdSchema,
|
|
15083
|
-
loginId: nonBlankTextSchema3.max(1024),
|
|
15084
|
-
verificationUrl: external_exports.string().url().max(16384),
|
|
15085
|
-
userCode: nonBlankTextSchema3.max(1024)
|
|
15086
|
-
}).strict();
|
|
15087
|
-
var codexAccountLoginCancelParamsSchema = external_exports.object({ accountId: accountIdSchema.optional(), loginId: nonBlankTextSchema3.max(1024) }).strict();
|
|
15088
|
-
var codexAccountLoginCancelResultSchema = external_exports.object({ cancelled: external_exports.boolean() }).strict();
|
|
15089
|
-
var codexAccountLoginCompletedSchema = external_exports.object({
|
|
15090
|
-
accountId: accountIdSchema,
|
|
15091
|
-
loginId: nonBlankTextSchema3.max(1024),
|
|
15092
|
-
success: external_exports.boolean(),
|
|
15093
|
-
error: external_exports.string().max(4096).nullable()
|
|
15119
|
+
var codexAccountPhaseSchema = external_exports.enum(["ready", "unavailable"]);
|
|
15120
|
+
var codexAccountListResultSchema = external_exports.object({
|
|
15121
|
+
version: external_exports.literal(2),
|
|
15122
|
+
currentAccountId: accountIdSchema.nullable(),
|
|
15123
|
+
phase: codexAccountPhaseSchema,
|
|
15124
|
+
revision: external_exports.number().int().nonnegative(),
|
|
15125
|
+
instanceId: nonBlankTextSchema3.max(1024).optional(),
|
|
15126
|
+
accounts: external_exports.array(codexAccountSchema).max(1)
|
|
15094
15127
|
}).strict();
|
|
15095
|
-
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema }).strict();
|
|
15128
|
+
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
15096
15129
|
var codexAccountUsageResultSchema = external_exports.object({
|
|
15097
15130
|
accountId: accountIdSchema,
|
|
15098
15131
|
usage: threadUsageSnapshotSchema.nullable(),
|
|
15099
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15100
|
-
|
|
15101
|
-
|
|
15102
|
-
accountId: accountIdSchema,
|
|
15103
|
-
idempotencyKey: external_exports.string().uuid().optional()
|
|
15104
|
-
}).strict();
|
|
15105
|
-
var codexAccountResetCreditConsumeOutcomeSchema = external_exports.enum([
|
|
15106
|
-
"reset",
|
|
15107
|
-
"nothingToReset",
|
|
15108
|
-
"noCredit",
|
|
15109
|
-
"alreadyRedeemed"
|
|
15110
|
-
]);
|
|
15111
|
-
var codexAccountResetCreditConsumeResultSchema = external_exports.object({
|
|
15112
|
-
accountId: accountIdSchema,
|
|
15113
|
-
outcome: codexAccountResetCreditConsumeOutcomeSchema,
|
|
15114
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15132
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
15133
|
+
freshness: external_exports.enum(["live", "cached"]),
|
|
15134
|
+
observedAt: external_exports.string().datetime().nullable()
|
|
15115
15135
|
}).strict();
|
|
15116
15136
|
|
|
15117
15137
|
// ../../shared-contracts/dist/harness-session-import.js
|
|
@@ -18610,7 +18630,8 @@ function synthesizeFileChange(kind, args, cwd) {
|
|
|
18610
18630
|
{
|
|
18611
18631
|
path: displayed.path,
|
|
18612
18632
|
kind: "add",
|
|
18613
|
-
unifiedDiff: createTwoFilesPatch(oldHeader2, newHeader2, "", content, "", "", { context: 3 })
|
|
18633
|
+
unifiedDiff: createTwoFilesPatch(oldHeader2, newHeader2, "", content, "", "", { context: 3 }),
|
|
18634
|
+
diffScope: "fragment"
|
|
18614
18635
|
}
|
|
18615
18636
|
];
|
|
18616
18637
|
}
|
|
@@ -18632,7 +18653,8 @@ function synthesizeFileChange(kind, args, cwd) {
|
|
|
18632
18653
|
kind: "update",
|
|
18633
18654
|
unifiedDiff: createTwoFilesPatch(oldHeader, newHeader, oldText, newText, "", "", {
|
|
18634
18655
|
context: 3
|
|
18635
|
-
})
|
|
18656
|
+
}),
|
|
18657
|
+
diffScope: "fragment"
|
|
18636
18658
|
}
|
|
18637
18659
|
];
|
|
18638
18660
|
}
|
|
@@ -18926,7 +18948,7 @@ var PiHarnessSession = class {
|
|
|
18926
18948
|
}
|
|
18927
18949
|
}
|
|
18928
18950
|
async #selectModel(command) {
|
|
18929
|
-
if (this.#acceptingTurn || this.#
|
|
18951
|
+
if (this.#acceptingTurn || this.#configuring) {
|
|
18930
18952
|
return {
|
|
18931
18953
|
ok: false,
|
|
18932
18954
|
error: {
|
|
@@ -18995,7 +19017,7 @@ var PiHarnessSession = class {
|
|
|
18995
19017
|
}
|
|
18996
19018
|
};
|
|
18997
19019
|
}
|
|
18998
|
-
if (this.#acceptingTurn || this.#
|
|
19020
|
+
if (this.#acceptingTurn || this.#configuring) {
|
|
18999
19021
|
return {
|
|
19000
19022
|
ok: false,
|
|
19001
19023
|
error: {
|
|
@@ -19665,12 +19687,17 @@ var PiHarnessSession = class {
|
|
|
19665
19687
|
try {
|
|
19666
19688
|
const kind = fileMutatingKind(event.toolName);
|
|
19667
19689
|
const args = tool.item.type === "toolExecution" ? tool.item.arguments : {};
|
|
19668
|
-
if (kind && synthesizeFileChange(kind, args, this.#cwd)) {
|
|
19690
|
+
if (kind && !patchFromResult(event.result) && synthesizeFileChange(kind, args, this.#cwd)) {
|
|
19669
19691
|
return;
|
|
19670
19692
|
}
|
|
19671
19693
|
const changes = reliableFileChange(event.toolName, args, event.result, this.#cwd);
|
|
19672
19694
|
if (changes) {
|
|
19673
|
-
const fileItem = {
|
|
19695
|
+
const fileItem = {
|
|
19696
|
+
type: "fileChange",
|
|
19697
|
+
itemId: this.#newItemId(),
|
|
19698
|
+
sourceItemIds: [tool.item.itemId],
|
|
19699
|
+
changes
|
|
19700
|
+
};
|
|
19674
19701
|
this.#event({ type: "item.started", turnId: active.command.turnId, item: fileItem });
|
|
19675
19702
|
this.#completeItem(active, fileItem, { status: "succeeded" });
|
|
19676
19703
|
}
|