@liberseek/boft-cli-win32-arm64 0.6.9 → 0.7.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 -4
- package/app/codexhost-distribution.json +1 -1
- package/app/desktop-controller.mjs +287 -170
- package/app/host-runtime.mjs +2450 -1044
- package/app/plugins/antigravity/plugin.mjs +167 -16
- package/app/plugins/claude-code/plugin.mjs +311 -58
- package/app/plugins/codebuddy/plugin.mjs +2355 -894
- package/app/plugins/cursor-cli/plugin.mjs +35973 -10933
- package/app/plugins/deepseek-harness/plugin.mjs +125 -7
- package/app/plugins/enabled.json +4 -1
- package/app/plugins/grok/plugin.mjs +261 -97
- package/app/plugins/hermes/plugin.mjs +2486 -99
- package/app/plugins/kiro-cli/plugin.mjs +120 -3
- package/app/plugins/muse/plugin.mjs +110 -0
- package/app/plugins/omp/plugin.mjs +145 -10
- package/app/plugins/opencode/plugin.mjs +162 -46
- package/app/plugins/pi/plugin.mjs +2891 -1678
- package/app/plugins/qoder/assets/icon.svg +1 -0
- package/app/plugins/qoder/manifest.json +12 -0
- package/app/plugins/qoder/plugin.mjs +52352 -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 +52350 -0
- package/app/plugins/workbuddy/assets/icon.svg +29 -0
- package/app/plugins/workbuddy/manifest.json +14 -0
- package/app/plugins/workbuddy/plugin.mjs +25007 -0
- package/app/renderer-extension.js +6043 -1442
- 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 → tailwindcss-LICENSE.txt} +1 -1
- 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
|
}
|
|
@@ -14524,9 +14524,104 @@ function date4(params) {
|
|
|
14524
14524
|
// ../../../node_modules/zod/v4/classic/external.js
|
|
14525
14525
|
config(en_default());
|
|
14526
14526
|
|
|
14527
|
+
// ../../shared-contracts/dist/credential-imports.js
|
|
14528
|
+
var credentialSourceSchema = external_exports.object({
|
|
14529
|
+
id: external_exports.string().min(1).max(256),
|
|
14530
|
+
harnessId: external_exports.string().min(1),
|
|
14531
|
+
label: external_exports.string().min(1).max(512),
|
|
14532
|
+
provider: external_exports.enum(["openai-codex", "xai"])
|
|
14533
|
+
}).strict();
|
|
14534
|
+
var credentialImportNameSchema = external_exports.string().regex(/^[a-z][a-z0-9-]{0,47}$/);
|
|
14535
|
+
var credentialImportRecordSchema = external_exports.object({
|
|
14536
|
+
name: credentialImportNameSchema,
|
|
14537
|
+
source: credentialSourceSchema,
|
|
14538
|
+
importedAt: external_exports.string()
|
|
14539
|
+
}).strict();
|
|
14540
|
+
var credentialImportsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
14541
|
+
external_exports.object({ action: external_exports.literal("list") }).strict(),
|
|
14542
|
+
external_exports.object({
|
|
14543
|
+
action: external_exports.literal("import"),
|
|
14544
|
+
sourceId: external_exports.string().min(1).max(256),
|
|
14545
|
+
name: credentialImportNameSchema,
|
|
14546
|
+
confirmed: external_exports.literal(true)
|
|
14547
|
+
}).strict(),
|
|
14548
|
+
external_exports.object({
|
|
14549
|
+
action: external_exports.literal("reimport"),
|
|
14550
|
+
sourceId: external_exports.string().min(1).max(256),
|
|
14551
|
+
name: credentialImportNameSchema,
|
|
14552
|
+
confirmed: external_exports.literal(true)
|
|
14553
|
+
}).strict(),
|
|
14554
|
+
external_exports.object({
|
|
14555
|
+
action: external_exports.literal("remove"),
|
|
14556
|
+
name: credentialImportNameSchema,
|
|
14557
|
+
confirmed: external_exports.literal(true)
|
|
14558
|
+
}).strict()
|
|
14559
|
+
]);
|
|
14560
|
+
var credentialOtherLoginSchema = external_exports.object({
|
|
14561
|
+
provider: external_exports.string().min(1).max(128),
|
|
14562
|
+
type: external_exports.enum(["oauth", "api_key", "unknown"]),
|
|
14563
|
+
/** Best-effort account label (e.g. the email in a Codex token), derived locally when present. */
|
|
14564
|
+
label: external_exports.string().min(1).max(512).optional(),
|
|
14565
|
+
/** Recognized credential vendor, derived from the OAuth token issuer. Absent when unknown. */
|
|
14566
|
+
vendor: external_exports.enum(["openai-codex", "xai"]).optional()
|
|
14567
|
+
}).strict();
|
|
14568
|
+
var credentialImportsResultSchema = external_exports.object({
|
|
14569
|
+
sources: external_exports.array(credentialSourceSchema),
|
|
14570
|
+
targets: external_exports.array(external_exports.object({
|
|
14571
|
+
harnessId: external_exports.string(),
|
|
14572
|
+
providers: external_exports.array(external_exports.enum(["openai-codex", "xai"])),
|
|
14573
|
+
imports: external_exports.array(credentialImportRecordSchema),
|
|
14574
|
+
others: external_exports.array(credentialOtherLoginSchema).default([])
|
|
14575
|
+
}).strict())
|
|
14576
|
+
}).strict();
|
|
14577
|
+
var credentialImportsParamsSchema = external_exports.object({
|
|
14578
|
+
targetHarnessId: external_exports.string().min(1).max(128).optional(),
|
|
14579
|
+
request: credentialImportsRequestSchema
|
|
14580
|
+
}).strict();
|
|
14581
|
+
|
|
14527
14582
|
// ../../shared-contracts/dist/version.js
|
|
14528
14583
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
14529
14584
|
|
|
14585
|
+
// ../../shared-contracts/dist/idle-release.js
|
|
14586
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
14587
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
14588
|
+
var idleReleaseSettingsSchema = external_exports.strictObject({
|
|
14589
|
+
enabled: external_exports.boolean(),
|
|
14590
|
+
timeoutMinutes: external_exports.number().int().min(IDLE_RELEASE_TIMEOUT_MINUTES_MIN).max(IDLE_RELEASE_TIMEOUT_MINUTES_MAX)
|
|
14591
|
+
});
|
|
14592
|
+
var DEFAULT_IDLE_RELEASE_SETTINGS = Object.freeze({
|
|
14593
|
+
enabled: false,
|
|
14594
|
+
timeoutMinutes: 30
|
|
14595
|
+
});
|
|
14596
|
+
|
|
14597
|
+
// ../../shared-contracts/dist/loaded-sessions.js
|
|
14598
|
+
var loadedSessionStateSchema = external_exports.enum([
|
|
14599
|
+
"idle",
|
|
14600
|
+
"running",
|
|
14601
|
+
"busy",
|
|
14602
|
+
"closing",
|
|
14603
|
+
"failed",
|
|
14604
|
+
"blocked"
|
|
14605
|
+
]);
|
|
14606
|
+
var loadedSessionReasonSchema = external_exports.enum([
|
|
14607
|
+
"none",
|
|
14608
|
+
"disabled",
|
|
14609
|
+
"timeout",
|
|
14610
|
+
"operation",
|
|
14611
|
+
"background",
|
|
14612
|
+
"identity",
|
|
14613
|
+
"persistence",
|
|
14614
|
+
"closeFailed"
|
|
14615
|
+
]);
|
|
14616
|
+
var loadedSessionsSchema = external_exports.array(external_exports.strictObject({
|
|
14617
|
+
threadId: external_exports.string(),
|
|
14618
|
+
title: external_exports.string(),
|
|
14619
|
+
harnessId: external_exports.string(),
|
|
14620
|
+
state: loadedSessionStateSchema,
|
|
14621
|
+
reason: loadedSessionReasonSchema,
|
|
14622
|
+
inactiveMs: external_exports.number().nonnegative()
|
|
14623
|
+
}));
|
|
14624
|
+
|
|
14530
14625
|
// ../../shared-contracts/dist/ids.js
|
|
14531
14626
|
var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
14532
14627
|
message: "Identifier must not be empty or whitespace"
|
|
@@ -15033,6 +15128,8 @@ var pluginPresentationShape = {
|
|
|
15033
15128
|
id: harnessPluginIdSchema,
|
|
15034
15129
|
name: external_exports.string().trim().min(1).max(128),
|
|
15035
15130
|
version: external_exports.string().min(1).max(128),
|
|
15131
|
+
/** The factory accepts a persisted local entrypoint through its construction context. */
|
|
15132
|
+
launchCommand: external_exports.literal(true).optional(),
|
|
15036
15133
|
links: external_exports.object({
|
|
15037
15134
|
documentation: documentationUrlSchema.optional(),
|
|
15038
15135
|
installation: documentationUrlSchema.optional()
|
|
@@ -15070,6 +15167,19 @@ var harnessPluginRouteSchema = external_exports.object({
|
|
|
15070
15167
|
permissionModeId: harnessPermissionModeIdSchema.optional()
|
|
15071
15168
|
}).strict();
|
|
15072
15169
|
|
|
15170
|
+
// ../../shared-contracts/dist/harness-launch-settings.js
|
|
15171
|
+
var harnessLaunchPathSchema = external_exports.string().trim().min(1).max(4096).refine((value) => !/[\u0000\r\n]/u.test(value), "Invalid entrypoint path");
|
|
15172
|
+
var harnessLaunchSettingsGetSchema = external_exports.object({
|
|
15173
|
+
harnessId: harnessPluginIdSchema
|
|
15174
|
+
}).strict();
|
|
15175
|
+
var harnessLaunchSettingsSetSchema = harnessLaunchSettingsGetSchema.extend({
|
|
15176
|
+
path: harnessLaunchPathSchema.nullable()
|
|
15177
|
+
});
|
|
15178
|
+
var harnessLaunchSettingsSchema = external_exports.object({
|
|
15179
|
+
path: harnessLaunchPathSchema.nullable(),
|
|
15180
|
+
restartRequired: external_exports.boolean()
|
|
15181
|
+
}).strict();
|
|
15182
|
+
|
|
15073
15183
|
// ../../shared-contracts/dist/codex-accounts.js
|
|
15074
15184
|
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
15075
15185
|
var nonBlankTextSchema3 = external_exports.string().trim().min(1);
|
|
@@ -15861,6 +15971,7 @@ function projectOpenCodeHistory(input) {
|
|
|
15861
15971
|
const item = {
|
|
15862
15972
|
type: "fileChange",
|
|
15863
15973
|
itemId: itemId(`opencode-diff:${userEntry.info.id}`),
|
|
15974
|
+
sourceItemIds: items.map(({ item: item2 }) => item2.itemId),
|
|
15864
15975
|
changes
|
|
15865
15976
|
};
|
|
15866
15977
|
items.push({ item, outcome: { status: "succeeded" } });
|
|
@@ -15982,6 +16093,7 @@ import { randomBytes } from "node:crypto";
|
|
|
15982
16093
|
import { spawn, spawnSync } from "node:child_process";
|
|
15983
16094
|
import fs2 from "node:fs";
|
|
15984
16095
|
import { homedir, tmpdir } from "node:os";
|
|
16096
|
+
import path4 from "node:path";
|
|
15985
16097
|
|
|
15986
16098
|
// ../../../node_modules/@opencode-ai/sdk/dist/v2/gen/core/serverSentEvents.gen.js
|
|
15987
16099
|
var createSseClient = ({ onRequest, onSseError, onSseEvent, responseTransformer, responseValidator, sseDefaultRetryDelay, sseMaxRetryAttempts, sseMaxRetryDelay, sseSleepFn, url: url2, ...options }) => {
|
|
@@ -16207,7 +16319,7 @@ var serializeObjectParam = ({ allowReserved, explode, name, style, value, valueO
|
|
|
16207
16319
|
|
|
16208
16320
|
// ../../../node_modules/@opencode-ai/sdk/dist/v2/gen/core/utils.gen.js
|
|
16209
16321
|
var PATH_PARAM_RE = /\{[^{}]+\}/g;
|
|
16210
|
-
var defaultPathSerializer = ({ path:
|
|
16322
|
+
var defaultPathSerializer = ({ path: path7, url: _url2 }) => {
|
|
16211
16323
|
let url2 = _url2;
|
|
16212
16324
|
const matches = _url2.match(PATH_PARAM_RE);
|
|
16213
16325
|
if (matches) {
|
|
@@ -16226,7 +16338,7 @@ var defaultPathSerializer = ({ path: path6, url: _url2 }) => {
|
|
|
16226
16338
|
name = name.substring(1);
|
|
16227
16339
|
style = "matrix";
|
|
16228
16340
|
}
|
|
16229
|
-
const value =
|
|
16341
|
+
const value = path7[name];
|
|
16230
16342
|
if (value === void 0 || value === null) {
|
|
16231
16343
|
continue;
|
|
16232
16344
|
}
|
|
@@ -16257,11 +16369,11 @@ var defaultPathSerializer = ({ path: path6, url: _url2 }) => {
|
|
|
16257
16369
|
}
|
|
16258
16370
|
return url2;
|
|
16259
16371
|
};
|
|
16260
|
-
var getUrl = ({ baseUrl, path:
|
|
16372
|
+
var getUrl = ({ baseUrl, path: path7, query, querySerializer, url: _url2 }) => {
|
|
16261
16373
|
const pathUrl = _url2.startsWith("/") ? _url2 : `/${_url2}`;
|
|
16262
16374
|
let url2 = (baseUrl ?? "") + pathUrl;
|
|
16263
|
-
if (
|
|
16264
|
-
url2 = defaultPathSerializer({ path:
|
|
16375
|
+
if (path7) {
|
|
16376
|
+
url2 = defaultPathSerializer({ path: path7, url: url2 });
|
|
16265
16377
|
}
|
|
16266
16378
|
let search = query ? querySerializer(query) : "";
|
|
16267
16379
|
if (search.startsWith("?")) {
|
|
@@ -21724,7 +21836,7 @@ function signalProcessTree(child, signal) {
|
|
|
21724
21836
|
function safeOpenCodeServerCwd(environment) {
|
|
21725
21837
|
const candidates = [environment.USERPROFILE, environment.HOME, homedir(), tmpdir()];
|
|
21726
21838
|
for (const candidate of candidates) {
|
|
21727
|
-
if (!candidate)
|
|
21839
|
+
if (!candidate || !path4.isAbsolute(candidate))
|
|
21728
21840
|
continue;
|
|
21729
21841
|
try {
|
|
21730
21842
|
if (!fs2.statSync(candidate).isDirectory())
|
|
@@ -21833,7 +21945,10 @@ var OpenCodeServerConnection = class {
|
|
|
21833
21945
|
OPENCODE_SERVER_PASSWORD: password
|
|
21834
21946
|
};
|
|
21835
21947
|
const invocation = openCodeServerInvocation(executable, environment);
|
|
21836
|
-
const serverCwd = safeOpenCodeServerCwd(environment);
|
|
21948
|
+
const serverCwd = (this.#dependencies.resolveServerCwd ?? safeOpenCodeServerCwd)(environment);
|
|
21949
|
+
if (!serverCwd) {
|
|
21950
|
+
throw new OpenCodeTransportError("unavailable", "OpenCode Server requires a writable startup directory");
|
|
21951
|
+
}
|
|
21837
21952
|
let child;
|
|
21838
21953
|
try {
|
|
21839
21954
|
child = this.#dependencies.spawn(invocation.command, invocation.arguments, {
|
|
@@ -21842,7 +21957,7 @@ var OpenCodeServerConnection = class {
|
|
|
21842
21957
|
detached: process.platform !== "win32",
|
|
21843
21958
|
windowsHide: true,
|
|
21844
21959
|
windowsVerbatimArguments: invocation.windowsVerbatimArguments,
|
|
21845
|
-
|
|
21960
|
+
cwd: serverCwd
|
|
21846
21961
|
});
|
|
21847
21962
|
} catch (error51) {
|
|
21848
21963
|
throw new OpenCodeTransportError(isMissingExecutable(error51) ? "notInstalled" : "unavailable", isMissingExecutable(error51) ? "OpenCode CLI is not installed" : "OpenCode Server failed to start", { cause: error51 });
|
|
@@ -22154,7 +22269,7 @@ var SdkOpenCodeTransport = class {
|
|
|
22154
22269
|
|
|
22155
22270
|
// dist/file-change-verification.js
|
|
22156
22271
|
import fs3 from "node:fs";
|
|
22157
|
-
import
|
|
22272
|
+
import path5 from "node:path";
|
|
22158
22273
|
function missingPath(error51) {
|
|
22159
22274
|
if (!error51 || typeof error51 !== "object")
|
|
22160
22275
|
return false;
|
|
@@ -22166,33 +22281,33 @@ function hasDotPathSegment(value) {
|
|
|
22166
22281
|
return segments.some((segment) => segment === "." || segment === "..");
|
|
22167
22282
|
}
|
|
22168
22283
|
function canonicalDirectoryPath(value) {
|
|
22169
|
-
let candidate =
|
|
22284
|
+
let candidate = path5.resolve(value);
|
|
22170
22285
|
const missingSegments = [];
|
|
22171
22286
|
for (; ; ) {
|
|
22172
22287
|
try {
|
|
22173
|
-
return
|
|
22288
|
+
return path5.join(fs3.realpathSync.native(candidate), ...missingSegments);
|
|
22174
22289
|
} catch (error51) {
|
|
22175
22290
|
if (!missingPath(error51))
|
|
22176
22291
|
return void 0;
|
|
22177
|
-
const parent =
|
|
22292
|
+
const parent = path5.dirname(candidate);
|
|
22178
22293
|
if (parent === candidate)
|
|
22179
22294
|
return void 0;
|
|
22180
|
-
missingSegments.unshift(
|
|
22295
|
+
missingSegments.unshift(path5.basename(candidate));
|
|
22181
22296
|
candidate = parent;
|
|
22182
22297
|
}
|
|
22183
22298
|
}
|
|
22184
22299
|
}
|
|
22185
22300
|
function canonicalFilePath(value) {
|
|
22186
|
-
const absolute =
|
|
22187
|
-
const parent = canonicalDirectoryPath(
|
|
22188
|
-
return parent ?
|
|
22301
|
+
const absolute = path5.resolve(value);
|
|
22302
|
+
const parent = canonicalDirectoryPath(path5.dirname(absolute));
|
|
22303
|
+
return parent ? path5.join(parent, path5.basename(absolute)) : void 0;
|
|
22189
22304
|
}
|
|
22190
22305
|
function pathIsWithin(root, candidate, allowRoot) {
|
|
22191
|
-
const relative =
|
|
22192
|
-
return allowRoot && relative === "" || relative !== "" && relative !== ".." && !relative.startsWith(`..${
|
|
22306
|
+
const relative = path5.relative(root, candidate);
|
|
22307
|
+
return allowRoot && relative === "" || relative !== "" && relative !== ".." && !relative.startsWith(`..${path5.sep}`) && !path5.isAbsolute(relative);
|
|
22193
22308
|
}
|
|
22194
22309
|
function verifiedOpenCodeWorktree(sessionDirectory, paths) {
|
|
22195
|
-
if (!paths || typeof paths !== "object" || typeof sessionDirectory !== "string" || typeof paths.directory !== "string" || typeof paths.worktree !== "string" || hasDotPathSegment(sessionDirectory) || hasDotPathSegment(paths.directory) || hasDotPathSegment(paths.worktree) || !
|
|
22310
|
+
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)) {
|
|
22196
22311
|
return void 0;
|
|
22197
22312
|
}
|
|
22198
22313
|
const session = canonicalDirectoryPath(sessionDirectory);
|
|
@@ -22204,10 +22319,10 @@ function verifiedOpenCodeWorktree(sessionDirectory, paths) {
|
|
|
22204
22319
|
return worktree;
|
|
22205
22320
|
}
|
|
22206
22321
|
function openCodeFileIdentity(file2, worktree) {
|
|
22207
|
-
if (typeof file2 !== "string" || typeof worktree !== "string" || hasDotPathSegment(file2) || hasDotPathSegment(worktree) || !
|
|
22322
|
+
if (typeof file2 !== "string" || typeof worktree !== "string" || hasDotPathSegment(file2) || hasDotPathSegment(worktree) || !path5.isAbsolute(worktree) || !file2 || file2.includes("\0") || file2.includes("\n") || file2.includes("\r")) {
|
|
22208
22323
|
return void 0;
|
|
22209
22324
|
}
|
|
22210
|
-
const candidate = canonicalFilePath(
|
|
22325
|
+
const candidate = canonicalFilePath(path5.isAbsolute(file2) ? file2 : path5.resolve(worktree, file2));
|
|
22211
22326
|
return candidate && pathIsWithin(worktree, candidate, false) ? candidate : void 0;
|
|
22212
22327
|
}
|
|
22213
22328
|
|
|
@@ -22496,7 +22611,7 @@ function sameCwd(left, right) {
|
|
|
22496
22611
|
try {
|
|
22497
22612
|
return fs4.realpathSync.native(value);
|
|
22498
22613
|
} catch {
|
|
22499
|
-
return
|
|
22614
|
+
return path6.resolve(value);
|
|
22500
22615
|
}
|
|
22501
22616
|
};
|
|
22502
22617
|
return canonical(left) === canonical(right);
|
|
@@ -22854,7 +22969,7 @@ var OpenCodeHarnessSession = class {
|
|
|
22854
22969
|
}
|
|
22855
22970
|
}
|
|
22856
22971
|
async #selectModel(command) {
|
|
22857
|
-
if (this.#
|
|
22972
|
+
if (this.#configuring) {
|
|
22858
22973
|
return {
|
|
22859
22974
|
ok: false,
|
|
22860
22975
|
error: {
|
|
@@ -22898,7 +23013,7 @@ var OpenCodeHarnessSession = class {
|
|
|
22898
23013
|
if (!this.capabilities.configuration.selectThinkingOption) {
|
|
22899
23014
|
return { ok: false, error: unsupported("OpenCode Model variants are unavailable") };
|
|
22900
23015
|
}
|
|
22901
|
-
if (this.#
|
|
23016
|
+
if (this.#configuring) {
|
|
22902
23017
|
return {
|
|
22903
23018
|
ok: false,
|
|
22904
23019
|
error: {
|
|
@@ -23353,6 +23468,7 @@ var OpenCodeHarnessSession = class {
|
|
|
23353
23468
|
const item = {
|
|
23354
23469
|
type: "fileChange",
|
|
23355
23470
|
itemId: hostItemIdSchema.parse(id),
|
|
23471
|
+
sourceItemIds: [...active.items.values()].map(({ item: item2 }) => item2.itemId),
|
|
23356
23472
|
changes
|
|
23357
23473
|
};
|
|
23358
23474
|
active.items.set(id, { item, completed: false });
|