@codexhost/cli-darwin-x64 0.18.0-beta.4 → 0.18.0-beta.5
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 +93 -53
- package/app/console-web.js +159 -119
- package/app/desktop-controller.mjs +283 -113
- package/app/host-runtime.mjs +2129 -1529
- package/app/plugins/antigravity/plugin.mjs +787 -303
- package/app/plugins/claude-code/plugin.mjs +85 -45
- package/app/plugins/codebuddy/plugin.mjs +99 -59
- package/app/plugins/codex-usage/plugin.mjs +85 -45
- package/app/plugins/copilot/plugin.mjs +90 -50
- package/app/plugins/cursor-cli/plugin.mjs +113 -73
- package/app/plugins/deepseek-harness/plugin.mjs +116 -76
- package/app/plugins/devin/plugin.mjs +90 -50
- package/app/plugins/grok/plugin.mjs +96 -56
- package/app/plugins/hermes/plugin.mjs +77 -37
- package/app/plugins/kimi-code/plugin.mjs +94 -54
- package/app/plugins/kiro-cli/plugin.mjs +90 -50
- package/app/plugins/omp/plugin.mjs +81 -41
- package/app/plugins/opencode/plugin.mjs +78 -38
- package/app/plugins/pi/plugin.mjs +94 -54
- package/app/plugins/qoder/plugin.mjs +106 -66
- package/app/plugins/qoder-cn/plugin.mjs +106 -66
- package/app/plugins/qwen-code/plugin.mjs +101 -61
- package/app/plugins/workbuddy/plugin.mjs +99 -59
- package/app/plugins/zcode/plugin.mjs +82 -42
- package/app/renderer-extension.js +353 -295
- package/app/web/assets/{index-D1dOzBMI.js → index-C0aXz2jD.js} +63 -63
- package/app/web/codex-agent.png +0 -0
- package/app/web/codexhost-settings.js +154 -114
- package/app/web/index.html +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +61 -61
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +8 -8
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +12 -12
- package/app/web/plugins/deepseek-ai__dsh-client-ui-permission-presets/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +8 -8
- package/app/web/sw.js +1 -6
- package/app/web-modules/server.mjs +2079 -1201
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { createRequire as __codexhostCreateRequire } from "node:module"; const require = __codexhostCreateRequire(import.meta.url);
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var __export = (
|
|
3
|
+
var __export = (target2, all) => {
|
|
4
4
|
for (var name in all)
|
|
5
|
-
__defProp(
|
|
5
|
+
__defProp(target2, name, { get: all[name], enumerable: true });
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
// ../../harness-discovery/dist/environment.js
|
|
@@ -1119,8 +1119,8 @@ function defineLazy(object2, key, getter) {
|
|
|
1119
1119
|
function objectClone(obj2) {
|
|
1120
1120
|
return Object.create(Object.getPrototypeOf(obj2), Object.getOwnPropertyDescriptors(obj2));
|
|
1121
1121
|
}
|
|
1122
|
-
function assignProp(
|
|
1123
|
-
Object.defineProperty(
|
|
1122
|
+
function assignProp(target2, prop, value) {
|
|
1123
|
+
Object.defineProperty(target2, prop, {
|
|
1124
1124
|
value,
|
|
1125
1125
|
writable: true,
|
|
1126
1126
|
enumerable: true,
|
|
@@ -1303,35 +1303,35 @@ function normalizeParams(_params) {
|
|
|
1303
1303
|
return params;
|
|
1304
1304
|
}
|
|
1305
1305
|
function createTransparentProxy(getter) {
|
|
1306
|
-
let
|
|
1306
|
+
let target2;
|
|
1307
1307
|
return new Proxy({}, {
|
|
1308
1308
|
get(_, prop, receiver) {
|
|
1309
|
-
|
|
1310
|
-
return Reflect.get(
|
|
1309
|
+
target2 ?? (target2 = getter());
|
|
1310
|
+
return Reflect.get(target2, prop, receiver);
|
|
1311
1311
|
},
|
|
1312
1312
|
set(_, prop, value, receiver) {
|
|
1313
|
-
|
|
1314
|
-
return Reflect.set(
|
|
1313
|
+
target2 ?? (target2 = getter());
|
|
1314
|
+
return Reflect.set(target2, prop, value, receiver);
|
|
1315
1315
|
},
|
|
1316
1316
|
has(_, prop) {
|
|
1317
|
-
|
|
1318
|
-
return Reflect.has(
|
|
1317
|
+
target2 ?? (target2 = getter());
|
|
1318
|
+
return Reflect.has(target2, prop);
|
|
1319
1319
|
},
|
|
1320
1320
|
deleteProperty(_, prop) {
|
|
1321
|
-
|
|
1322
|
-
return Reflect.deleteProperty(
|
|
1321
|
+
target2 ?? (target2 = getter());
|
|
1322
|
+
return Reflect.deleteProperty(target2, prop);
|
|
1323
1323
|
},
|
|
1324
1324
|
ownKeys(_) {
|
|
1325
|
-
|
|
1326
|
-
return Reflect.ownKeys(
|
|
1325
|
+
target2 ?? (target2 = getter());
|
|
1326
|
+
return Reflect.ownKeys(target2);
|
|
1327
1327
|
},
|
|
1328
1328
|
getOwnPropertyDescriptor(_, prop) {
|
|
1329
|
-
|
|
1330
|
-
return Reflect.getOwnPropertyDescriptor(
|
|
1329
|
+
target2 ?? (target2 = getter());
|
|
1330
|
+
return Reflect.getOwnPropertyDescriptor(target2, prop);
|
|
1331
1331
|
},
|
|
1332
1332
|
defineProperty(_, prop, descriptor) {
|
|
1333
|
-
|
|
1334
|
-
return Reflect.defineProperty(
|
|
1333
|
+
target2 ?? (target2 = getter());
|
|
1334
|
+
return Reflect.defineProperty(target2, prop, descriptor);
|
|
1335
1335
|
}
|
|
1336
1336
|
});
|
|
1337
1337
|
}
|
|
@@ -11783,15 +11783,15 @@ function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
|
|
|
11783
11783
|
|
|
11784
11784
|
// ../../../node_modules/zod/v4/core/to-json-schema.js
|
|
11785
11785
|
function initializeContext(params) {
|
|
11786
|
-
let
|
|
11787
|
-
if (
|
|
11788
|
-
|
|
11789
|
-
if (
|
|
11790
|
-
|
|
11786
|
+
let target2 = params?.target ?? "draft-2020-12";
|
|
11787
|
+
if (target2 === "draft-4")
|
|
11788
|
+
target2 = "draft-04";
|
|
11789
|
+
if (target2 === "draft-7")
|
|
11790
|
+
target2 = "draft-07";
|
|
11791
11791
|
return {
|
|
11792
11792
|
processors: params.processors ?? {},
|
|
11793
11793
|
metadataRegistry: params?.metadata ?? globalRegistry,
|
|
11794
|
-
target,
|
|
11794
|
+
target: target2,
|
|
11795
11795
|
unrepresentable: params?.unrepresentable ?? "throw",
|
|
11796
11796
|
override: params?.override ?? (() => {
|
|
11797
11797
|
}),
|
|
@@ -12133,8 +12133,8 @@ var createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
|
12133
12133
|
return finalize(ctx, schema);
|
|
12134
12134
|
};
|
|
12135
12135
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
12136
|
-
const { libraryOptions, target } = params ?? {};
|
|
12137
|
-
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
12136
|
+
const { libraryOptions, target: target2 } = params ?? {};
|
|
12137
|
+
const ctx = initializeContext({ ...libraryOptions ?? {}, target: target2, io, processors });
|
|
12138
12138
|
process2(schema, ctx);
|
|
12139
12139
|
extractDefs(ctx, schema);
|
|
12140
12140
|
return finalize(ctx, schema);
|
|
@@ -13193,8 +13193,8 @@ var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
|
13193
13193
|
catch(params) {
|
|
13194
13194
|
return _catch2(this, params);
|
|
13195
13195
|
},
|
|
13196
|
-
pipe(
|
|
13197
|
-
return pipe(this,
|
|
13196
|
+
pipe(target2) {
|
|
13197
|
+
return pipe(this, target2);
|
|
13198
13198
|
},
|
|
13199
13199
|
readonly() {
|
|
13200
13200
|
return readonly(this);
|
|
@@ -15424,15 +15424,15 @@ var threadOwnershipListResultSchema = external_exports.object({
|
|
|
15424
15424
|
threads: external_exports.array(threadOwnershipSchema).min(1).max(THREAD_OWNERSHIP_LIST_MAX_LENGTH)
|
|
15425
15425
|
}).strict().superRefine(({ threads }, context) => {
|
|
15426
15426
|
const seen = /* @__PURE__ */ new Set();
|
|
15427
|
-
for (const [index,
|
|
15428
|
-
if (seen.has(
|
|
15427
|
+
for (const [index, thread2] of threads.entries()) {
|
|
15428
|
+
if (seen.has(thread2.threadId)) {
|
|
15429
15429
|
context.addIssue({
|
|
15430
15430
|
code: "custom",
|
|
15431
15431
|
message: "Thread ownership-list results must be unique",
|
|
15432
15432
|
path: ["threads", index, "threadId"]
|
|
15433
15433
|
});
|
|
15434
15434
|
}
|
|
15435
|
-
seen.add(
|
|
15435
|
+
seen.add(thread2.threadId);
|
|
15436
15436
|
}
|
|
15437
15437
|
});
|
|
15438
15438
|
var threadSteeringInspectParamsSchema = external_exports.object({
|
|
@@ -16770,6 +16770,44 @@ var remoteSshSetupParamsSchema = external_exports.object({
|
|
|
16770
16770
|
}).strict();
|
|
16771
16771
|
var remoteSshSetupResultSchema = external_exports.object({ state: external_exports.enum(["installed", "not-installed"]) }).strict();
|
|
16772
16772
|
|
|
16773
|
+
// ../../shared-contracts/dist/remote-sessions.js
|
|
16774
|
+
var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
|
|
16775
|
+
var identity = external_exports.string().min(1).max(1024);
|
|
16776
|
+
var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
16777
|
+
var thread = { ...target, threadId: identity };
|
|
16778
|
+
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16779
|
+
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16780
|
+
external_exports.strictObject({
|
|
16781
|
+
kind: external_exports.literal("list"),
|
|
16782
|
+
...target,
|
|
16783
|
+
cursor: external_exports.string().nullable(),
|
|
16784
|
+
archived: external_exports.boolean()
|
|
16785
|
+
}),
|
|
16786
|
+
external_exports.strictObject({ kind: external_exports.literal("read"), ...thread }),
|
|
16787
|
+
external_exports.strictObject({
|
|
16788
|
+
kind: external_exports.literal("prompt"),
|
|
16789
|
+
...thread,
|
|
16790
|
+
epoch: identity,
|
|
16791
|
+
text: external_exports.string().min(1).max(8e3),
|
|
16792
|
+
requestId: identity.optional()
|
|
16793
|
+
}),
|
|
16794
|
+
external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
|
|
16795
|
+
external_exports.strictObject({
|
|
16796
|
+
kind: external_exports.literal("rename"),
|
|
16797
|
+
...thread,
|
|
16798
|
+
epoch: identity,
|
|
16799
|
+
name: external_exports.string().min(1).max(512)
|
|
16800
|
+
}),
|
|
16801
|
+
external_exports.strictObject({ kind: external_exports.literal("archive"), ...thread, epoch: identity, archived: external_exports.boolean() }),
|
|
16802
|
+
external_exports.strictObject({
|
|
16803
|
+
kind: external_exports.literal("respond"),
|
|
16804
|
+
...thread,
|
|
16805
|
+
epoch: identity,
|
|
16806
|
+
requestId: external_exports.union([identity, external_exports.number().int()]),
|
|
16807
|
+
result: external_exports.record(external_exports.string(), external_exports.unknown())
|
|
16808
|
+
})
|
|
16809
|
+
]);
|
|
16810
|
+
|
|
16773
16811
|
// ../../shared-contracts/dist/remote-connections.js
|
|
16774
16812
|
var hostId = external_exports.string().min(1).max(1024);
|
|
16775
16813
|
var codexSshConnectionSchema = external_exports.object({
|
|
@@ -16790,7 +16828,9 @@ var codexSshDraftSchema = external_exports.strictObject({
|
|
|
16790
16828
|
identity: external_exports.string().max(4096).nullable()
|
|
16791
16829
|
});
|
|
16792
16830
|
var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
16831
|
+
external_exports.strictObject({ action: external_exports.literal("session"), operation: remoteSessionOperationSchema }),
|
|
16793
16832
|
external_exports.strictObject({ action: external_exports.literal("list") }),
|
|
16833
|
+
external_exports.strictObject({ action: external_exports.literal("catalog") }),
|
|
16794
16834
|
external_exports.strictObject({
|
|
16795
16835
|
action: external_exports.literal("read-thread"),
|
|
16796
16836
|
hostId: hostId.refine((id) => id !== "local"),
|
|
@@ -17345,7 +17385,7 @@ var execute = promisify(execFile2);
|
|
|
17345
17385
|
var ENDPOINT = "https://api2.cursor.sh/aiserver.v1.DashboardService/";
|
|
17346
17386
|
var record3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
17347
17387
|
var percent = (value) => typeof value === "number" && Number.isFinite(value) && value >= 0 ? Math.min(100, value) : void 0;
|
|
17348
|
-
function projectCursorAccountUsage(usage,
|
|
17388
|
+
function projectCursorAccountUsage(usage, identity2, plan) {
|
|
17349
17389
|
const data = record3(usage);
|
|
17350
17390
|
const buckets = record3(data.planUsage);
|
|
17351
17391
|
const usedPercent = percent(buckets.autoPercentUsed);
|
|
@@ -17355,7 +17395,7 @@ function projectCursorAccountUsage(usage, identity, plan) {
|
|
|
17355
17395
|
const date5 = new Date(end);
|
|
17356
17396
|
const resetsAt = Number.isFinite(date5.getTime()) && end > 0 ? date5.toISOString() : void 0;
|
|
17357
17397
|
const apiPercent = percent(buckets.apiPercentUsed);
|
|
17358
|
-
const email3 = record3(
|
|
17398
|
+
const email3 = record3(identity2).email;
|
|
17359
17399
|
const planName = record3(record3(plan).planInfo).planName;
|
|
17360
17400
|
const result = harnessAccountSnapshotSchema.safeParse({
|
|
17361
17401
|
...typeof email3 === "string" && email3.trim() ? { email: email3 } : {},
|
|
@@ -17415,12 +17455,12 @@ async function fetchCursorAccount(input = {}) {
|
|
|
17415
17455
|
});
|
|
17416
17456
|
return response.ok ? response.json() : null;
|
|
17417
17457
|
};
|
|
17418
|
-
const [usage,
|
|
17458
|
+
const [usage, identity2, plan] = await Promise.all([
|
|
17419
17459
|
request("GetCurrentPeriodUsage"),
|
|
17420
17460
|
request("GetMe").catch(() => null),
|
|
17421
17461
|
request("GetPlanInfo").catch(() => null)
|
|
17422
17462
|
]);
|
|
17423
|
-
return projectCursorAccountUsage(usage,
|
|
17463
|
+
return projectCursorAccountUsage(usage, identity2, plan);
|
|
17424
17464
|
} catch {
|
|
17425
17465
|
return null;
|
|
17426
17466
|
}
|
|
@@ -21484,11 +21524,11 @@ var AgentApp = class {
|
|
|
21484
21524
|
[runAgentConnectHandlers](connection) {
|
|
21485
21525
|
runConnectHandlers(connection, this.connectHandlers);
|
|
21486
21526
|
}
|
|
21487
|
-
connect(
|
|
21488
|
-
return this.connectConnection(
|
|
21527
|
+
connect(target2, options = {}) {
|
|
21528
|
+
return this.connectConnection(target2, options).connection;
|
|
21489
21529
|
}
|
|
21490
|
-
connectWith(
|
|
21491
|
-
const { rawConnection, connection } = this.connectConnection(
|
|
21530
|
+
connectWith(target2, op) {
|
|
21531
|
+
const { rawConnection, connection } = this.connectConnection(target2);
|
|
21492
21532
|
return rawConnection.runUntil(() => op(connection.client));
|
|
21493
21533
|
}
|
|
21494
21534
|
/**
|
|
@@ -21529,22 +21569,22 @@ var AgentApp = class {
|
|
|
21529
21569
|
registerAppNotification(this.builder, spec, (params, cx, signal) => agentNotificationContext(params, AgentContext.create(cx), signal), handler);
|
|
21530
21570
|
return this;
|
|
21531
21571
|
}
|
|
21532
|
-
connectConnection(
|
|
21533
|
-
if (isStream(
|
|
21534
|
-
const state2 = this.openStreamConnection(
|
|
21572
|
+
connectConnection(target2, options = {}) {
|
|
21573
|
+
if (isStream(target2)) {
|
|
21574
|
+
const state2 = this.openStreamConnection(target2);
|
|
21535
21575
|
if (!options.deferConnectHandlers) {
|
|
21536
21576
|
this[runAgentConnectHandlers](state2.connection);
|
|
21537
21577
|
}
|
|
21538
21578
|
return state2;
|
|
21539
21579
|
}
|
|
21540
21580
|
const [thisStream, peerStream] = memoryStreamPair();
|
|
21541
|
-
const peerRawConnection =
|
|
21581
|
+
const peerRawConnection = target2[appBuilder]().connect(peerStream, stableConnectionOptions);
|
|
21542
21582
|
const peerConnection = clientConnection(peerRawConnection);
|
|
21543
21583
|
const state = this.openStreamConnection(thisStream);
|
|
21544
21584
|
void state.rawConnection.closed.then(() => peerConnection.close());
|
|
21545
21585
|
void peerRawConnection.closed.then(() => state.connection.close());
|
|
21546
21586
|
try {
|
|
21547
|
-
|
|
21587
|
+
target2[runClientConnectHandlers](peerConnection);
|
|
21548
21588
|
this[runAgentConnectHandlers](state.connection);
|
|
21549
21589
|
} catch (error51) {
|
|
21550
21590
|
peerConnection.close(error51);
|
|
@@ -21584,11 +21624,11 @@ var ClientApp = class {
|
|
|
21584
21624
|
[runClientConnectHandlers](connection) {
|
|
21585
21625
|
runConnectHandlers(connection, this.connectHandlers);
|
|
21586
21626
|
}
|
|
21587
|
-
connect(
|
|
21588
|
-
return this.connectConnection(
|
|
21627
|
+
connect(target2) {
|
|
21628
|
+
return this.connectConnection(target2).connection;
|
|
21589
21629
|
}
|
|
21590
|
-
connectWith(
|
|
21591
|
-
const { rawConnection, connection } = this.connectConnection(
|
|
21630
|
+
connectWith(target2, op) {
|
|
21631
|
+
const { rawConnection, connection } = this.connectConnection(target2);
|
|
21592
21632
|
return rawConnection.runUntil(() => op(connection.agent));
|
|
21593
21633
|
}
|
|
21594
21634
|
/**
|
|
@@ -21629,20 +21669,20 @@ var ClientApp = class {
|
|
|
21629
21669
|
registerAppNotification(this.builder, spec, (params, cx, signal) => clientNotificationContext(params, ClientContext.create(cx), signal), handler);
|
|
21630
21670
|
return this;
|
|
21631
21671
|
}
|
|
21632
|
-
connectConnection(
|
|
21633
|
-
if (isStream(
|
|
21634
|
-
const state2 = this.openStreamConnection(
|
|
21672
|
+
connectConnection(target2) {
|
|
21673
|
+
if (isStream(target2)) {
|
|
21674
|
+
const state2 = this.openStreamConnection(target2);
|
|
21635
21675
|
this[runClientConnectHandlers](state2.connection);
|
|
21636
21676
|
return state2;
|
|
21637
21677
|
}
|
|
21638
21678
|
const [thisStream, peerStream] = memoryStreamPair();
|
|
21639
|
-
const peerRawConnection =
|
|
21679
|
+
const peerRawConnection = target2[appBuilder]().connect(peerStream, stableConnectionOptions);
|
|
21640
21680
|
const peerConnection = agentConnection(peerRawConnection);
|
|
21641
21681
|
const state = this.openStreamConnection(thisStream);
|
|
21642
21682
|
void state.rawConnection.closed.then(() => peerConnection.close());
|
|
21643
21683
|
void peerRawConnection.closed.then(() => state.connection.close());
|
|
21644
21684
|
try {
|
|
21645
|
-
|
|
21685
|
+
target2[runAgentConnectHandlers](peerConnection);
|
|
21646
21686
|
this[runClientConnectHandlers](state.connection);
|
|
21647
21687
|
} catch (error51) {
|
|
21648
21688
|
peerConnection.close(error51);
|
|
@@ -23279,11 +23319,11 @@ function cursorSnapshot(sessionId, native, replay, nativeSubagentId) {
|
|
|
23279
23319
|
if (groups.length !== native.length)
|
|
23280
23320
|
throw new Error("Cursor replay/native turn count mismatch");
|
|
23281
23321
|
const turns = groups.map((group, index) => {
|
|
23282
|
-
const
|
|
23283
|
-
if (!
|
|
23322
|
+
const identity2 = native[index];
|
|
23323
|
+
if (!identity2 || identity2.text !== group.text)
|
|
23284
23324
|
throw new Error("Cursor replay/native prompt mismatch");
|
|
23285
23325
|
const items = [];
|
|
23286
|
-
const output = new CursorTurnOutput(hostTurnIdSchema.parse(
|
|
23326
|
+
const output = new CursorTurnOutput(hostTurnIdSchema.parse(identity2.id), (event) => {
|
|
23287
23327
|
if (event.type === "item.completed")
|
|
23288
23328
|
items.push(event.snapshot);
|
|
23289
23329
|
}, index);
|
|
@@ -23297,11 +23337,11 @@ function cursorSnapshot(sessionId, native, replay, nativeSubagentId) {
|
|
|
23297
23337
|
nativeTurnRef: nativeTurnRefSchema.parse({
|
|
23298
23338
|
harnessId: "cursor-cli",
|
|
23299
23339
|
nativeSessionId: sessionId,
|
|
23300
|
-
nativeTurnKey:
|
|
23340
|
+
nativeTurnKey: identity2.id,
|
|
23301
23341
|
formatVersion: 1
|
|
23302
23342
|
}),
|
|
23303
23343
|
input: [{ type: "text", text: group.text }],
|
|
23304
|
-
...cursorForkAvailable() && (index === native.length - 1 || native[index + 1]?.rewindRoot) ? { checkpoint: cursorCheckpoint(sessionId,
|
|
23344
|
+
...cursorForkAvailable() && (index === native.length - 1 || native[index + 1]?.rewindRoot) ? { checkpoint: cursorCheckpoint(sessionId, identity2.id) } : {},
|
|
23305
23345
|
items,
|
|
23306
23346
|
outcome: {
|
|
23307
23347
|
status: "unknown",
|
|
@@ -23585,13 +23625,13 @@ async function runCursorForkTerminal(options, sessionId, signal, rewind) {
|
|
|
23585
23625
|
|
|
23586
23626
|
// dist/fork.js
|
|
23587
23627
|
var retryableBackupCodes = /* @__PURE__ */ new Set([0, 5, 6]);
|
|
23588
|
-
async function backupStore(source,
|
|
23628
|
+
async function backupStore(source, target2) {
|
|
23589
23629
|
for (let attempt = 1; ; attempt++) {
|
|
23590
23630
|
const db = new DatabaseSync2(source, { readOnly: true });
|
|
23591
23631
|
const wake = setInterval(() => {
|
|
23592
23632
|
}, 10);
|
|
23593
23633
|
try {
|
|
23594
|
-
await backup(db,
|
|
23634
|
+
await backup(db, target2);
|
|
23595
23635
|
return;
|
|
23596
23636
|
} catch (error51) {
|
|
23597
23637
|
const code = error51 && typeof error51 === "object" && "errcode" in error51 ? error51.errcode : -1;
|
|
@@ -23601,13 +23641,13 @@ async function backupStore(source, target) {
|
|
|
23601
23641
|
clearInterval(wake);
|
|
23602
23642
|
db.close();
|
|
23603
23643
|
}
|
|
23604
|
-
await rm2(
|
|
23644
|
+
await rm2(target2, { force: true });
|
|
23605
23645
|
await new Promise((resolve) => setTimeout(resolve, 50 * attempt));
|
|
23606
23646
|
}
|
|
23607
23647
|
}
|
|
23608
|
-
async function copySnapshot(source,
|
|
23609
|
-
await backupStore(path8.join(source, "store.db"), path8.join(
|
|
23610
|
-
await copyFile(path8.join(source, "meta.json"), path8.join(
|
|
23648
|
+
async function copySnapshot(source, target2) {
|
|
23649
|
+
await backupStore(path8.join(source, "store.db"), path8.join(target2, "store.db"));
|
|
23650
|
+
await copyFile(path8.join(source, "meta.json"), path8.join(target2, "meta.json"));
|
|
23611
23651
|
}
|
|
23612
23652
|
function storeIdentity(directory, hashBlobs = true) {
|
|
23613
23653
|
const db = new DatabaseSync2(path8.join(directory, "store.db"), { readOnly: true });
|
|
@@ -23650,11 +23690,11 @@ async function forkCursorSession(source, checkpoint, options, signal, forkOption
|
|
|
23650
23690
|
signal.throwIfAborted();
|
|
23651
23691
|
const sourceDirectory = cursorSessionDirectory(source.nativeSessionId, options.environment);
|
|
23652
23692
|
const temporary = await mkdtemp2(path8.join(os3.tmpdir(), "codexhost-cursor-fork-"));
|
|
23653
|
-
let
|
|
23693
|
+
let target2;
|
|
23654
23694
|
let committed = false;
|
|
23655
23695
|
const discard = async () => {
|
|
23656
|
-
if (
|
|
23657
|
-
await rm2(
|
|
23696
|
+
if (target2 && !committed)
|
|
23697
|
+
await rm2(target2, { recursive: true, force: true });
|
|
23658
23698
|
};
|
|
23659
23699
|
try {
|
|
23660
23700
|
const snapshotConfig = path8.join(temporary, "snapshot");
|
|
@@ -23725,8 +23765,8 @@ async function forkCursorSession(source, checkpoint, options, signal, forkOption
|
|
|
23725
23765
|
if (!sourceUnchanged())
|
|
23726
23766
|
throw new Error("Cursor source changed during fork");
|
|
23727
23767
|
await mkdir(destination);
|
|
23728
|
-
|
|
23729
|
-
await copySnapshot(nativeFork,
|
|
23768
|
+
target2 = destination;
|
|
23769
|
+
await copySnapshot(nativeFork, target2);
|
|
23730
23770
|
if (!sameTurns(readCursorNativeTurns(sessionId, options.cwd, options.environment), expected))
|
|
23731
23771
|
throw new Error("Cursor fork history does not match source");
|
|
23732
23772
|
return {
|
|
@@ -24970,15 +25010,15 @@ async function startBrokerLaunchAgent(harnessId, environment) {
|
|
|
24970
25010
|
const uid = process.getuid?.();
|
|
24971
25011
|
if (uid === void 0)
|
|
24972
25012
|
return;
|
|
24973
|
-
const
|
|
24974
|
-
if (await runLaunchctl(["kickstart",
|
|
25013
|
+
const target2 = `gui/${uid}/${harnessBrokerLaunchAgentLabel(harnessId)}`;
|
|
25014
|
+
if (await runLaunchctl(["kickstart", target2]))
|
|
24975
25015
|
return;
|
|
24976
25016
|
await runLaunchctl([
|
|
24977
25017
|
"bootstrap",
|
|
24978
25018
|
`gui/${uid}`,
|
|
24979
25019
|
harnessBrokerLaunchAgentPlistPath(environment, harnessId)
|
|
24980
25020
|
]);
|
|
24981
|
-
await runLaunchctl(["kickstart",
|
|
25021
|
+
await runLaunchctl(["kickstart", target2]);
|
|
24982
25022
|
}
|
|
24983
25023
|
var BrokerConnection = class _BrokerConnection {
|
|
24984
25024
|
#onClose;
|