@liberseek/boft-cli-win32-arm64 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.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/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
|
}
|
|
@@ -12995,7 +12995,7 @@ function createHarnessInstaller(environment, source) {
|
|
|
12995
12995
|
|
|
12996
12996
|
// dist/qoder-adapter.js
|
|
12997
12997
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
12998
|
-
import
|
|
12998
|
+
import path6 from "node:path";
|
|
12999
12999
|
|
|
13000
13000
|
// ../../../node_modules/zod/v4/classic/external.js
|
|
13001
13001
|
var external_exports = {};
|
|
@@ -13763,10 +13763,10 @@ function mergeDefs(...defs) {
|
|
|
13763
13763
|
function cloneDef(schema) {
|
|
13764
13764
|
return mergeDefs(schema._zod.def);
|
|
13765
13765
|
}
|
|
13766
|
-
function getElementAtPath(obj,
|
|
13767
|
-
if (!
|
|
13766
|
+
function getElementAtPath(obj, path7) {
|
|
13767
|
+
if (!path7)
|
|
13768
13768
|
return obj;
|
|
13769
|
-
return
|
|
13769
|
+
return path7.reduce((acc, key) => acc?.[key], obj);
|
|
13770
13770
|
}
|
|
13771
13771
|
function promiseAllObject(promisesObj) {
|
|
13772
13772
|
const keys = Object.keys(promisesObj);
|
|
@@ -14175,11 +14175,11 @@ function explicitlyAborted(x3, startIndex = 0) {
|
|
|
14175
14175
|
}
|
|
14176
14176
|
return false;
|
|
14177
14177
|
}
|
|
14178
|
-
function prefixIssues(
|
|
14178
|
+
function prefixIssues(path7, issues) {
|
|
14179
14179
|
return issues.map((iss) => {
|
|
14180
14180
|
var _a5;
|
|
14181
14181
|
(_a5 = iss).path ?? (_a5.path = []);
|
|
14182
|
-
iss.path.unshift(
|
|
14182
|
+
iss.path.unshift(path7);
|
|
14183
14183
|
return iss;
|
|
14184
14184
|
});
|
|
14185
14185
|
}
|
|
@@ -14326,16 +14326,16 @@ function flattenError(error51, mapper = (issue2) => issue2.message) {
|
|
|
14326
14326
|
}
|
|
14327
14327
|
function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
14328
14328
|
const fieldErrors = { _errors: [] };
|
|
14329
|
-
const processError = (error52,
|
|
14329
|
+
const processError = (error52, path7 = []) => {
|
|
14330
14330
|
for (const issue2 of error52.issues) {
|
|
14331
14331
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
14332
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
14332
|
+
issue2.errors.map((issues) => processError({ issues }, [...path7, ...issue2.path]));
|
|
14333
14333
|
} else if (issue2.code === "invalid_key") {
|
|
14334
|
-
processError({ issues: issue2.issues }, [...
|
|
14334
|
+
processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
|
|
14335
14335
|
} else if (issue2.code === "invalid_element") {
|
|
14336
|
-
processError({ issues: issue2.issues }, [...
|
|
14336
|
+
processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
|
|
14337
14337
|
} else {
|
|
14338
|
-
const fullpath = [...
|
|
14338
|
+
const fullpath = [...path7, ...issue2.path];
|
|
14339
14339
|
if (fullpath.length === 0) {
|
|
14340
14340
|
fieldErrors._errors.push(mapper(issue2));
|
|
14341
14341
|
} else {
|
|
@@ -14362,17 +14362,17 @@ function formatError(error51, mapper = (issue2) => issue2.message) {
|
|
|
14362
14362
|
}
|
|
14363
14363
|
function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
14364
14364
|
const result = { errors: [] };
|
|
14365
|
-
const processError = (error52,
|
|
14365
|
+
const processError = (error52, path7 = []) => {
|
|
14366
14366
|
var _a5, _b;
|
|
14367
14367
|
for (const issue2 of error52.issues) {
|
|
14368
14368
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
14369
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
14369
|
+
issue2.errors.map((issues) => processError({ issues }, [...path7, ...issue2.path]));
|
|
14370
14370
|
} else if (issue2.code === "invalid_key") {
|
|
14371
|
-
processError({ issues: issue2.issues }, [...
|
|
14371
|
+
processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
|
|
14372
14372
|
} else if (issue2.code === "invalid_element") {
|
|
14373
|
-
processError({ issues: issue2.issues }, [...
|
|
14373
|
+
processError({ issues: issue2.issues }, [...path7, ...issue2.path]);
|
|
14374
14374
|
} else {
|
|
14375
|
-
const fullpath = [...
|
|
14375
|
+
const fullpath = [...path7, ...issue2.path];
|
|
14376
14376
|
if (fullpath.length === 0) {
|
|
14377
14377
|
result.errors.push(mapper(issue2));
|
|
14378
14378
|
continue;
|
|
@@ -14404,8 +14404,8 @@ function treeifyError(error51, mapper = (issue2) => issue2.message) {
|
|
|
14404
14404
|
}
|
|
14405
14405
|
function toDotPath(_path) {
|
|
14406
14406
|
const segs = [];
|
|
14407
|
-
const
|
|
14408
|
-
for (const seg of
|
|
14407
|
+
const path7 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
14408
|
+
for (const seg of path7) {
|
|
14409
14409
|
if (typeof seg === "number")
|
|
14410
14410
|
segs.push(`[${seg}]`);
|
|
14411
14411
|
else if (typeof seg === "symbol")
|
|
@@ -27097,13 +27097,13 @@ function resolveRef(ref, ctx) {
|
|
|
27097
27097
|
if (!ref.startsWith("#")) {
|
|
27098
27098
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
27099
27099
|
}
|
|
27100
|
-
const
|
|
27101
|
-
if (
|
|
27100
|
+
const path7 = ref.slice(1).split("/").filter(Boolean);
|
|
27101
|
+
if (path7.length === 0) {
|
|
27102
27102
|
return ctx.rootSchema;
|
|
27103
27103
|
}
|
|
27104
27104
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
27105
|
-
if (
|
|
27106
|
-
const key =
|
|
27105
|
+
if (path7[0] === defsKey) {
|
|
27106
|
+
const key = path7[1];
|
|
27107
27107
|
if (!key || !ctx.defs[key]) {
|
|
27108
27108
|
throw new Error(`Reference not found: ${ref}`);
|
|
27109
27109
|
}
|
|
@@ -27591,6 +27591,10 @@ var hostTurnIdSchema = opaqueIdSchema.brand();
|
|
|
27591
27591
|
var hostItemIdSchema = opaqueIdSchema.brand();
|
|
27592
27592
|
var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
27593
27593
|
|
|
27594
|
+
// ../../shared-contracts/dist/thread-prewarm.js
|
|
27595
|
+
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
27596
|
+
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
27597
|
+
|
|
27594
27598
|
// ../../shared-contracts/dist/harness-plugins.js
|
|
27595
27599
|
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
27596
27600
|
var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
|
|
@@ -27658,6 +27662,9 @@ var consoleOpenResultSchema = external_exports.strictObject({
|
|
|
27658
27662
|
url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
|
|
27659
27663
|
});
|
|
27660
27664
|
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
27665
|
+
"codexhost/console/remote-connections",
|
|
27666
|
+
"codexhost/runtime/status",
|
|
27667
|
+
"codexhost/remote/ssh-setup",
|
|
27661
27668
|
"codexhost/harness/plugins/list",
|
|
27662
27669
|
"codexhost/harness/display-settings/get",
|
|
27663
27670
|
"codexhost/harness/display-settings/set",
|
|
@@ -28603,6 +28610,80 @@ var updateStatusResultSchema = external_exports.strictObject({
|
|
|
28603
28610
|
status: updateStatusSchema.nullable()
|
|
28604
28611
|
});
|
|
28605
28612
|
|
|
28613
|
+
// ../../shared-contracts/dist/remote-runtime.js
|
|
28614
|
+
var remoteUpdatePhaseSchema = external_exports.enum([
|
|
28615
|
+
"idle",
|
|
28616
|
+
"installing",
|
|
28617
|
+
"restarting",
|
|
28618
|
+
"succeeded",
|
|
28619
|
+
"failed"
|
|
28620
|
+
]);
|
|
28621
|
+
var runtimeStatusSchema = external_exports.object({
|
|
28622
|
+
runningVersion: external_exports.string().nullable(),
|
|
28623
|
+
installedVersion: external_exports.string().nullable(),
|
|
28624
|
+
restartRequired: external_exports.boolean(),
|
|
28625
|
+
remote: external_exports.boolean(),
|
|
28626
|
+
updateSupported: external_exports.boolean(),
|
|
28627
|
+
update: external_exports.object({
|
|
28628
|
+
phase: remoteUpdatePhaseSchema,
|
|
28629
|
+
targetVersion: external_exports.string().nullable(),
|
|
28630
|
+
error: external_exports.string().nullable()
|
|
28631
|
+
})
|
|
28632
|
+
});
|
|
28633
|
+
var remoteUpdateParamsSchema = external_exports.object({
|
|
28634
|
+
version: external_exports.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u)
|
|
28635
|
+
}).strict();
|
|
28636
|
+
var remoteSshSetupParamsSchema = external_exports.object({
|
|
28637
|
+
hostname: external_exports.string().min(1).max(1024).refine((value) => !value.startsWith("-") && !/\s/u.test(value)),
|
|
28638
|
+
port: external_exports.number().int().min(1).max(65535).nullable(),
|
|
28639
|
+
identity: external_exports.string().max(4096).nullable(),
|
|
28640
|
+
action: external_exports.enum(["inspect", "install", "update", "repair", "uninstall"]),
|
|
28641
|
+
uninstallPackage: external_exports.boolean().optional(),
|
|
28642
|
+
version: external_exports.string().regex(/^\d+\.\d+\.\d+$/u).nullable()
|
|
28643
|
+
}).strict();
|
|
28644
|
+
var remoteSshSetupResultSchema = external_exports.object({ state: external_exports.enum(["installed", "not-installed"]) }).strict();
|
|
28645
|
+
|
|
28646
|
+
// ../../shared-contracts/dist/remote-connections.js
|
|
28647
|
+
var hostId = external_exports.string().min(1).max(1024);
|
|
28648
|
+
var codexSshConnectionSchema = external_exports.object({
|
|
28649
|
+
hostId,
|
|
28650
|
+
displayName: external_exports.string().min(1).max(1024),
|
|
28651
|
+
source: external_exports.enum(["codex-managed", "discovered"]),
|
|
28652
|
+
sshAlias: external_exports.string().max(1024).nullable(),
|
|
28653
|
+
sshHost: external_exports.string().min(1).max(1024),
|
|
28654
|
+
sshPort: external_exports.number().int().min(1).max(65535).nullable(),
|
|
28655
|
+
identity: external_exports.string().max(4096).nullable(),
|
|
28656
|
+
autoConnect: external_exports.boolean(),
|
|
28657
|
+
connectionAnalyticsId: external_exports.string().max(1024).optional()
|
|
28658
|
+
});
|
|
28659
|
+
var codexSshDraftSchema = external_exports.strictObject({
|
|
28660
|
+
displayName: external_exports.string().min(1).max(1024),
|
|
28661
|
+
hostname: external_exports.string().min(1).max(1024),
|
|
28662
|
+
sshPort: external_exports.number().int().min(1).max(65535).nullable(),
|
|
28663
|
+
identity: external_exports.string().max(4096).nullable()
|
|
28664
|
+
});
|
|
28665
|
+
var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
28666
|
+
external_exports.strictObject({ action: external_exports.literal("list") }),
|
|
28667
|
+
external_exports.strictObject({
|
|
28668
|
+
action: external_exports.literal("save"),
|
|
28669
|
+
draft: codexSshDraftSchema,
|
|
28670
|
+
previous: codexSshConnectionSchema.nullable()
|
|
28671
|
+
}),
|
|
28672
|
+
external_exports.strictObject({ action: external_exports.literal("remove"), previous: codexSshConnectionSchema }),
|
|
28673
|
+
external_exports.strictObject({ action: external_exports.literal("connect"), hostId, enabled: external_exports.boolean() }),
|
|
28674
|
+
external_exports.strictObject({ action: external_exports.literal("state"), hostId }),
|
|
28675
|
+
external_exports.strictObject({ action: external_exports.literal("runtime"), hostId }),
|
|
28676
|
+
external_exports.strictObject({
|
|
28677
|
+
action: external_exports.literal("update"),
|
|
28678
|
+
hostId: hostId.refine((id) => id !== "local"),
|
|
28679
|
+
version: remoteUpdateParamsSchema.shape.version
|
|
28680
|
+
})
|
|
28681
|
+
]);
|
|
28682
|
+
var remoteConnectionsReplySchema = external_exports.union([
|
|
28683
|
+
external_exports.strictObject({ result: jsonValueSchema }),
|
|
28684
|
+
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
28685
|
+
]);
|
|
28686
|
+
|
|
28606
28687
|
// ../../shared-contracts/dist/index.js
|
|
28607
28688
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
28608
28689
|
|
|
@@ -30240,8 +30321,8 @@ function getErrorMap2() {
|
|
|
30240
30321
|
|
|
30241
30322
|
// ../../../node_modules/zod/v3/helpers/parseUtil.js
|
|
30242
30323
|
var makeIssue = (params) => {
|
|
30243
|
-
const { data, path:
|
|
30244
|
-
const fullPath = [...
|
|
30324
|
+
const { data, path: path7, errorMaps, issueData } = params;
|
|
30325
|
+
const fullPath = [...path7, ...issueData.path || []];
|
|
30245
30326
|
const fullIssue = {
|
|
30246
30327
|
...issueData,
|
|
30247
30328
|
path: fullPath
|
|
@@ -30356,11 +30437,11 @@ var errorUtil;
|
|
|
30356
30437
|
|
|
30357
30438
|
// ../../../node_modules/zod/v3/types.js
|
|
30358
30439
|
var ParseInputLazyPath = class {
|
|
30359
|
-
constructor(parent, value,
|
|
30440
|
+
constructor(parent, value, path7, key) {
|
|
30360
30441
|
this._cachedPath = [];
|
|
30361
30442
|
this.parent = parent;
|
|
30362
30443
|
this.data = value;
|
|
30363
|
-
this._path =
|
|
30444
|
+
this._path = path7;
|
|
30364
30445
|
this._key = key;
|
|
30365
30446
|
}
|
|
30366
30447
|
get path() {
|
|
@@ -33887,11 +33968,11 @@ function normalizeObjectSchema(schema) {
|
|
|
33887
33968
|
}
|
|
33888
33969
|
return void 0;
|
|
33889
33970
|
}
|
|
33890
|
-
function getDotPath(
|
|
33891
|
-
if (
|
|
33971
|
+
function getDotPath(path7) {
|
|
33972
|
+
if (path7.length === 0) {
|
|
33892
33973
|
return "object root";
|
|
33893
33974
|
}
|
|
33894
|
-
return
|
|
33975
|
+
return path7.reduce((acc, seg, index) => {
|
|
33895
33976
|
if (index === 0) {
|
|
33896
33977
|
return String(seg);
|
|
33897
33978
|
}
|
|
@@ -52462,12 +52543,171 @@ var QoderSession = class {
|
|
|
52462
52543
|
}
|
|
52463
52544
|
};
|
|
52464
52545
|
|
|
52546
|
+
// dist/qoder-session-import.js
|
|
52547
|
+
import { stat } from "node:fs/promises";
|
|
52548
|
+
import path5 from "node:path";
|
|
52549
|
+
|
|
52550
|
+
// ../../harness-adapter/dist/session-import.js
|
|
52551
|
+
var STORAGE_ACCESS_ERRORS = /* @__PURE__ */ new Set(["EACCES", "EPERM", "EIO", "EMFILE", "ENFILE"]);
|
|
52552
|
+
function isStorageAccessError(error51) {
|
|
52553
|
+
return typeof error51 === "object" && error51 !== null && "code" in error51 && typeof error51.code === "string" && STORAGE_ACCESS_ERRORS.has(error51.code);
|
|
52554
|
+
}
|
|
52555
|
+
function sessionImportTitle(value, maxLength = HARNESS_SESSION_IMPORT_TITLE_MAX_LENGTH) {
|
|
52556
|
+
if (typeof value !== "string")
|
|
52557
|
+
return null;
|
|
52558
|
+
const normalized = value.replaceAll("\0", "").replaceAll(/\s+/gu, " ").trim();
|
|
52559
|
+
if (!normalized)
|
|
52560
|
+
return null;
|
|
52561
|
+
if (normalized.length <= maxLength)
|
|
52562
|
+
return normalized;
|
|
52563
|
+
const characters = [...normalized];
|
|
52564
|
+
if (characters.length <= maxLength)
|
|
52565
|
+
return normalized;
|
|
52566
|
+
return `${characters.slice(0, maxLength - 1).join("").trimEnd()}…`;
|
|
52567
|
+
}
|
|
52568
|
+
function sessionImportCandidate(input) {
|
|
52569
|
+
const time3 = typeof input.updatedAt === "number" ? input.updatedAt : typeof input.updatedAt === "string" ? Date.parse(input.updatedAt) : Number.NaN;
|
|
52570
|
+
const parsed = harnessSessionImportCandidateSchema.safeParse({
|
|
52571
|
+
nativeSessionId: input.nativeSessionId,
|
|
52572
|
+
cwd: input.cwd,
|
|
52573
|
+
title: typeof input.title === "string" && input.title.trim().length > 0 ? input.title : null,
|
|
52574
|
+
updatedAt: Math.floor(time3),
|
|
52575
|
+
// Unknown must stay unknown; only an explicit boolean is a native statement.
|
|
52576
|
+
running: typeof input.running === "boolean" ? input.running : null
|
|
52577
|
+
});
|
|
52578
|
+
return parsed.success ? parsed.data : null;
|
|
52579
|
+
}
|
|
52580
|
+
var SessionImportScope = class {
|
|
52581
|
+
#abort = new AbortController();
|
|
52582
|
+
#options;
|
|
52583
|
+
#pending = /* @__PURE__ */ new Set();
|
|
52584
|
+
constructor(options) {
|
|
52585
|
+
this.#options = options;
|
|
52586
|
+
}
|
|
52587
|
+
#closed() {
|
|
52588
|
+
return {
|
|
52589
|
+
ok: false,
|
|
52590
|
+
error: { code: "invalidState", message: this.#options.closedMessage, retryable: false }
|
|
52591
|
+
};
|
|
52592
|
+
}
|
|
52593
|
+
read(operation) {
|
|
52594
|
+
const signal = this.#abort.signal;
|
|
52595
|
+
if (signal.aborted)
|
|
52596
|
+
return Promise.resolve(this.#closed());
|
|
52597
|
+
let started;
|
|
52598
|
+
try {
|
|
52599
|
+
started = operation(signal);
|
|
52600
|
+
} catch (error51) {
|
|
52601
|
+
started = Promise.reject(error51 instanceof Error ? error51 : new Error("Session read failed"));
|
|
52602
|
+
}
|
|
52603
|
+
const request = started.then((value) => signal.aborted ? this.#closed() : { ok: true, value }).catch(() => signal.aborted ? this.#closed() : {
|
|
52604
|
+
ok: false,
|
|
52605
|
+
error: {
|
|
52606
|
+
code: "unavailable",
|
|
52607
|
+
message: this.#options.unavailableMessage,
|
|
52608
|
+
retryable: true
|
|
52609
|
+
}
|
|
52610
|
+
}).finally(() => this.#pending.delete(request));
|
|
52611
|
+
this.#pending.add(request);
|
|
52612
|
+
return request;
|
|
52613
|
+
}
|
|
52614
|
+
/** `read` for `resolveCandidate`: a null source is the selected Session having disappeared. */
|
|
52615
|
+
async resolve(operation) {
|
|
52616
|
+
const result = await this.read(operation);
|
|
52617
|
+
if (!result.ok)
|
|
52618
|
+
return result;
|
|
52619
|
+
return result.value ? { ok: true, value: result.value } : {
|
|
52620
|
+
ok: false,
|
|
52621
|
+
error: {
|
|
52622
|
+
code: "sessionNotFound",
|
|
52623
|
+
message: this.#options.notFoundMessage,
|
|
52624
|
+
retryable: false
|
|
52625
|
+
}
|
|
52626
|
+
};
|
|
52627
|
+
}
|
|
52628
|
+
/** Idempotent. Resolves after every started read has settled. */
|
|
52629
|
+
async close() {
|
|
52630
|
+
this.#abort.abort();
|
|
52631
|
+
await Promise.allSettled(this.#pending);
|
|
52632
|
+
}
|
|
52633
|
+
};
|
|
52634
|
+
|
|
52635
|
+
// dist/qoder-session-import.js
|
|
52636
|
+
var QoderSessionImport = class {
|
|
52637
|
+
#dependencies;
|
|
52638
|
+
#scope;
|
|
52639
|
+
constructor(dependencies) {
|
|
52640
|
+
this.#dependencies = dependencies;
|
|
52641
|
+
const name = dependencies.displayName;
|
|
52642
|
+
this.#scope = new SessionImportScope({
|
|
52643
|
+
closedMessage: `${name} Session import is closed`,
|
|
52644
|
+
unavailableMessage: `${name} sessions could not be read; check storage access and retry`,
|
|
52645
|
+
notFoundMessage: `${name} Session is no longer importable`
|
|
52646
|
+
});
|
|
52647
|
+
}
|
|
52648
|
+
listCandidates() {
|
|
52649
|
+
return this.#scope.read(async (signal) => {
|
|
52650
|
+
const candidates = /* @__PURE__ */ new Map();
|
|
52651
|
+
for (const info of await this.#dependencies.listSessions()) {
|
|
52652
|
+
signal.throwIfAborted();
|
|
52653
|
+
const candidate = await this.#candidate(info);
|
|
52654
|
+
if (candidate && !candidates.has(candidate.nativeSessionId))
|
|
52655
|
+
candidates.set(candidate.nativeSessionId, candidate);
|
|
52656
|
+
}
|
|
52657
|
+
return [...candidates.values()];
|
|
52658
|
+
});
|
|
52659
|
+
}
|
|
52660
|
+
resolveCandidate(nativeSessionId) {
|
|
52661
|
+
return this.#scope.resolve(async (signal) => {
|
|
52662
|
+
const info = await this.#dependencies.getSessionInfo(nativeSessionId);
|
|
52663
|
+
signal.throwIfAborted();
|
|
52664
|
+
if (info?.sessionId !== nativeSessionId)
|
|
52665
|
+
return null;
|
|
52666
|
+
const candidate = await this.#candidate(info);
|
|
52667
|
+
if (!candidate)
|
|
52668
|
+
return null;
|
|
52669
|
+
return {
|
|
52670
|
+
candidate,
|
|
52671
|
+
nativeRef: nativeSessionRefSchema.parse({
|
|
52672
|
+
harnessId: this.#dependencies.harnessId,
|
|
52673
|
+
nativeSessionId,
|
|
52674
|
+
formatVersion: 1
|
|
52675
|
+
})
|
|
52676
|
+
};
|
|
52677
|
+
});
|
|
52678
|
+
}
|
|
52679
|
+
close() {
|
|
52680
|
+
return this.#scope.close();
|
|
52681
|
+
}
|
|
52682
|
+
async #candidate(info) {
|
|
52683
|
+
if (typeof info.cwd !== "string" || !path5.isAbsolute(info.cwd))
|
|
52684
|
+
return null;
|
|
52685
|
+
const cwd = path5.resolve(info.cwd);
|
|
52686
|
+
try {
|
|
52687
|
+
if (!(await stat(cwd)).isDirectory())
|
|
52688
|
+
return null;
|
|
52689
|
+
} catch (error51) {
|
|
52690
|
+
if (isStorageAccessError(error51))
|
|
52691
|
+
throw error51;
|
|
52692
|
+
return null;
|
|
52693
|
+
}
|
|
52694
|
+
return sessionImportCandidate({
|
|
52695
|
+
nativeSessionId: info.sessionId,
|
|
52696
|
+
cwd,
|
|
52697
|
+
title: sessionImportTitle(info.customTitle) ?? sessionImportTitle(info.summary) ?? sessionImportTitle(info.firstPrompt),
|
|
52698
|
+
updatedAt: info.lastModified
|
|
52699
|
+
// The SDK exposes no cross-process activity marker: idleness cannot be established.
|
|
52700
|
+
});
|
|
52701
|
+
}
|
|
52702
|
+
};
|
|
52703
|
+
|
|
52465
52704
|
// dist/qoder-adapter.js
|
|
52466
52705
|
var QoderAdapter = class {
|
|
52467
52706
|
harnessId;
|
|
52468
52707
|
#variant;
|
|
52469
52708
|
commandCatalog = QODER_FALLBACK_COMMAND_CATALOG;
|
|
52470
52709
|
liveCommandCatalog = true;
|
|
52710
|
+
sessionImport;
|
|
52471
52711
|
#commandOverride;
|
|
52472
52712
|
#environment;
|
|
52473
52713
|
#platform;
|
|
@@ -52491,6 +52731,12 @@ var QoderAdapter = class {
|
|
|
52491
52731
|
this.#forkSession = options.forkSession ?? runtime.sdk.forkSession;
|
|
52492
52732
|
this.#getSessionMessages = options.getSessionMessages ?? runtime.sdk.getSessionMessages;
|
|
52493
52733
|
this.#getSessionInfo = options.getSessionInfo ?? runtime.sdk.getSessionInfo;
|
|
52734
|
+
this.sessionImport = new QoderSessionImport({
|
|
52735
|
+
harnessId: this.harnessId,
|
|
52736
|
+
displayName: this.#variant === "cn" ? "Qoder CN" : "Qoder",
|
|
52737
|
+
listSessions: options.listSessions ?? (() => runtime.sdk.listSessions()),
|
|
52738
|
+
getSessionInfo: this.#getSessionInfo
|
|
52739
|
+
});
|
|
52494
52740
|
this.#getAvailableModels = options.getAvailableModels;
|
|
52495
52741
|
this.#resolveExecutable = options.resolveExecutable ?? ((input, dependencies) => resolveQoderExecutable({ ...input, variant: this.#variant }, dependencies));
|
|
52496
52742
|
}
|
|
@@ -52709,7 +52955,7 @@ var QoderAdapter = class {
|
|
|
52709
52955
|
sourceInfo = await this.#getSessionInfo(sourceRef.data.nativeSessionId, { dir: input.cwd });
|
|
52710
52956
|
} catch {
|
|
52711
52957
|
}
|
|
52712
|
-
if (sourceInfo?.cwd &&
|
|
52958
|
+
if (sourceInfo?.cwd && path6.resolve(sourceInfo.cwd) !== path6.resolve(input.cwd)) {
|
|
52713
52959
|
return {
|
|
52714
52960
|
ok: false,
|
|
52715
52961
|
error: {
|
|
@@ -52859,7 +53105,7 @@ var QoderAdapter = class {
|
|
|
52859
53105
|
this.#sessions.clear();
|
|
52860
53106
|
this.#inspections.clear();
|
|
52861
53107
|
this.#inFlightInspections.clear();
|
|
52862
|
-
await Promise.all(sessions.map((s) => s.close()));
|
|
53108
|
+
await Promise.all([this.sessionImport.close(), ...sessions.map((s) => s.close())]);
|
|
52863
53109
|
}
|
|
52864
53110
|
};
|
|
52865
53111
|
|