@liberseek/boft-cli-win32-arm64 0.6.8 → 0.7.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/THIRD_PARTY_NOTICES.txt +16 -0
- package/app/codexhost-distribution.json +1 -1
- package/app/desktop-controller.mjs +184 -47
- package/app/host-runtime.mjs +5449 -4221
- package/app/plugins/antigravity/plugin.mjs +70 -61
- package/app/plugins/claude-code/plugin.mjs +85 -58
- package/app/plugins/codebuddy/plugin.mjs +102 -69
- package/app/plugins/cursor-cli/plugin.mjs +69 -50
- package/app/plugins/deepseek-harness/plugin.mjs +81 -53
- package/app/plugins/enabled.json +3 -1
- package/app/plugins/grok/plugin.mjs +94 -61
- package/app/plugins/hermes/plugin.mjs +308 -95
- package/app/plugins/kiro-cli/plugin.mjs +76 -49
- package/app/plugins/muse/plugin.mjs +66 -46
- package/app/plugins/omp/plugin.mjs +79 -52
- package/app/plugins/opencode/plugin.mjs +118 -92
- package/app/plugins/pi/plugin.mjs +79 -52
- package/app/plugins/qoder/assets/icon.svg +1 -0
- package/app/plugins/qoder/manifest.json +12 -0
- package/app/plugins/qoder/plugin.mjs +52290 -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 +52288 -0
- package/app/renderer-extension.js +3857 -1175
- package/bin/boft.exe +0 -0
- package/libexec/boft-node-repl.exe +0 -0
- package/libexec/boft-shim.exe +0 -0
- package/libexec/boft-updater.exe +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
|
@@ -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"
|
|
@@ -14647,12 +14687,21 @@ var harnessAccountSnapshotSchema = external_exports.object({
|
|
|
14647
14687
|
plan: external_exports.string().trim().min(1).max(128).optional(),
|
|
14648
14688
|
credits: accountCreditsSnapshotSchema
|
|
14649
14689
|
}).strict();
|
|
14650
|
-
var
|
|
14690
|
+
var harnessAccountIdentityShape = {
|
|
14691
|
+
harnessId: harnessIdSchema,
|
|
14692
|
+
harnessName: external_exports.string().trim().min(1).max(128)
|
|
14693
|
+
};
|
|
14694
|
+
var harnessAccountSourceSchema = external_exports.object(harnessAccountIdentityShape).strict();
|
|
14695
|
+
var harnessAccountSourceListParamsSchema = external_exports.object({}).strict();
|
|
14696
|
+
var harnessAccountSourceListResultSchema = external_exports.object({ sources: external_exports.array(harnessAccountSourceSchema).max(128) }).strict();
|
|
14697
|
+
var harnessAccountInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
14698
|
+
var harnessAccountInspectResultSchema = external_exports.object({
|
|
14699
|
+
...harnessAccountIdentityShape,
|
|
14700
|
+
account: harnessAccountSnapshotSchema.nullable()
|
|
14701
|
+
}).strict();
|
|
14702
|
+
var harnessAccountListParamsSchema = external_exports.object({ refresh: external_exports.boolean().optional() }).strict();
|
|
14651
14703
|
var harnessAccountListResultSchema = external_exports.object({
|
|
14652
|
-
accounts: external_exports.array(harnessAccountSnapshotSchema.extend(
|
|
14653
|
-
harnessId: harnessIdSchema,
|
|
14654
|
-
harnessName: external_exports.string().min(1)
|
|
14655
|
-
})).max(128)
|
|
14704
|
+
accounts: external_exports.array(harnessAccountSnapshotSchema.extend(harnessAccountIdentityShape)).max(128)
|
|
14656
14705
|
}).strict();
|
|
14657
14706
|
|
|
14658
14707
|
// ../../shared-contracts/dist/json-value.js
|
|
@@ -14948,7 +14997,6 @@ var threadInspectionParamsSchema = external_exports.object({
|
|
|
14948
14997
|
}).strict();
|
|
14949
14998
|
var codexThreadInspectionSchema = external_exports.object({
|
|
14950
14999
|
owner: external_exports.literal("codex"),
|
|
14951
|
-
accountId: nonBlankTextSchema2.optional(),
|
|
14952
15000
|
locked: external_exports.literal(true)
|
|
14953
15001
|
}).strict();
|
|
14954
15002
|
var externalThreadInspectionSchema = external_exports.object({
|
|
@@ -15090,53 +15138,25 @@ var codexAccountSchema = external_exports.object({
|
|
|
15090
15138
|
label: nonBlankTextSchema3.max(256),
|
|
15091
15139
|
email: external_exports.string().email().max(320).optional(),
|
|
15092
15140
|
planType: codexAccountPlanTypeSchema.optional(),
|
|
15093
|
-
codexHome: nonBlankTextSchema3.max(16384),
|
|
15094
|
-
active: external_exports.boolean(),
|
|
15095
|
-
isDefault: external_exports.boolean(),
|
|
15096
15141
|
authKind: codexAccountAuthKindSchema.optional(),
|
|
15097
15142
|
authIdentity: nonBlankTextSchema3.max(256).optional()
|
|
15098
15143
|
}).strict();
|
|
15099
|
-
var
|
|
15100
|
-
var
|
|
15101
|
-
|
|
15102
|
-
|
|
15103
|
-
|
|
15104
|
-
|
|
15105
|
-
|
|
15106
|
-
|
|
15107
|
-
accountId: accountIdSchema,
|
|
15108
|
-
loginId: nonBlankTextSchema3.max(1024),
|
|
15109
|
-
verificationUrl: external_exports.string().url().max(16384),
|
|
15110
|
-
userCode: nonBlankTextSchema3.max(1024)
|
|
15111
|
-
}).strict();
|
|
15112
|
-
var codexAccountLoginCancelParamsSchema = external_exports.object({ accountId: accountIdSchema.optional(), loginId: nonBlankTextSchema3.max(1024) }).strict();
|
|
15113
|
-
var codexAccountLoginCancelResultSchema = external_exports.object({ cancelled: external_exports.boolean() }).strict();
|
|
15114
|
-
var codexAccountLoginCompletedSchema = external_exports.object({
|
|
15115
|
-
accountId: accountIdSchema,
|
|
15116
|
-
loginId: nonBlankTextSchema3.max(1024),
|
|
15117
|
-
success: external_exports.boolean(),
|
|
15118
|
-
error: external_exports.string().max(4096).nullable()
|
|
15144
|
+
var codexAccountPhaseSchema = external_exports.enum(["ready", "unavailable"]);
|
|
15145
|
+
var codexAccountListResultSchema = external_exports.object({
|
|
15146
|
+
version: external_exports.literal(2),
|
|
15147
|
+
currentAccountId: accountIdSchema.nullable(),
|
|
15148
|
+
phase: codexAccountPhaseSchema,
|
|
15149
|
+
revision: external_exports.number().int().nonnegative(),
|
|
15150
|
+
instanceId: nonBlankTextSchema3.max(1024).optional(),
|
|
15151
|
+
accounts: external_exports.array(codexAccountSchema).max(1)
|
|
15119
15152
|
}).strict();
|
|
15120
|
-
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema }).strict();
|
|
15153
|
+
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
15121
15154
|
var codexAccountUsageResultSchema = external_exports.object({
|
|
15122
15155
|
accountId: accountIdSchema,
|
|
15123
15156
|
usage: threadUsageSnapshotSchema.nullable(),
|
|
15124
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15125
|
-
|
|
15126
|
-
|
|
15127
|
-
accountId: accountIdSchema,
|
|
15128
|
-
idempotencyKey: external_exports.string().uuid().optional()
|
|
15129
|
-
}).strict();
|
|
15130
|
-
var codexAccountResetCreditConsumeOutcomeSchema = external_exports.enum([
|
|
15131
|
-
"reset",
|
|
15132
|
-
"nothingToReset",
|
|
15133
|
-
"noCredit",
|
|
15134
|
-
"alreadyRedeemed"
|
|
15135
|
-
]);
|
|
15136
|
-
var codexAccountResetCreditConsumeResultSchema = external_exports.object({
|
|
15137
|
-
accountId: accountIdSchema,
|
|
15138
|
-
outcome: codexAccountResetCreditConsumeOutcomeSchema,
|
|
15139
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15157
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
15158
|
+
freshness: external_exports.enum(["live", "cached"]),
|
|
15159
|
+
observedAt: external_exports.string().datetime().nullable()
|
|
15140
15160
|
}).strict();
|
|
15141
15161
|
|
|
15142
15162
|
// ../../shared-contracts/dist/harness-session-import.js
|
|
@@ -15881,6 +15901,7 @@ function projectOpenCodeHistory(input) {
|
|
|
15881
15901
|
const item = {
|
|
15882
15902
|
type: "fileChange",
|
|
15883
15903
|
itemId: itemId(`opencode-diff:${userEntry.info.id}`),
|
|
15904
|
+
sourceItemIds: items.map(({ item: item2 }) => item2.itemId),
|
|
15884
15905
|
changes
|
|
15885
15906
|
};
|
|
15886
15907
|
items.push({ item, outcome: { status: "succeeded" } });
|
|
@@ -16002,6 +16023,7 @@ import { randomBytes } from "node:crypto";
|
|
|
16002
16023
|
import { spawn, spawnSync } from "node:child_process";
|
|
16003
16024
|
import fs2 from "node:fs";
|
|
16004
16025
|
import { homedir, tmpdir } from "node:os";
|
|
16026
|
+
import path4 from "node:path";
|
|
16005
16027
|
|
|
16006
16028
|
// ../../../node_modules/@opencode-ai/sdk/dist/v2/gen/core/serverSentEvents.gen.js
|
|
16007
16029
|
var createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url: url2, ...options }) => {
|
|
@@ -16227,7 +16249,7 @@ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueO
|
|
|
16227
16249
|
|
|
16228
16250
|
// ../../../node_modules/@opencode-ai/sdk/dist/v2/gen/core/utils.gen.js
|
|
16229
16251
|
var PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
16230
|
-
var defaultPathSerializer = ({ path:
|
|
16252
|
+
var defaultPathSerializer = ({ path: path7, url: _url2 }) => {
|
|
16231
16253
|
let url2 = _url2;
|
|
16232
16254
|
const matches = _url2.match(PATH_PARAM_RE);
|
|
16233
16255
|
if (matches) {
|
|
@@ -16246,7 +16268,7 @@ var defaultPathSerializer = ({ path: path6, url: _url2 }) => {
|
|
|
16246
16268
|
name = name.substring(1);
|
|
16247
16269
|
style = "matrix";
|
|
16248
16270
|
}
|
|
16249
|
-
const value =
|
|
16271
|
+
const value = path7[name];
|
|
16250
16272
|
if (value === void 0 || value === null) {
|
|
16251
16273
|
continue;
|
|
16252
16274
|
}
|
|
@@ -16277,11 +16299,11 @@ var defaultPathSerializer = ({ path: path6, url: _url2 }) => {
|
|
|
16277
16299
|
}
|
|
16278
16300
|
return url2;
|
|
16279
16301
|
};
|
|
16280
|
-
var getUrl = ({ baseUrl, path:
|
|
16302
|
+
var getUrl = ({ baseUrl, path: path7, query, querySerializer, url: _url2 }) => {
|
|
16281
16303
|
const pathUrl = _url2.startsWith("/") ? _url2 : `/${_url2}`;
|
|
16282
16304
|
let url2 = (baseUrl ?? "") + pathUrl;
|
|
16283
|
-
if (
|
|
16284
|
-
url2 = defaultPathSerializer({ path:
|
|
16305
|
+
if (path7) {
|
|
16306
|
+
url2 = defaultPathSerializer({ path: path7, url: url2 });
|
|
16285
16307
|
}
|
|
16286
16308
|
let search = query ? querySerializer(query) : "";
|
|
16287
16309
|
if (search.startsWith("?")) {
|
|
@@ -21744,7 +21766,7 @@ function signalProcessTree(child, signal) {
|
|
|
21744
21766
|
function safeOpenCodeServerCwd(environment) {
|
|
21745
21767
|
const candidates = [environment.USERPROFILE, environment.HOME, homedir(), tmpdir()];
|
|
21746
21768
|
for (const candidate of candidates) {
|
|
21747
|
-
if (!candidate)
|
|
21769
|
+
if (!candidate || !path4.isAbsolute(candidate))
|
|
21748
21770
|
continue;
|
|
21749
21771
|
try {
|
|
21750
21772
|
if (!fs2.statSync(candidate).isDirectory())
|
|
@@ -21853,7 +21875,10 @@ var OpenCodeServerConnection = class {
|
|
|
21853
21875
|
OPENCODE_SERVER_PASSWORD: password
|
|
21854
21876
|
};
|
|
21855
21877
|
const invocation = openCodeServerInvocation(executable, environment);
|
|
21856
|
-
const serverCwd = safeOpenCodeServerCwd(environment);
|
|
21878
|
+
const serverCwd = (this.#dependencies.resolveServerCwd ?? safeOpenCodeServerCwd)(environment);
|
|
21879
|
+
if (!serverCwd) {
|
|
21880
|
+
throw new OpenCodeTransportError("unavailable", "OpenCode Server requires a writable startup directory");
|
|
21881
|
+
}
|
|
21857
21882
|
let child;
|
|
21858
21883
|
try {
|
|
21859
21884
|
child = this.#dependencies.spawn(invocation.command, invocation.arguments, {
|
|
@@ -21862,7 +21887,7 @@ var OpenCodeServerConnection = class {
|
|
|
21862
21887
|
detached: process.platform !== "win32",
|
|
21863
21888
|
windowsHide: true,
|
|
21864
21889
|
windowsVerbatimArguments: invocation.windowsVerbatimArguments,
|
|
21865
|
-
|
|
21890
|
+
cwd: serverCwd
|
|
21866
21891
|
});
|
|
21867
21892
|
} catch (error51) {
|
|
21868
21893
|
throw new OpenCodeTransportError(isMissingExecutable(error51) ? "notInstalled" : "unavailable", isMissingExecutable(error51) ? "OpenCode CLI is not installed" : "OpenCode Server failed to start", { cause: error51 });
|
|
@@ -22174,7 +22199,7 @@ var SdkOpenCodeTransport = class {
|
|
|
22174
22199
|
|
|
22175
22200
|
// dist/file-change-verification.js
|
|
22176
22201
|
import fs3 from "node:fs";
|
|
22177
|
-
import
|
|
22202
|
+
import path5 from "node:path";
|
|
22178
22203
|
function missingPath(error51) {
|
|
22179
22204
|
if (!error51 || typeof error51 !== "object")
|
|
22180
22205
|
return false;
|
|
@@ -22186,33 +22211,33 @@ function hasDotPathSegment(value) {
|
|
|
22186
22211
|
return segments.some((segment) => segment === "." || segment === "..");
|
|
22187
22212
|
}
|
|
22188
22213
|
function canonicalDirectoryPath(value) {
|
|
22189
|
-
let candidate =
|
|
22214
|
+
let candidate = path5.resolve(value);
|
|
22190
22215
|
const missingSegments = [];
|
|
22191
22216
|
for (; ; ) {
|
|
22192
22217
|
try {
|
|
22193
|
-
return
|
|
22218
|
+
return path5.join(fs3.realpathSync.native(candidate), ...missingSegments);
|
|
22194
22219
|
} catch (error51) {
|
|
22195
22220
|
if (!missingPath(error51))
|
|
22196
22221
|
return void 0;
|
|
22197
|
-
const parent =
|
|
22222
|
+
const parent = path5.dirname(candidate);
|
|
22198
22223
|
if (parent === candidate)
|
|
22199
22224
|
return void 0;
|
|
22200
|
-
missingSegments.unshift(
|
|
22225
|
+
missingSegments.unshift(path5.basename(candidate));
|
|
22201
22226
|
candidate = parent;
|
|
22202
22227
|
}
|
|
22203
22228
|
}
|
|
22204
22229
|
}
|
|
22205
22230
|
function canonicalFilePath(value) {
|
|
22206
|
-
const absolute =
|
|
22207
|
-
const parent = canonicalDirectoryPath(
|
|
22208
|
-
return parent ?
|
|
22231
|
+
const absolute = path5.resolve(value);
|
|
22232
|
+
const parent = canonicalDirectoryPath(path5.dirname(absolute));
|
|
22233
|
+
return parent ? path5.join(parent, path5.basename(absolute)) : void 0;
|
|
22209
22234
|
}
|
|
22210
22235
|
function pathIsWithin(root, candidate, allowRoot) {
|
|
22211
|
-
const relative =
|
|
22212
|
-
return allowRoot && relative === "" || relative !== "" && relative !== ".." && !relative.startsWith(`..${
|
|
22236
|
+
const relative = path5.relative(root, candidate);
|
|
22237
|
+
return allowRoot && relative === "" || relative !== "" && relative !== ".." && !relative.startsWith(`..${path5.sep}`) && !path5.isAbsolute(relative);
|
|
22213
22238
|
}
|
|
22214
22239
|
function verifiedOpenCodeWorktree(sessionDirectory, paths) {
|
|
22215
|
-
if (!paths || typeof paths !== "object" || typeof sessionDirectory !== "string" || typeof paths.directory !== "string" || typeof paths.worktree !== "string" || hasDotPathSegment(sessionDirectory) || hasDotPathSegment(paths.directory) || hasDotPathSegment(paths.worktree) || !
|
|
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) || !path5.isAbsolute(sessionDirectory) || !path5.isAbsolute(paths.directory) || !path5.isAbsolute(paths.worktree)) {
|
|
22216
22241
|
return void 0;
|
|
22217
22242
|
}
|
|
22218
22243
|
const session = canonicalDirectoryPath(sessionDirectory);
|
|
@@ -22224,10 +22249,10 @@ function verifiedOpenCodeWorktree(sessionDirectory, paths) {
|
|
|
22224
22249
|
return worktree;
|
|
22225
22250
|
}
|
|
22226
22251
|
function openCodeFileIdentity(file2, worktree) {
|
|
22227
|
-
if (typeof file2 !== "string" || typeof worktree !== "string" || hasDotPathSegment(file2) || hasDotPathSegment(worktree) || !
|
|
22252
|
+
if (typeof file2 !== "string" || typeof worktree !== "string" || hasDotPathSegment(file2) || hasDotPathSegment(worktree) || !path5.isAbsolute(worktree) || !file2 || file2.includes("\0") || file2.includes("\n") || file2.includes("\r")) {
|
|
22228
22253
|
return void 0;
|
|
22229
22254
|
}
|
|
22230
|
-
const candidate = canonicalFilePath(
|
|
22255
|
+
const candidate = canonicalFilePath(path5.isAbsolute(file2) ? file2 : path5.resolve(worktree, file2));
|
|
22231
22256
|
return candidate && pathIsWithin(worktree, candidate, false) ? candidate : void 0;
|
|
22232
22257
|
}
|
|
22233
22258
|
|
|
@@ -22516,7 +22541,7 @@ function sameCwd(left, right) {
|
|
|
22516
22541
|
try {
|
|
22517
22542
|
return fs4.realpathSync.native(value);
|
|
22518
22543
|
} catch {
|
|
22519
|
-
return
|
|
22544
|
+
return path6.resolve(value);
|
|
22520
22545
|
}
|
|
22521
22546
|
};
|
|
22522
22547
|
return canonical(left) === canonical(right);
|
|
@@ -22874,7 +22899,7 @@ var OpenCodeHarnessSession = class {
|
|
|
22874
22899
|
}
|
|
22875
22900
|
}
|
|
22876
22901
|
async #selectModel(command) {
|
|
22877
|
-
if (this.#
|
|
22902
|
+
if (this.#configuring) {
|
|
22878
22903
|
return {
|
|
22879
22904
|
ok: false,
|
|
22880
22905
|
error: {
|
|
@@ -22918,7 +22943,7 @@ var OpenCodeHarnessSession = class {
|
|
|
22918
22943
|
if (!this.capabilities.configuration.selectThinkingOption) {
|
|
22919
22944
|
return { ok: false, error: unsupported("OpenCode Model variants are unavailable") };
|
|
22920
22945
|
}
|
|
22921
|
-
if (this.#
|
|
22946
|
+
if (this.#configuring) {
|
|
22922
22947
|
return {
|
|
22923
22948
|
ok: false,
|
|
22924
22949
|
error: {
|
|
@@ -23373,6 +23398,7 @@ var OpenCodeHarnessSession = class {
|
|
|
23373
23398
|
const item = {
|
|
23374
23399
|
type: "fileChange",
|
|
23375
23400
|
itemId: hostItemIdSchema.parse(id),
|
|
23401
|
+
sourceItemIds: [...active.items.values()].map(({ item: item2 }) => item2.itemId),
|
|
23376
23402
|
changes
|
|
23377
23403
|
};
|
|
23378
23404
|
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"
|
|
@@ -14646,12 +14686,21 @@ var harnessAccountSnapshotSchema = external_exports.object({
|
|
|
14646
14686
|
plan: external_exports.string().trim().min(1).max(128).optional(),
|
|
14647
14687
|
credits: accountCreditsSnapshotSchema
|
|
14648
14688
|
}).strict();
|
|
14649
|
-
var
|
|
14689
|
+
var harnessAccountIdentityShape = {
|
|
14690
|
+
harnessId: harnessIdSchema,
|
|
14691
|
+
harnessName: external_exports.string().trim().min(1).max(128)
|
|
14692
|
+
};
|
|
14693
|
+
var harnessAccountSourceSchema = external_exports.object(harnessAccountIdentityShape).strict();
|
|
14694
|
+
var harnessAccountSourceListParamsSchema = external_exports.object({}).strict();
|
|
14695
|
+
var harnessAccountSourceListResultSchema = external_exports.object({ sources: external_exports.array(harnessAccountSourceSchema).max(128) }).strict();
|
|
14696
|
+
var harnessAccountInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
14697
|
+
var harnessAccountInspectResultSchema = external_exports.object({
|
|
14698
|
+
...harnessAccountIdentityShape,
|
|
14699
|
+
account: harnessAccountSnapshotSchema.nullable()
|
|
14700
|
+
}).strict();
|
|
14701
|
+
var harnessAccountListParamsSchema = external_exports.object({ refresh: external_exports.boolean().optional() }).strict();
|
|
14650
14702
|
var harnessAccountListResultSchema = external_exports.object({
|
|
14651
|
-
accounts: external_exports.array(harnessAccountSnapshotSchema.extend(
|
|
14652
|
-
harnessId: harnessIdSchema,
|
|
14653
|
-
harnessName: external_exports.string().min(1)
|
|
14654
|
-
})).max(128)
|
|
14703
|
+
accounts: external_exports.array(harnessAccountSnapshotSchema.extend(harnessAccountIdentityShape)).max(128)
|
|
14655
14704
|
}).strict();
|
|
14656
14705
|
|
|
14657
14706
|
// ../../shared-contracts/dist/json-value.js
|
|
@@ -14947,7 +14996,6 @@ var threadInspectionParamsSchema = external_exports.object({
|
|
|
14947
14996
|
}).strict();
|
|
14948
14997
|
var codexThreadInspectionSchema = external_exports.object({
|
|
14949
14998
|
owner: external_exports.literal("codex"),
|
|
14950
|
-
accountId: nonBlankTextSchema2.optional(),
|
|
14951
14999
|
locked: external_exports.literal(true)
|
|
14952
15000
|
}).strict();
|
|
14953
15001
|
var externalThreadInspectionSchema = external_exports.object({
|
|
@@ -15089,53 +15137,25 @@ var codexAccountSchema = external_exports.object({
|
|
|
15089
15137
|
label: nonBlankTextSchema3.max(256),
|
|
15090
15138
|
email: external_exports.string().email().max(320).optional(),
|
|
15091
15139
|
planType: codexAccountPlanTypeSchema.optional(),
|
|
15092
|
-
codexHome: nonBlankTextSchema3.max(16384),
|
|
15093
|
-
active: external_exports.boolean(),
|
|
15094
|
-
isDefault: external_exports.boolean(),
|
|
15095
15140
|
authKind: codexAccountAuthKindSchema.optional(),
|
|
15096
15141
|
authIdentity: nonBlankTextSchema3.max(256).optional()
|
|
15097
15142
|
}).strict();
|
|
15098
|
-
var
|
|
15099
|
-
var
|
|
15100
|
-
|
|
15101
|
-
|
|
15102
|
-
|
|
15103
|
-
|
|
15104
|
-
|
|
15105
|
-
|
|
15106
|
-
accountId: accountIdSchema,
|
|
15107
|
-
loginId: nonBlankTextSchema3.max(1024),
|
|
15108
|
-
verificationUrl: external_exports.string().url().max(16384),
|
|
15109
|
-
userCode: nonBlankTextSchema3.max(1024)
|
|
15110
|
-
}).strict();
|
|
15111
|
-
var codexAccountLoginCancelParamsSchema = external_exports.object({ accountId: accountIdSchema.optional(), loginId: nonBlankTextSchema3.max(1024) }).strict();
|
|
15112
|
-
var codexAccountLoginCancelResultSchema = external_exports.object({ cancelled: external_exports.boolean() }).strict();
|
|
15113
|
-
var codexAccountLoginCompletedSchema = external_exports.object({
|
|
15114
|
-
accountId: accountIdSchema,
|
|
15115
|
-
loginId: nonBlankTextSchema3.max(1024),
|
|
15116
|
-
success: external_exports.boolean(),
|
|
15117
|
-
error: external_exports.string().max(4096).nullable()
|
|
15143
|
+
var codexAccountPhaseSchema = external_exports.enum(["ready", "unavailable"]);
|
|
15144
|
+
var codexAccountListResultSchema = external_exports.object({
|
|
15145
|
+
version: external_exports.literal(2),
|
|
15146
|
+
currentAccountId: accountIdSchema.nullable(),
|
|
15147
|
+
phase: codexAccountPhaseSchema,
|
|
15148
|
+
revision: external_exports.number().int().nonnegative(),
|
|
15149
|
+
instanceId: nonBlankTextSchema3.max(1024).optional(),
|
|
15150
|
+
accounts: external_exports.array(codexAccountSchema).max(1)
|
|
15118
15151
|
}).strict();
|
|
15119
|
-
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema }).strict();
|
|
15152
|
+
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
15120
15153
|
var codexAccountUsageResultSchema = external_exports.object({
|
|
15121
15154
|
accountId: accountIdSchema,
|
|
15122
15155
|
usage: threadUsageSnapshotSchema.nullable(),
|
|
15123
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15124
|
-
|
|
15125
|
-
|
|
15126
|
-
accountId: accountIdSchema,
|
|
15127
|
-
idempotencyKey: external_exports.string().uuid().optional()
|
|
15128
|
-
}).strict();
|
|
15129
|
-
var codexAccountResetCreditConsumeOutcomeSchema = external_exports.enum([
|
|
15130
|
-
"reset",
|
|
15131
|
-
"nothingToReset",
|
|
15132
|
-
"noCredit",
|
|
15133
|
-
"alreadyRedeemed"
|
|
15134
|
-
]);
|
|
15135
|
-
var codexAccountResetCreditConsumeResultSchema = external_exports.object({
|
|
15136
|
-
accountId: accountIdSchema,
|
|
15137
|
-
outcome: codexAccountResetCreditConsumeOutcomeSchema,
|
|
15138
|
-
accountCredits: accountCreditsSnapshotSchema.optional()
|
|
15156
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
15157
|
+
freshness: external_exports.enum(["live", "cached"]),
|
|
15158
|
+
observedAt: external_exports.string().datetime().nullable()
|
|
15139
15159
|
}).strict();
|
|
15140
15160
|
|
|
15141
15161
|
// ../../shared-contracts/dist/harness-session-import.js
|
|
@@ -18660,7 +18680,8 @@ function synthesizeFileChange(kind, args, cwd) {
|
|
|
18660
18680
|
{
|
|
18661
18681
|
path: displayed.path,
|
|
18662
18682
|
kind: "add",
|
|
18663
|
-
unifiedDiff: createTwoFilesPatch(oldHeader2, newHeader2, "", content, "", "", { context: 3 })
|
|
18683
|
+
unifiedDiff: createTwoFilesPatch(oldHeader2, newHeader2, "", content, "", "", { context: 3 }),
|
|
18684
|
+
diffScope: "fragment"
|
|
18664
18685
|
}
|
|
18665
18686
|
];
|
|
18666
18687
|
}
|
|
@@ -18682,7 +18703,8 @@ function synthesizeFileChange(kind, args, cwd) {
|
|
|
18682
18703
|
kind: "update",
|
|
18683
18704
|
unifiedDiff: createTwoFilesPatch(oldHeader, newHeader, oldText, newText, "", "", {
|
|
18684
18705
|
context: 3
|
|
18685
|
-
})
|
|
18706
|
+
}),
|
|
18707
|
+
diffScope: "fragment"
|
|
18686
18708
|
}
|
|
18687
18709
|
];
|
|
18688
18710
|
}
|
|
@@ -18979,7 +19001,7 @@ var PiHarnessSession = class {
|
|
|
18979
19001
|
}
|
|
18980
19002
|
}
|
|
18981
19003
|
async #selectModel(command) {
|
|
18982
|
-
if (this.#acceptingTurn || this.#
|
|
19004
|
+
if (this.#acceptingTurn || this.#configuring) {
|
|
18983
19005
|
return {
|
|
18984
19006
|
ok: false,
|
|
18985
19007
|
error: {
|
|
@@ -19048,7 +19070,7 @@ var PiHarnessSession = class {
|
|
|
19048
19070
|
}
|
|
19049
19071
|
};
|
|
19050
19072
|
}
|
|
19051
|
-
if (this.#acceptingTurn || this.#
|
|
19073
|
+
if (this.#acceptingTurn || this.#configuring) {
|
|
19052
19074
|
return {
|
|
19053
19075
|
ok: false,
|
|
19054
19076
|
error: {
|
|
@@ -19718,12 +19740,17 @@ var PiHarnessSession = class {
|
|
|
19718
19740
|
try {
|
|
19719
19741
|
const kind = fileMutatingKind(event.toolName);
|
|
19720
19742
|
const args = tool.item.type === "toolExecution" ? tool.item.arguments : {};
|
|
19721
|
-
if (kind && synthesizeFileChange(kind, args, this.#cwd)) {
|
|
19743
|
+
if (kind && !patchFromResult(event.result) && synthesizeFileChange(kind, args, this.#cwd)) {
|
|
19722
19744
|
return;
|
|
19723
19745
|
}
|
|
19724
19746
|
const changes = reliableFileChange(event.toolName, args, event.result, this.#cwd);
|
|
19725
19747
|
if (changes) {
|
|
19726
|
-
const fileItem = {
|
|
19748
|
+
const fileItem = {
|
|
19749
|
+
type: "fileChange",
|
|
19750
|
+
itemId: this.#newItemId(),
|
|
19751
|
+
sourceItemIds: [tool.item.itemId],
|
|
19752
|
+
changes
|
|
19753
|
+
};
|
|
19727
19754
|
this.#event({ type: "item.started", turnId: active.command.turnId, item: fileItem });
|
|
19728
19755
|
this.#completeItem(active, fileItem, { status: "succeeded" });
|
|
19729
19756
|
}
|