@liberseek/boft-cli-linux-x64 0.7.8 → 0.7.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +16583 -16433
- package/app/console-web.js +3524 -1714
- package/app/desktop-controller.mjs +16241 -350
- package/app/host-runtime.mjs +4343 -954
- package/app/plugins/antigravity/plugin.mjs +81 -0
- package/app/plugins/claude-code/plugin.mjs +393 -100
- package/app/plugins/codebuddy/plugin.mjs +727 -134
- package/app/plugins/cursor-cli/plugin.mjs +431 -120
- package/app/plugins/deepseek-harness/plugin.mjs +81 -0
- package/app/plugins/enabled.json +2 -1
- package/app/plugins/grok/plugin.mjs +459 -56
- package/app/plugins/hermes/plugin.mjs +3301 -7739
- package/app/plugins/kimi-code/plugin.mjs +367 -40
- package/app/plugins/kiro-cli/plugin.mjs +374 -35
- package/app/plugins/muse/plugin.mjs +81 -0
- package/app/plugins/omp/plugin.mjs +505 -97
- package/app/plugins/opencode/plugin.mjs +324 -76
- package/app/plugins/pi/plugin.mjs +195 -55
- package/app/plugins/qoder/plugin.mjs +281 -35
- package/app/plugins/qoder-cn/plugin.mjs +281 -35
- package/app/plugins/workbuddy/plugin.mjs +699 -96
- package/app/plugins/zcode/assets/icon.svg +8 -0
- package/app/plugins/zcode/manifest.json +14 -0
- package/app/plugins/zcode/plugin.mjs +19304 -0
- package/app/renderer-extension.js +2514 -526
- package/bin/boft +0 -0
- package/libexec/boft-shim +0 -0
- package/libexec/boft-updater +0 -0
- package/package.json +1 -1
|
@@ -3229,8 +3229,8 @@ var require_utils = __commonJS({
|
|
|
3229
3229
|
}
|
|
3230
3230
|
return ind;
|
|
3231
3231
|
}
|
|
3232
|
-
function removeDotSegments(
|
|
3233
|
-
let input =
|
|
3232
|
+
function removeDotSegments(path7) {
|
|
3233
|
+
let input = path7;
|
|
3234
3234
|
const output = [];
|
|
3235
3235
|
let nextSlash = -1;
|
|
3236
3236
|
let len = 0;
|
|
@@ -3482,8 +3482,8 @@ var require_schemes = __commonJS({
|
|
|
3482
3482
|
wsComponent.secure = void 0;
|
|
3483
3483
|
}
|
|
3484
3484
|
if (wsComponent.resourceName) {
|
|
3485
|
-
const [
|
|
3486
|
-
wsComponent.path =
|
|
3485
|
+
const [path7, query] = wsComponent.resourceName.split("?");
|
|
3486
|
+
wsComponent.path = path7 && path7 !== "/" ? path7 : void 0;
|
|
3487
3487
|
wsComponent.query = query;
|
|
3488
3488
|
wsComponent.resourceName = void 0;
|
|
3489
3489
|
}
|
|
@@ -12592,7 +12592,7 @@ var require_dist = __commonJS({
|
|
|
12592
12592
|
|
|
12593
12593
|
// ../qoder/dist/qoder-adapter.js
|
|
12594
12594
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
12595
|
-
import
|
|
12595
|
+
import path6 from "node:path";
|
|
12596
12596
|
|
|
12597
12597
|
// ../../../node_modules/zod/v4/classic/external.js
|
|
12598
12598
|
var external_exports = {};
|
|
@@ -13360,10 +13360,10 @@ function mergeDefs(...defs) {
|
|
|
13360
13360
|
function cloneDef(schema) {
|
|
13361
13361
|
return mergeDefs(schema._zod.def);
|
|
13362
13362
|
}
|
|
13363
|
-
function getElementAtPath(obj,
|
|
13364
|
-
if (!
|
|
13363
|
+
function getElementAtPath(obj, path7) {
|
|
13364
|
+
if (!path7)
|
|
13365
13365
|
return obj;
|
|
13366
|
-
return
|
|
13366
|
+
return path7.reduce((acc, key) => acc?.[key], obj);
|
|
13367
13367
|
}
|
|
13368
13368
|
function promiseAllObject(promisesObj) {
|
|
13369
13369
|
const keys = Object.keys(promisesObj);
|
|
@@ -13772,11 +13772,11 @@ function explicitlyAborted(x3, startIndex = 0) {
|
|
|
13772
13772
|
}
|
|
13773
13773
|
return false;
|
|
13774
13774
|
}
|
|
13775
|
-
function prefixIssues(
|
|
13775
|
+
function prefixIssues(path7, issues) {
|
|
13776
13776
|
return issues.map((iss) => {
|
|
13777
13777
|
var _a5;
|
|
13778
13778
|
(_a5 = iss).path ?? (_a5.path = []);
|
|
13779
|
-
iss.path.unshift(
|
|
13779
|
+
iss.path.unshift(path7);
|
|
13780
13780
|
return iss;
|
|
13781
13781
|
});
|
|
13782
13782
|
}
|
|
@@ -13923,16 +13923,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
13923
13923
|
}
|
|
13924
13924
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
13925
13925
|
const fieldErrors = { _errors: [] };
|
|
13926
|
-
const processError = (error52,
|
|
13926
|
+
const processError = (error52, path7 = []) => {
|
|
13927
13927
|
for (const issue2 of error52.issues) {
|
|
13928
13928
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
13929
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
13929
|
+
issue2.errors.map((issues) => processError({ issues }, [...path7, ...issue2.path]));
|
|
13930
13930
|
} else if (issue2.code === "invalid_key") {
|
|
13931
|
-
processError({ issues: issue2.issues }, [...
|
|
13931
|
+
processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
|
|
13932
13932
|
} else if (issue2.code === "invalid_element") {
|
|
13933
|
-
processError({ issues: issue2.issues }, [...
|
|
13933
|
+
processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
|
|
13934
13934
|
} else {
|
|
13935
|
-
const fullpath = [...
|
|
13935
|
+
const fullpath = [...path7, ...issue2.path];
|
|
13936
13936
|
if (fullpath.length === 0) {
|
|
13937
13937
|
fieldErrors._errors.push(mapper(issue2));
|
|
13938
13938
|
} else {
|
|
@@ -13959,17 +13959,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
13959
13959
|
}
|
|
13960
13960
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
13961
13961
|
const result = { errors: [] };
|
|
13962
|
-
const processError = (error52,
|
|
13962
|
+
const processError = (error52, path7 = []) => {
|
|
13963
13963
|
var _a5, _b;
|
|
13964
13964
|
for (const issue2 of error52.issues) {
|
|
13965
13965
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
13966
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
13966
|
+
issue2.errors.map((issues) => processError({ issues }, [...path7, ...issue2.path]));
|
|
13967
13967
|
} else if (issue2.code === "invalid_key") {
|
|
13968
|
-
processError({ issues: issue2.issues }, [...
|
|
13968
|
+
processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
|
|
13969
13969
|
} else if (issue2.code === "invalid_element") {
|
|
13970
|
-
processError({ issues: issue2.issues }, [...
|
|
13970
|
+
processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
|
|
13971
13971
|
} else {
|
|
13972
|
-
const fullpath = [...
|
|
13972
|
+
const fullpath = [...path7, ...issue2.path];
|
|
13973
13973
|
if (fullpath.length === 0) {
|
|
13974
13974
|
result.errors.push(mapper(issue2));
|
|
13975
13975
|
continue;
|
|
@@ -14001,8 +14001,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
14001
14001
|
}
|
|
14002
14002
|
function toDotPath(_path) {
|
|
14003
14003
|
const segs = [];
|
|
14004
|
-
const
|
|
14005
|
-
for (const seg of
|
|
14004
|
+
const path7 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
14005
|
+
for (const seg of path7) {
|
|
14006
14006
|
if (typeof seg === "number")
|
|
14007
14007
|
segs.push(`[${seg}]`);
|
|
14008
14008
|
else if (typeof seg === "symbol")
|
|
@@ -26694,13 +26694,13 @@ function resolveRef(ref, ctx) {
|
|
|
26694
26694
|
if (!ref.startsWith("#")) {
|
|
26695
26695
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
26696
26696
|
}
|
|
26697
|
-
const
|
|
26698
|
-
if (
|
|
26697
|
+
const path7 = ref.slice(1).split("/").filter(Boolean);
|
|
26698
|
+
if (path7.length === 0) {
|
|
26699
26699
|
return ctx.rootSchema;
|
|
26700
26700
|
}
|
|
26701
26701
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
26702
|
-
if (
|
|
26703
|
-
const key =
|
|
26702
|
+
if (path7[0] === defsKey) {
|
|
26703
|
+
const key = path7[1];
|
|
26704
26704
|
if (!key || !ctx.defs[key]) {
|
|
26705
26705
|
throw new Error(`Reference not found: ${ref}`);
|
|
26706
26706
|
}
|
|
@@ -27188,6 +27188,10 @@ var hostTurnIdSchema = opaqueIdSchema.brand();
|
|
|
27188
27188
|
var hostItemIdSchema = opaqueIdSchema.brand();
|
|
27189
27189
|
var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
27190
27190
|
|
|
27191
|
+
// ../../shared-contracts/dist/thread-prewarm.js
|
|
27192
|
+
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
27193
|
+
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
27194
|
+
|
|
27191
27195
|
// ../../shared-contracts/dist/harness-plugins.js
|
|
27192
27196
|
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
27193
27197
|
var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
|
|
@@ -27255,6 +27259,9 @@ var consoleOpenResultSchema = external_exports.strictObject({
|
|
|
27255
27259
|
url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
|
|
27256
27260
|
});
|
|
27257
27261
|
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
27262
|
+
"codexhost/console/remote-connections",
|
|
27263
|
+
"codexhost/runtime/status",
|
|
27264
|
+
"codexhost/remote/ssh-setup",
|
|
27258
27265
|
"codexhost/harness/plugins/list",
|
|
27259
27266
|
"codexhost/harness/display-settings/get",
|
|
27260
27267
|
"codexhost/harness/display-settings/set",
|
|
@@ -28200,6 +28207,80 @@ var updateStatusResultSchema = external_exports.strictObject({
|
|
|
28200
28207
|
status: updateStatusSchema.nullable()
|
|
28201
28208
|
});
|
|
28202
28209
|
|
|
28210
|
+
// ../../shared-contracts/dist/remote-runtime.js
|
|
28211
|
+
var remoteUpdatePhaseSchema = external_exports.enum([
|
|
28212
|
+
"idle",
|
|
28213
|
+
"installing",
|
|
28214
|
+
"restarting",
|
|
28215
|
+
"succeeded",
|
|
28216
|
+
"failed"
|
|
28217
|
+
]);
|
|
28218
|
+
var runtimeStatusSchema = external_exports.object({
|
|
28219
|
+
runningVersion: external_exports.string().nullable(),
|
|
28220
|
+
installedVersion: external_exports.string().nullable(),
|
|
28221
|
+
restartRequired: external_exports.boolean(),
|
|
28222
|
+
remote: external_exports.boolean(),
|
|
28223
|
+
updateSupported: external_exports.boolean(),
|
|
28224
|
+
update: external_exports.object({
|
|
28225
|
+
phase: remoteUpdatePhaseSchema,
|
|
28226
|
+
targetVersion: external_exports.string().nullable(),
|
|
28227
|
+
error: external_exports.string().nullable()
|
|
28228
|
+
})
|
|
28229
|
+
});
|
|
28230
|
+
var remoteUpdateParamsSchema = external_exports.object({
|
|
28231
|
+
version: external_exports.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u)
|
|
28232
|
+
}).strict();
|
|
28233
|
+
var remoteSshSetupParamsSchema = external_exports.object({
|
|
28234
|
+
hostname: external_exports.string().min(1).max(1024).refine((value) => !value.startsWith("-") && !/\s/u.test(value)),
|
|
28235
|
+
port: external_exports.number().int().min(1).max(65535).nullable(),
|
|
28236
|
+
identity: external_exports.string().max(4096).nullable(),
|
|
28237
|
+
action: external_exports.enum(["inspect", "install", "update", "repair", "uninstall"]),
|
|
28238
|
+
uninstallPackage: external_exports.boolean().optional(),
|
|
28239
|
+
version: external_exports.string().regex(/^\d+\.\d+\.\d+$/u).nullable()
|
|
28240
|
+
}).strict();
|
|
28241
|
+
var remoteSshSetupResultSchema = external_exports.object({ state: external_exports.enum(["installed", "not-installed"]) }).strict();
|
|
28242
|
+
|
|
28243
|
+
// ../../shared-contracts/dist/remote-connections.js
|
|
28244
|
+
var hostId = external_exports.string().min(1).max(1024);
|
|
28245
|
+
var codexSshConnectionSchema = external_exports.object({
|
|
28246
|
+
hostId,
|
|
28247
|
+
displayName: external_exports.string().min(1).max(1024),
|
|
28248
|
+
source: external_exports.enum(["codex-managed", "discovered"]),
|
|
28249
|
+
sshAlias: external_exports.string().max(1024).nullable(),
|
|
28250
|
+
sshHost: external_exports.string().min(1).max(1024),
|
|
28251
|
+
sshPort: external_exports.number().int().min(1).max(65535).nullable(),
|
|
28252
|
+
identity: external_exports.string().max(4096).nullable(),
|
|
28253
|
+
autoConnect: external_exports.boolean(),
|
|
28254
|
+
connectionAnalyticsId: external_exports.string().max(1024).optional()
|
|
28255
|
+
});
|
|
28256
|
+
var codexSshDraftSchema = external_exports.strictObject({
|
|
28257
|
+
displayName: external_exports.string().min(1).max(1024),
|
|
28258
|
+
hostname: external_exports.string().min(1).max(1024),
|
|
28259
|
+
sshPort: external_exports.number().int().min(1).max(65535).nullable(),
|
|
28260
|
+
identity: external_exports.string().max(4096).nullable()
|
|
28261
|
+
});
|
|
28262
|
+
var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
28263
|
+
external_exports.strictObject({ action: external_exports.literal("list") }),
|
|
28264
|
+
external_exports.strictObject({
|
|
28265
|
+
action: external_exports.literal("save"),
|
|
28266
|
+
draft: codexSshDraftSchema,
|
|
28267
|
+
previous: codexSshConnectionSchema.nullable()
|
|
28268
|
+
}),
|
|
28269
|
+
external_exports.strictObject({ action: external_exports.literal("remove"), previous: codexSshConnectionSchema }),
|
|
28270
|
+
external_exports.strictObject({ action: external_exports.literal("connect"), hostId, enabled: external_exports.boolean() }),
|
|
28271
|
+
external_exports.strictObject({ action: external_exports.literal("state"), hostId }),
|
|
28272
|
+
external_exports.strictObject({ action: external_exports.literal("runtime"), hostId }),
|
|
28273
|
+
external_exports.strictObject({
|
|
28274
|
+
action: external_exports.literal("update"),
|
|
28275
|
+
hostId: hostId.refine((id) => id !== "local"),
|
|
28276
|
+
version: remoteUpdateParamsSchema.shape.version
|
|
28277
|
+
})
|
|
28278
|
+
]);
|
|
28279
|
+
var remoteConnectionsReplySchema = external_exports.union([
|
|
28280
|
+
external_exports.strictObject({ result: jsonValueSchema }),
|
|
28281
|
+
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
28282
|
+
]);
|
|
28283
|
+
|
|
28203
28284
|
// ../../shared-contracts/dist/index.js
|
|
28204
28285
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
28205
28286
|
|
|
@@ -30242,8 +30323,8 @@ function getErrorMap2() {
|
|
|
30242
30323
|
|
|
30243
30324
|
// ../../../node_modules/zod/v3/helpers/parseUtil.js
|
|
30244
30325
|
var makeIssue = (params) => {
|
|
30245
|
-
const { data, path:
|
|
30246
|
-
const fullPath = [...
|
|
30326
|
+
const { data, path: path7, errorMaps, issueData } = params;
|
|
30327
|
+
const fullPath = [...path7, ...issueData.path || []];
|
|
30247
30328
|
const fullIssue = {
|
|
30248
30329
|
...issueData,
|
|
30249
30330
|
path: fullPath
|
|
@@ -30358,11 +30439,11 @@ var errorUtil;
|
|
|
30358
30439
|
|
|
30359
30440
|
// ../../../node_modules/zod/v3/types.js
|
|
30360
30441
|
var ParseInputLazyPath = class {
|
|
30361
|
-
constructor(parent, value,
|
|
30442
|
+
constructor(parent, value, path7, key) {
|
|
30362
30443
|
this._cachedPath = [];
|
|
30363
30444
|
this.parent = parent;
|
|
30364
30445
|
this.data = value;
|
|
30365
|
-
this._path =
|
|
30446
|
+
this._path = path7;
|
|
30366
30447
|
this._key = key;
|
|
30367
30448
|
}
|
|
30368
30449
|
get path() {
|
|
@@ -33889,11 +33970,11 @@ function normalizeObjectSchema(schema) {
|
|
|
33889
33970
|
}
|
|
33890
33971
|
return void 0;
|
|
33891
33972
|
}
|
|
33892
|
-
function getDotPath(
|
|
33893
|
-
if (
|
|
33973
|
+
function getDotPath(path7) {
|
|
33974
|
+
if (path7.length === 0) {
|
|
33894
33975
|
return "object root";
|
|
33895
33976
|
}
|
|
33896
|
-
return
|
|
33977
|
+
return path7.reduce((acc, seg, index) => {
|
|
33897
33978
|
if (index === 0) {
|
|
33898
33979
|
return String(seg);
|
|
33899
33980
|
}
|
|
@@ -52464,12 +52545,171 @@ var QoderSession = class {
|
|
|
52464
52545
|
}
|
|
52465
52546
|
};
|
|
52466
52547
|
|
|
52548
|
+
// ../qoder/dist/qoder-session-import.js
|
|
52549
|
+
import { stat } from "node:fs/promises";
|
|
52550
|
+
import path5 from "node:path";
|
|
52551
|
+
|
|
52552
|
+
// ../../harness-adapter/dist/session-import.js
|
|
52553
|
+
var STORAGE_ACCESS_ERRORS = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EIO", "EMFILE", "ENFILE"]);
|
|
52554
|
+
function isStorageAccessError(error51) {
|
|
52555
|
+
return typeof error51 === "object" && error51 !== null && "code" in error51 && typeof error51.code === "string" && STORAGE_ACCESS_ERRORS.has(error51.code);
|
|
52556
|
+
}
|
|
52557
|
+
function sessionImportTitle(value, maxLength = HARNESS_SESSION_IMPORT_TITLE_MAX_LENGTH) {
|
|
52558
|
+
if (typeof value !== "string")
|
|
52559
|
+
return null;
|
|
52560
|
+
const normalized = value.replaceAll("\0", "").replaceAll(/\s+/gu, " ").trim();
|
|
52561
|
+
if (!normalized)
|
|
52562
|
+
return null;
|
|
52563
|
+
if (normalized.length <= maxLength)
|
|
52564
|
+
return normalized;
|
|
52565
|
+
const characters = [...normalized];
|
|
52566
|
+
if (characters.length <= maxLength)
|
|
52567
|
+
return normalized;
|
|
52568
|
+
return `${characters.slice(0, maxLength - 1).join("").trimEnd()}…`;
|
|
52569
|
+
}
|
|
52570
|
+
function sessionImportCandidate(input) {
|
|
52571
|
+
const time3 = typeof input.updatedAt === "number" ? input.updatedAt : typeof input.updatedAt === "string" ? Date.parse(input.updatedAt) : Number.NaN;
|
|
52572
|
+
const parsed = harnessSessionImportCandidateSchema.safeParse({
|
|
52573
|
+
nativeSessionId: input.nativeSessionId,
|
|
52574
|
+
cwd: input.cwd,
|
|
52575
|
+
title: typeof input.title === "string" && input.title.trim().length > 0 ? input.title : null,
|
|
52576
|
+
updatedAt: Math.floor(time3),
|
|
52577
|
+
// Unknown must stay unknown; only an explicit boolean is a native statement.
|
|
52578
|
+
running: typeof input.running === "boolean" ? input.running : null
|
|
52579
|
+
});
|
|
52580
|
+
return parsed.success ? parsed.data : null;
|
|
52581
|
+
}
|
|
52582
|
+
var SessionImportScope = class {
|
|
52583
|
+
#abort = new AbortController();
|
|
52584
|
+
#options;
|
|
52585
|
+
#pending = /* @__PURE__ */ new Set();
|
|
52586
|
+
constructor(options) {
|
|
52587
|
+
this.#options = options;
|
|
52588
|
+
}
|
|
52589
|
+
#closed() {
|
|
52590
|
+
return {
|
|
52591
|
+
ok: false,
|
|
52592
|
+
error: { code: "invalidState", message: this.#options.closedMessage, retryable: false }
|
|
52593
|
+
};
|
|
52594
|
+
}
|
|
52595
|
+
read(operation) {
|
|
52596
|
+
const signal = this.#abort.signal;
|
|
52597
|
+
if (signal.aborted)
|
|
52598
|
+
return Promise.resolve(this.#closed());
|
|
52599
|
+
let started;
|
|
52600
|
+
try {
|
|
52601
|
+
started = operation(signal);
|
|
52602
|
+
} catch (error51) {
|
|
52603
|
+
started = Promise.reject(error51 instanceof Error ? error51 : new Error("Session read failed"));
|
|
52604
|
+
}
|
|
52605
|
+
const request = started.then((value) => signal.aborted ? this.#closed() : { ok: true, value }).catch(() => signal.aborted ? this.#closed() : {
|
|
52606
|
+
ok: false,
|
|
52607
|
+
error: {
|
|
52608
|
+
code: "unavailable",
|
|
52609
|
+
message: this.#options.unavailableMessage,
|
|
52610
|
+
retryable: true
|
|
52611
|
+
}
|
|
52612
|
+
}).finally(() => this.#pending.delete(request));
|
|
52613
|
+
this.#pending.add(request);
|
|
52614
|
+
return request;
|
|
52615
|
+
}
|
|
52616
|
+
/** `read` for `resolveCandidate`: a null source is the selected Session having disappeared. */
|
|
52617
|
+
async resolve(operation) {
|
|
52618
|
+
const result = await this.read(operation);
|
|
52619
|
+
if (!result.ok)
|
|
52620
|
+
return result;
|
|
52621
|
+
return result.value ? { ok: true, value: result.value } : {
|
|
52622
|
+
ok: false,
|
|
52623
|
+
error: {
|
|
52624
|
+
code: "sessionNotFound",
|
|
52625
|
+
message: this.#options.notFoundMessage,
|
|
52626
|
+
retryable: false
|
|
52627
|
+
}
|
|
52628
|
+
};
|
|
52629
|
+
}
|
|
52630
|
+
/** Idempotent. Resolves after every started read has settled. */
|
|
52631
|
+
async close() {
|
|
52632
|
+
this.#abort.abort();
|
|
52633
|
+
await Promise.allSettled(this.#pending);
|
|
52634
|
+
}
|
|
52635
|
+
};
|
|
52636
|
+
|
|
52637
|
+
// ../qoder/dist/qoder-session-import.js
|
|
52638
|
+
var QoderSessionImport = class {
|
|
52639
|
+
#dependencies;
|
|
52640
|
+
#scope;
|
|
52641
|
+
constructor(dependencies) {
|
|
52642
|
+
this.#dependencies = dependencies;
|
|
52643
|
+
const name = dependencies.displayName;
|
|
52644
|
+
this.#scope = new SessionImportScope({
|
|
52645
|
+
closedMessage: `${name} Session import is closed`,
|
|
52646
|
+
unavailableMessage: `${name} sessions could not be read; check storage access and retry`,
|
|
52647
|
+
notFoundMessage: `${name} Session is no longer importable`
|
|
52648
|
+
});
|
|
52649
|
+
}
|
|
52650
|
+
listCandidates() {
|
|
52651
|
+
return this.#scope.read(async (signal) => {
|
|
52652
|
+
const candidates = /* @__PURE__ */ new Map();
|
|
52653
|
+
for (const info of await this.#dependencies.listSessions()) {
|
|
52654
|
+
signal.throwIfAborted();
|
|
52655
|
+
const candidate = await this.#candidate(info);
|
|
52656
|
+
if (candidate && !candidates.has(candidate.nativeSessionId))
|
|
52657
|
+
candidates.set(candidate.nativeSessionId, candidate);
|
|
52658
|
+
}
|
|
52659
|
+
return [...candidates.values()];
|
|
52660
|
+
});
|
|
52661
|
+
}
|
|
52662
|
+
resolveCandidate(nativeSessionId) {
|
|
52663
|
+
return this.#scope.resolve(async (signal) => {
|
|
52664
|
+
const info = await this.#dependencies.getSessionInfo(nativeSessionId);
|
|
52665
|
+
signal.throwIfAborted();
|
|
52666
|
+
if (info?.sessionId !== nativeSessionId)
|
|
52667
|
+
return null;
|
|
52668
|
+
const candidate = await this.#candidate(info);
|
|
52669
|
+
if (!candidate)
|
|
52670
|
+
return null;
|
|
52671
|
+
return {
|
|
52672
|
+
candidate,
|
|
52673
|
+
nativeRef: nativeSessionRefSchema.parse({
|
|
52674
|
+
harnessId: this.#dependencies.harnessId,
|
|
52675
|
+
nativeSessionId,
|
|
52676
|
+
formatVersion: 1
|
|
52677
|
+
})
|
|
52678
|
+
};
|
|
52679
|
+
});
|
|
52680
|
+
}
|
|
52681
|
+
close() {
|
|
52682
|
+
return this.#scope.close();
|
|
52683
|
+
}
|
|
52684
|
+
async #candidate(info) {
|
|
52685
|
+
if (typeof info.cwd !== "string" || !path5.isAbsolute(info.cwd))
|
|
52686
|
+
return null;
|
|
52687
|
+
const cwd = path5.resolve(info.cwd);
|
|
52688
|
+
try {
|
|
52689
|
+
if (!(await stat(cwd)).isDirectory())
|
|
52690
|
+
return null;
|
|
52691
|
+
} catch (error51) {
|
|
52692
|
+
if (isStorageAccessError(error51))
|
|
52693
|
+
throw error51;
|
|
52694
|
+
return null;
|
|
52695
|
+
}
|
|
52696
|
+
return sessionImportCandidate({
|
|
52697
|
+
nativeSessionId: info.sessionId,
|
|
52698
|
+
cwd,
|
|
52699
|
+
title: sessionImportTitle(info.customTitle) ?? sessionImportTitle(info.summary) ?? sessionImportTitle(info.firstPrompt),
|
|
52700
|
+
updatedAt: info.lastModified
|
|
52701
|
+
// The SDK exposes no cross-process activity marker: idleness cannot be established.
|
|
52702
|
+
});
|
|
52703
|
+
}
|
|
52704
|
+
};
|
|
52705
|
+
|
|
52467
52706
|
// ../qoder/dist/qoder-adapter.js
|
|
52468
52707
|
var QoderAdapter = class {
|
|
52469
52708
|
harnessId;
|
|
52470
52709
|
#variant;
|
|
52471
52710
|
commandCatalog = QODER_FALLBACK_COMMAND_CATALOG;
|
|
52472
52711
|
liveCommandCatalog = true;
|
|
52712
|
+
sessionImport;
|
|
52473
52713
|
#commandOverride;
|
|
52474
52714
|
#environment;
|
|
52475
52715
|
#platform;
|
|
@@ -52493,6 +52733,12 @@ var QoderAdapter = class {
|
|
|
52493
52733
|
this.#forkSession = options.forkSession ?? runtime.sdk.forkSession;
|
|
52494
52734
|
this.#getSessionMessages = options.getSessionMessages ?? runtime.sdk.getSessionMessages;
|
|
52495
52735
|
this.#getSessionInfo = options.getSessionInfo ?? runtime.sdk.getSessionInfo;
|
|
52736
|
+
this.sessionImport = new QoderSessionImport({
|
|
52737
|
+
harnessId: this.harnessId,
|
|
52738
|
+
displayName: this.#variant === "cn" ? "Qoder CN" : "Qoder",
|
|
52739
|
+
listSessions: options.listSessions ?? (() => runtime.sdk.listSessions()),
|
|
52740
|
+
getSessionInfo: this.#getSessionInfo
|
|
52741
|
+
});
|
|
52496
52742
|
this.#getAvailableModels = options.getAvailableModels;
|
|
52497
52743
|
this.#resolveExecutable = options.resolveExecutable ?? ((input, dependencies) => resolveQoderExecutable({ ...input, variant: this.#variant }, dependencies));
|
|
52498
52744
|
}
|
|
@@ -52711,7 +52957,7 @@ var QoderAdapter = class {
|
|
|
52711
52957
|
sourceInfo = await this.#getSessionInfo(sourceRef.data.nativeSessionId, { dir: input.cwd });
|
|
52712
52958
|
} catch {
|
|
52713
52959
|
}
|
|
52714
|
-
if (sourceInfo?.cwd &&
|
|
52960
|
+
if (sourceInfo?.cwd && path6.resolve(sourceInfo.cwd) !== path6.resolve(input.cwd)) {
|
|
52715
52961
|
return {
|
|
52716
52962
|
ok: false,
|
|
52717
52963
|
error: {
|
|
@@ -52861,7 +53107,7 @@ var QoderAdapter = class {
|
|
|
52861
53107
|
this.#sessions.clear();
|
|
52862
53108
|
this.#inspections.clear();
|
|
52863
53109
|
this.#inFlightInspections.clear();
|
|
52864
|
-
await Promise.all(sessions.map((s) => s.close()));
|
|
53110
|
+
await Promise.all([this.sessionImport.close(), ...sessions.map((s) => s.close())]);
|
|
52865
53111
|
}
|
|
52866
53112
|
};
|
|
52867
53113
|
|