@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,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
(() => {
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __export = (
|
|
4
|
+
var __export = (target2, all) => {
|
|
5
5
|
for (var name in all)
|
|
6
|
-
__defProp(
|
|
6
|
+
__defProp(target2, name, { get: all[name], enumerable: true });
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
// src/agent-selection-state.ts
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
function defaultIdFactory(sequence) {
|
|
12
12
|
return `codexhost-composer-${Date.now().toString(36)}-${sequence.toString(36)}`;
|
|
13
13
|
}
|
|
14
|
-
function isDefaultTarget(
|
|
15
|
-
return
|
|
14
|
+
function isDefaultTarget(target2) {
|
|
15
|
+
return target2?.[0] === "default";
|
|
16
16
|
}
|
|
17
|
-
function isConversationTarget(
|
|
18
|
-
return
|
|
17
|
+
function isConversationTarget(target2) {
|
|
18
|
+
return target2?.[0] === "conversation";
|
|
19
19
|
}
|
|
20
|
-
function isIdentifiedTarget(
|
|
21
|
-
return
|
|
20
|
+
function isIdentifiedTarget(target2) {
|
|
21
|
+
return target2?.[0] === "conversation" || target2?.[0] === "default" && typeof target2[1] === "string" && target2[1].startsWith("client-new-thread:");
|
|
22
22
|
}
|
|
23
23
|
function sameTarget(left, right) {
|
|
24
24
|
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
@@ -56,15 +56,15 @@
|
|
|
56
56
|
if (state && !preservePendingSubmission) this.#pendingSubmissions.delete(state);
|
|
57
57
|
this.#states.delete(composer);
|
|
58
58
|
}
|
|
59
|
-
mount(composer,
|
|
60
|
-
const bound = this.#targetState(
|
|
59
|
+
mount(composer, target2, preferredNewThreadAgent) {
|
|
60
|
+
const bound = this.#targetState(target2);
|
|
61
61
|
if (bound) {
|
|
62
62
|
this.#states.set(composer, bound);
|
|
63
63
|
return bound;
|
|
64
64
|
}
|
|
65
65
|
const preferredAgent = preferredNewThreadAgent ?? this.#lastSubmittedAgent;
|
|
66
|
-
const state = this.#state(composer, isDefaultTarget(
|
|
67
|
-
if (isIdentifiedTarget(
|
|
66
|
+
const state = this.#state(composer, isDefaultTarget(target2) ? preferredAgent : "codex");
|
|
67
|
+
if (isIdentifiedTarget(target2)) this.#targetStates.push({ target: target2, state });
|
|
68
68
|
return state;
|
|
69
69
|
}
|
|
70
70
|
isSwitching(composer) {
|
|
@@ -90,20 +90,20 @@
|
|
|
90
90
|
isCurrentOwnershipRequest(composer, generation) {
|
|
91
91
|
return (this.#ownershipRequestGenerations.get(this.#state(composer)) ?? 0) === generation;
|
|
92
92
|
}
|
|
93
|
-
rebindConversation(composer,
|
|
94
|
-
if (!isConversationTarget(
|
|
93
|
+
rebindConversation(composer, target2) {
|
|
94
|
+
if (!isConversationTarget(target2)) return null;
|
|
95
95
|
const previous = this.#state(composer);
|
|
96
96
|
this.#pendingSubmissions.delete(previous);
|
|
97
97
|
this.#modelRequestGenerations.set(previous, ++this.#modelRequestSequence);
|
|
98
98
|
this.#ownershipRequestGenerations.set(previous, ++this.#ownershipRequestSequence);
|
|
99
|
-
let state = this.#targetState(
|
|
99
|
+
let state = this.#targetState(target2);
|
|
100
100
|
if (!state) {
|
|
101
101
|
state = {
|
|
102
102
|
agent: "codex",
|
|
103
103
|
phase: "draft",
|
|
104
104
|
composerId: this.#idFactory(++this.#composerSequence)
|
|
105
105
|
};
|
|
106
|
-
this.#targetStates.push({ target, state });
|
|
106
|
+
this.#targetStates.push({ target: target2, state });
|
|
107
107
|
}
|
|
108
108
|
this.#states.set(composer, state);
|
|
109
109
|
this.#modelRequestGenerations.set(state, ++this.#modelRequestSequence);
|
|
@@ -184,17 +184,17 @@
|
|
|
184
184
|
if (state.phase === "draft") this.#lastSubmittedAgent = state.agent;
|
|
185
185
|
return state;
|
|
186
186
|
}
|
|
187
|
-
transfer(source, replacement,
|
|
187
|
+
transfer(source, replacement, target2 = null) {
|
|
188
188
|
const state = this.#states.get(source);
|
|
189
189
|
if (!state) return false;
|
|
190
|
-
const bound = this.#targetState(
|
|
190
|
+
const bound = this.#targetState(target2);
|
|
191
191
|
if (bound && bound !== state) return false;
|
|
192
192
|
if (source !== replacement) {
|
|
193
193
|
if (this.#states.has(replacement)) return false;
|
|
194
194
|
this.#states.set(replacement, state);
|
|
195
195
|
}
|
|
196
|
-
if (isIdentifiedTarget(
|
|
197
|
-
if (isConversationTarget(
|
|
196
|
+
if (isIdentifiedTarget(target2) && !bound) this.#targetStates.push({ target: target2, state });
|
|
197
|
+
if (isConversationTarget(target2) && this.#pendingSubmissions.delete(state))
|
|
198
198
|
state.phase = "locked";
|
|
199
199
|
return true;
|
|
200
200
|
}
|
|
@@ -220,9 +220,9 @@
|
|
|
220
220
|
this.#switching.delete(state);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
|
-
#targetState(
|
|
224
|
-
if (!isIdentifiedTarget(
|
|
225
|
-
return this.#targetStates.find((candidate) => sameTarget(candidate.target,
|
|
223
|
+
#targetState(target2) {
|
|
224
|
+
if (!isIdentifiedTarget(target2)) return null;
|
|
225
|
+
return this.#targetStates.find((candidate) => sameTarget(candidate.target, target2))?.state ?? null;
|
|
226
226
|
}
|
|
227
227
|
#state(composer, initialAgent) {
|
|
228
228
|
const existing = this.#states.get(composer);
|
|
@@ -984,8 +984,8 @@
|
|
|
984
984
|
function objectClone(obj) {
|
|
985
985
|
return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
|
|
986
986
|
}
|
|
987
|
-
function assignProp(
|
|
988
|
-
Object.defineProperty(
|
|
987
|
+
function assignProp(target2, prop, value) {
|
|
988
|
+
Object.defineProperty(target2, prop, {
|
|
989
989
|
value,
|
|
990
990
|
writable: true,
|
|
991
991
|
enumerable: true,
|
|
@@ -1168,35 +1168,35 @@
|
|
|
1168
1168
|
return params;
|
|
1169
1169
|
}
|
|
1170
1170
|
function createTransparentProxy(getter) {
|
|
1171
|
-
let
|
|
1171
|
+
let target2;
|
|
1172
1172
|
return new Proxy({}, {
|
|
1173
1173
|
get(_, prop, receiver) {
|
|
1174
|
-
|
|
1175
|
-
return Reflect.get(
|
|
1174
|
+
target2 ?? (target2 = getter());
|
|
1175
|
+
return Reflect.get(target2, prop, receiver);
|
|
1176
1176
|
},
|
|
1177
1177
|
set(_, prop, value, receiver) {
|
|
1178
|
-
|
|
1179
|
-
return Reflect.set(
|
|
1178
|
+
target2 ?? (target2 = getter());
|
|
1179
|
+
return Reflect.set(target2, prop, value, receiver);
|
|
1180
1180
|
},
|
|
1181
1181
|
has(_, prop) {
|
|
1182
|
-
|
|
1183
|
-
return Reflect.has(
|
|
1182
|
+
target2 ?? (target2 = getter());
|
|
1183
|
+
return Reflect.has(target2, prop);
|
|
1184
1184
|
},
|
|
1185
1185
|
deleteProperty(_, prop) {
|
|
1186
|
-
|
|
1187
|
-
return Reflect.deleteProperty(
|
|
1186
|
+
target2 ?? (target2 = getter());
|
|
1187
|
+
return Reflect.deleteProperty(target2, prop);
|
|
1188
1188
|
},
|
|
1189
1189
|
ownKeys(_) {
|
|
1190
|
-
|
|
1191
|
-
return Reflect.ownKeys(
|
|
1190
|
+
target2 ?? (target2 = getter());
|
|
1191
|
+
return Reflect.ownKeys(target2);
|
|
1192
1192
|
},
|
|
1193
1193
|
getOwnPropertyDescriptor(_, prop) {
|
|
1194
|
-
|
|
1195
|
-
return Reflect.getOwnPropertyDescriptor(
|
|
1194
|
+
target2 ?? (target2 = getter());
|
|
1195
|
+
return Reflect.getOwnPropertyDescriptor(target2, prop);
|
|
1196
1196
|
},
|
|
1197
1197
|
defineProperty(_, prop, descriptor) {
|
|
1198
|
-
|
|
1199
|
-
return Reflect.defineProperty(
|
|
1198
|
+
target2 ?? (target2 = getter());
|
|
1199
|
+
return Reflect.defineProperty(target2, prop, descriptor);
|
|
1200
1200
|
}
|
|
1201
1201
|
});
|
|
1202
1202
|
}
|
|
@@ -11648,15 +11648,15 @@
|
|
|
11648
11648
|
|
|
11649
11649
|
// ../../node_modules/zod/v4/core/to-json-schema.js
|
|
11650
11650
|
function initializeContext(params) {
|
|
11651
|
-
let
|
|
11652
|
-
if (
|
|
11653
|
-
|
|
11654
|
-
if (
|
|
11655
|
-
|
|
11651
|
+
let target2 = params?.target ?? "draft-2020-12";
|
|
11652
|
+
if (target2 === "draft-4")
|
|
11653
|
+
target2 = "draft-04";
|
|
11654
|
+
if (target2 === "draft-7")
|
|
11655
|
+
target2 = "draft-07";
|
|
11656
11656
|
return {
|
|
11657
11657
|
processors: params.processors ?? {},
|
|
11658
11658
|
metadataRegistry: params?.metadata ?? globalRegistry,
|
|
11659
|
-
target,
|
|
11659
|
+
target: target2,
|
|
11660
11660
|
unrepresentable: params?.unrepresentable ?? "throw",
|
|
11661
11661
|
override: params?.override ?? (() => {
|
|
11662
11662
|
}),
|
|
@@ -11998,8 +11998,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
11998
11998
|
return finalize(ctx, schema);
|
|
11999
11999
|
};
|
|
12000
12000
|
var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
|
|
12001
|
-
const { libraryOptions, target } = params ?? {};
|
|
12002
|
-
const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
|
|
12001
|
+
const { libraryOptions, target: target2 } = params ?? {};
|
|
12002
|
+
const ctx = initializeContext({ ...libraryOptions ?? {}, target: target2, io, processors });
|
|
12003
12003
|
process(schema, ctx);
|
|
12004
12004
|
extractDefs(ctx, schema);
|
|
12005
12005
|
return finalize(ctx, schema);
|
|
@@ -13058,8 +13058,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
13058
13058
|
catch(params) {
|
|
13059
13059
|
return _catch2(this, params);
|
|
13060
13060
|
},
|
|
13061
|
-
pipe(
|
|
13062
|
-
return pipe(this,
|
|
13061
|
+
pipe(target2) {
|
|
13062
|
+
return pipe(this, target2);
|
|
13063
13063
|
},
|
|
13064
13064
|
readonly() {
|
|
13065
13065
|
return readonly(this);
|
|
@@ -15319,15 +15319,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15319
15319
|
threads: external_exports.array(threadOwnershipSchema).min(1).max(THREAD_OWNERSHIP_LIST_MAX_LENGTH)
|
|
15320
15320
|
}).strict().superRefine(({ threads }, context2) => {
|
|
15321
15321
|
const seen = /* @__PURE__ */ new Set();
|
|
15322
|
-
for (const [index,
|
|
15323
|
-
if (seen.has(
|
|
15322
|
+
for (const [index, thread2] of threads.entries()) {
|
|
15323
|
+
if (seen.has(thread2.threadId)) {
|
|
15324
15324
|
context2.addIssue({
|
|
15325
15325
|
code: "custom",
|
|
15326
15326
|
message: "Thread ownership-list results must be unique",
|
|
15327
15327
|
path: ["threads", index, "threadId"]
|
|
15328
15328
|
});
|
|
15329
15329
|
}
|
|
15330
|
-
seen.add(
|
|
15330
|
+
seen.add(thread2.threadId);
|
|
15331
15331
|
}
|
|
15332
15332
|
});
|
|
15333
15333
|
var threadSteeringInspectParamsSchema = external_exports.object({
|
|
@@ -16787,6 +16787,44 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16787
16787
|
}).strict();
|
|
16788
16788
|
var remoteSshSetupResultSchema = external_exports.object({ state: external_exports.enum(["installed", "not-installed"]) }).strict();
|
|
16789
16789
|
|
|
16790
|
+
// ../shared-contracts/dist/remote-sessions.js
|
|
16791
|
+
var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
|
|
16792
|
+
var identity = external_exports.string().min(1).max(1024);
|
|
16793
|
+
var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
16794
|
+
var thread = { ...target, threadId: identity };
|
|
16795
|
+
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16796
|
+
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16797
|
+
external_exports.strictObject({
|
|
16798
|
+
kind: external_exports.literal("list"),
|
|
16799
|
+
...target,
|
|
16800
|
+
cursor: external_exports.string().nullable(),
|
|
16801
|
+
archived: external_exports.boolean()
|
|
16802
|
+
}),
|
|
16803
|
+
external_exports.strictObject({ kind: external_exports.literal("read"), ...thread }),
|
|
16804
|
+
external_exports.strictObject({
|
|
16805
|
+
kind: external_exports.literal("prompt"),
|
|
16806
|
+
...thread,
|
|
16807
|
+
epoch: identity,
|
|
16808
|
+
text: external_exports.string().min(1).max(8e3),
|
|
16809
|
+
requestId: identity.optional()
|
|
16810
|
+
}),
|
|
16811
|
+
external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
|
|
16812
|
+
external_exports.strictObject({
|
|
16813
|
+
kind: external_exports.literal("rename"),
|
|
16814
|
+
...thread,
|
|
16815
|
+
epoch: identity,
|
|
16816
|
+
name: external_exports.string().min(1).max(512)
|
|
16817
|
+
}),
|
|
16818
|
+
external_exports.strictObject({ kind: external_exports.literal("archive"), ...thread, epoch: identity, archived: external_exports.boolean() }),
|
|
16819
|
+
external_exports.strictObject({
|
|
16820
|
+
kind: external_exports.literal("respond"),
|
|
16821
|
+
...thread,
|
|
16822
|
+
epoch: identity,
|
|
16823
|
+
requestId: external_exports.union([identity, external_exports.number().int()]),
|
|
16824
|
+
result: external_exports.record(external_exports.string(), external_exports.unknown())
|
|
16825
|
+
})
|
|
16826
|
+
]);
|
|
16827
|
+
|
|
16790
16828
|
// ../shared-contracts/dist/remote-connections.js
|
|
16791
16829
|
var hostId = external_exports.string().min(1).max(1024);
|
|
16792
16830
|
var codexSshConnectionSchema = external_exports.object({
|
|
@@ -16807,7 +16845,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16807
16845
|
identity: external_exports.string().max(4096).nullable()
|
|
16808
16846
|
});
|
|
16809
16847
|
var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
16848
|
+
external_exports.strictObject({ action: external_exports.literal("session"), operation: remoteSessionOperationSchema }),
|
|
16810
16849
|
external_exports.strictObject({ action: external_exports.literal("list") }),
|
|
16850
|
+
external_exports.strictObject({ action: external_exports.literal("catalog") }),
|
|
16811
16851
|
external_exports.strictObject({
|
|
16812
16852
|
action: external_exports.literal("read-thread"),
|
|
16813
16853
|
hostId: hostId.refine((id) => id !== "local"),
|
|
@@ -17383,6 +17423,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17383
17423
|
}
|
|
17384
17424
|
return {
|
|
17385
17425
|
list,
|
|
17426
|
+
async catalog() {
|
|
17427
|
+
const result = await request("refresh-remote-connections", {});
|
|
17428
|
+
if (!record4(result) || !Array.isArray(result.remoteConnections))
|
|
17429
|
+
throw new Error("Native remote catalog unavailable");
|
|
17430
|
+
return result.remoteConnections.flatMap(
|
|
17431
|
+
(item) => record4(item) && typeof item.hostId === "string" && /^remote-(?:ssh(?:-|:)|control:)/u.test(item.hostId) && typeof item.displayName === "string" ? [
|
|
17432
|
+
{
|
|
17433
|
+
hostId: item.hostId,
|
|
17434
|
+
displayName: item.displayName,
|
|
17435
|
+
autoConnect: item.autoConnect === true
|
|
17436
|
+
}
|
|
17437
|
+
] : []
|
|
17438
|
+
);
|
|
17439
|
+
},
|
|
17386
17440
|
save: (draft, previous, signal) => mutate(previous, draft, signal),
|
|
17387
17441
|
remove: (previous, signal) => mutate(previous, null, signal),
|
|
17388
17442
|
async connect(hostId2, enabled, signal) {
|
|
@@ -18023,9 +18077,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18023
18077
|
const MAX_VISITED_FIBERS = 2e5;
|
|
18024
18078
|
const fiber = (value2) => typeof value2 === "object" && value2 !== null ? value2 : null;
|
|
18025
18079
|
const exhausted = () => {
|
|
18026
|
-
const
|
|
18027
|
-
if (typeof
|
|
18028
|
-
|
|
18080
|
+
const target2 = globalThis;
|
|
18081
|
+
if (typeof target2.dispatchEvent === "function" && typeof CustomEvent === "function")
|
|
18082
|
+
target2.dispatchEvent(new CustomEvent("codexhost:react-fiber-walk-limit", {
|
|
18029
18083
|
detail: { limit: MAX_VISITED_FIBERS }
|
|
18030
18084
|
}));
|
|
18031
18085
|
return [];
|
|
@@ -18544,10 +18598,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18544
18598
|
assertCurrent();
|
|
18545
18599
|
if (!record6(result) || result.status !== "created" || !createdId || !record6(result.firstTurn) || result.firstTurn.status !== "not-requested")
|
|
18546
18600
|
throw new Error("Chat creation was not confirmed. Check the chat list before creating another task.");
|
|
18547
|
-
const { thread, empty } = await readEmpty(createdId);
|
|
18601
|
+
const { thread: thread2, empty } = await readEmpty(createdId);
|
|
18548
18602
|
const inspection = threadInspectionSchema.parse(await request("codexhost/thread/inspect", { threadId: createdId }));
|
|
18549
18603
|
assertCurrent();
|
|
18550
|
-
if (!empty ||
|
|
18604
|
+
if (!empty || thread2.cwd !== input.workspace.cwd || inspection.owner !== "external" || inspection.transportModelId !== input.model)
|
|
18551
18605
|
throw new Error("The created chat's workspace, Model or empty state could not be confirmed");
|
|
18552
18606
|
return {
|
|
18553
18607
|
threadId: createdId,
|
|
@@ -18732,11 +18786,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18732
18786
|
async function handleRemoteConnectionsRequest(control, input) {
|
|
18733
18787
|
const request = remoteConnectionsRequestSchema.parse(input);
|
|
18734
18788
|
switch (request.action) {
|
|
18789
|
+
case "session":
|
|
18790
|
+
throw new Error("Remote sessions require the Desktop Controller route");
|
|
18735
18791
|
case "read-thread":
|
|
18736
18792
|
if (!control.readThread) throw new Error("Remote Thread reading is unavailable");
|
|
18737
18793
|
return control.readThread(request.hostId, request.input);
|
|
18738
18794
|
case "list":
|
|
18739
18795
|
return control.ssh.list();
|
|
18796
|
+
case "catalog":
|
|
18797
|
+
return control.ssh.catalog?.() ?? control.ssh.list();
|
|
18740
18798
|
case "save":
|
|
18741
18799
|
await control.ssh.save(request.draft, request.previous);
|
|
18742
18800
|
return null;
|
|
@@ -20010,20 +20068,20 @@ ${error51.stderrTail}`] : []
|
|
|
20010
20068
|
row.dataset.connectionSelected = String(selected);
|
|
20011
20069
|
row.tabIndex = selected ? 0 : -1;
|
|
20012
20070
|
row.setAttribute("role", "row");
|
|
20013
|
-
const
|
|
20014
|
-
|
|
20015
|
-
|
|
20071
|
+
const identity3 = document2.createElement("div");
|
|
20072
|
+
identity3.className = "settings-connection-row__identity";
|
|
20073
|
+
identity3.setAttribute("role", "cell");
|
|
20016
20074
|
if (group) {
|
|
20017
20075
|
const handle = document2.createElement("span");
|
|
20018
20076
|
handle.className = "settings-connection-row__handle";
|
|
20019
20077
|
handle.setAttribute("aria-hidden", "true");
|
|
20020
20078
|
handle.title = group.dragHandleTitle;
|
|
20021
20079
|
handle.append(createRendererSettingsIcon("grip-vertical", 15));
|
|
20022
|
-
|
|
20080
|
+
identity3.append(handle);
|
|
20023
20081
|
}
|
|
20024
20082
|
const label = document2.createElement("strong");
|
|
20025
20083
|
label.textContent = item.name;
|
|
20026
|
-
|
|
20084
|
+
identity3.append(createConnectionIdentityIcon(document2, item, 19), label);
|
|
20027
20085
|
const status = document2.createElement("span");
|
|
20028
20086
|
status.className = "settings-connection-row__status";
|
|
20029
20087
|
status.dataset.connectionTone = connectionStatusTone(item.availability, item.error !== null);
|
|
@@ -20101,8 +20159,8 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
20101
20159
|
action.append(toggle);
|
|
20102
20160
|
}
|
|
20103
20161
|
row.addEventListener("click", (event) => {
|
|
20104
|
-
const
|
|
20105
|
-
if (
|
|
20162
|
+
const target2 = event.target;
|
|
20163
|
+
if (target2?.closest?.("a")) return;
|
|
20106
20164
|
select();
|
|
20107
20165
|
});
|
|
20108
20166
|
row.addEventListener("keydown", (event) => {
|
|
@@ -20120,17 +20178,17 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
20120
20178
|
row.addEventListener("drop", group.onDrop);
|
|
20121
20179
|
row.addEventListener("dragend", group.onDragEnd);
|
|
20122
20180
|
}
|
|
20123
|
-
row.append(
|
|
20181
|
+
row.append(identity3, status, action);
|
|
20124
20182
|
return row;
|
|
20125
20183
|
}
|
|
20126
20184
|
function createInspectorHeader(document2, item, messages) {
|
|
20127
20185
|
const header = document2.createElement("header");
|
|
20128
20186
|
header.className = "settings-connection-inspector__header";
|
|
20129
|
-
const
|
|
20130
|
-
|
|
20187
|
+
const identity3 = document2.createElement("div");
|
|
20188
|
+
identity3.className = "settings-connection-inspector__identity";
|
|
20131
20189
|
const title = document2.createElement("strong");
|
|
20132
20190
|
title.textContent = item.name;
|
|
20133
|
-
|
|
20191
|
+
identity3.append(createConnectionIdentityIcon(document2, item, 20), title);
|
|
20134
20192
|
const websiteUrl = item.agentSnapshot?.plugin?.links?.website ?? item.agentSnapshot?.plugin?.links?.documentation;
|
|
20135
20193
|
if (websiteUrl) {
|
|
20136
20194
|
const website = document2.createElement("a");
|
|
@@ -20142,13 +20200,13 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
20142
20200
|
website.setAttribute("aria-label", `${messages.connectionOfficialWebsite}: ${item.name}`);
|
|
20143
20201
|
website.append(createRendererSettingsIcon("external-link", 13));
|
|
20144
20202
|
website.addEventListener("click", (event) => event.stopPropagation());
|
|
20145
|
-
|
|
20203
|
+
identity3.append(website);
|
|
20146
20204
|
}
|
|
20147
20205
|
const status = document2.createElement("span");
|
|
20148
20206
|
status.className = "settings-connection-row__status";
|
|
20149
20207
|
status.dataset.connectionTone = connectionStatusTone(item.availability, item.error !== null);
|
|
20150
20208
|
status.textContent = item.error?.code === "authenticationRequired" ? messages.connectionLoginRequired : item.error?.code === "configurationRequired" ? messages.connectionConfigurationRequired : item.agentSnapshot && item.availability === "ready" && !item.error ? messages.connectionStatusConnected : connectionStatusLabel(item.availability, messages, item.error !== null);
|
|
20151
|
-
header.append(
|
|
20209
|
+
header.append(identity3, status);
|
|
20152
20210
|
return header;
|
|
20153
20211
|
}
|
|
20154
20212
|
function renderConnectionInspector(document2, inspector, item, hostId2, messages, diagnostics, existingLaunchControls, refresh) {
|
|
@@ -21629,8 +21687,8 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
21629
21687
|
...menu.querySelectorAll('[role="menuitemradio"], [role="menuitem"]')
|
|
21630
21688
|
].filter((button2) => !button2.disabled && !button2.closest("[hidden]"));
|
|
21631
21689
|
const selected = available.find((button2) => button2.getAttribute("aria-checked") === "true");
|
|
21632
|
-
const
|
|
21633
|
-
|
|
21690
|
+
const target2 = position === "last" ? available.at(-1) : position === "selected" ? selected : available[0];
|
|
21691
|
+
target2?.focus();
|
|
21634
21692
|
};
|
|
21635
21693
|
const open = (focus = "selected") => {
|
|
21636
21694
|
if (trigger.disabled || popoverOpen(menu)) return;
|
|
@@ -21910,8 +21968,8 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
21910
21968
|
}
|
|
21911
21969
|
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(event.key)) return;
|
|
21912
21970
|
event.preventDefault();
|
|
21913
|
-
const
|
|
21914
|
-
|
|
21971
|
+
const target2 = event.key === "Home" ? buttons[0] : event.key === "End" ? buttons.at(-1) : event.key === "ArrowDown" ? buttons[(index + 1 + buttons.length) % buttons.length] : buttons[(index - 1 + buttons.length) % buttons.length];
|
|
21972
|
+
target2?.focus();
|
|
21915
21973
|
};
|
|
21916
21974
|
const onToggle = () => {
|
|
21917
21975
|
trigger.setAttribute("aria-expanded", String(popoverOpen(menu)));
|
|
@@ -23613,16 +23671,16 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
23613
23671
|
trigger.setAttribute("data-state", openState || popoverOpen2(menu) ? "open" : "closed");
|
|
23614
23672
|
};
|
|
23615
23673
|
const onRootClick = (event) => {
|
|
23616
|
-
const
|
|
23617
|
-
if (
|
|
23674
|
+
const target2 = event.target instanceof Element ? event.target.closest("button") : null;
|
|
23675
|
+
if (target2?.dataset.openModelMenu) {
|
|
23618
23676
|
openModelMenu();
|
|
23619
23677
|
control.searchInput.focus();
|
|
23620
23678
|
return;
|
|
23621
23679
|
}
|
|
23622
|
-
if (
|
|
23680
|
+
if (target2?.dataset.thinkingOptionId) {
|
|
23623
23681
|
close();
|
|
23624
23682
|
trigger.focus();
|
|
23625
|
-
onSelectThinking(
|
|
23683
|
+
onSelectThinking(target2.dataset.thinkingOptionId);
|
|
23626
23684
|
}
|
|
23627
23685
|
};
|
|
23628
23686
|
const onModelMenuClick = (event) => {
|
|
@@ -23652,17 +23710,17 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
23652
23710
|
modelMenu.scrollTop = 0;
|
|
23653
23711
|
return;
|
|
23654
23712
|
}
|
|
23655
|
-
const
|
|
23656
|
-
if (!
|
|
23713
|
+
const target2 = event.target instanceof Element ? event.target.closest("button[data-model-id]") : null;
|
|
23714
|
+
if (!target2?.dataset.modelId) return;
|
|
23657
23715
|
close();
|
|
23658
23716
|
trigger.focus();
|
|
23659
|
-
onSelectModel(
|
|
23717
|
+
onSelectModel(target2.dataset.modelId);
|
|
23660
23718
|
};
|
|
23661
23719
|
const onModelHover = () => openModelMenu();
|
|
23662
23720
|
const onDocumentPointerDown = (event) => {
|
|
23663
23721
|
if (!popoverOpen2(menu) && !popoverOpen2(modelMenu)) return;
|
|
23664
|
-
const
|
|
23665
|
-
if (
|
|
23722
|
+
const target2 = event.target instanceof Node ? event.target : null;
|
|
23723
|
+
if (target2 && (root.contains(target2) || menu.contains(target2) || modelMenu.contains(target2))) {
|
|
23666
23724
|
return;
|
|
23667
23725
|
}
|
|
23668
23726
|
close();
|
|
@@ -24084,8 +24142,8 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
24084
24142
|
const focusOption = (position) => {
|
|
24085
24143
|
const available = [...options.values()].map(({ button: button2 }) => button2).filter((button2) => !button2.disabled);
|
|
24086
24144
|
const selected = available.find((button2) => button2.getAttribute("aria-checked") === "true");
|
|
24087
|
-
const
|
|
24088
|
-
|
|
24145
|
+
const target2 = position === "last" ? available.at(-1) : position === "selected" ? selected : available[0];
|
|
24146
|
+
target2?.focus();
|
|
24089
24147
|
};
|
|
24090
24148
|
const open = (focus = "selected") => {
|
|
24091
24149
|
if (trigger.disabled || popoverOpen3(menu)) return;
|
|
@@ -24128,8 +24186,8 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
24128
24186
|
}
|
|
24129
24187
|
if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(event.key)) return;
|
|
24130
24188
|
event.preventDefault();
|
|
24131
|
-
const
|
|
24132
|
-
|
|
24189
|
+
const target2 = event.key === "Home" ? buttons[0] : event.key === "End" ? buttons.at(-1) : event.key === "ArrowDown" ? buttons[(index + 1 + buttons.length) % buttons.length] : buttons[(index - 1 + buttons.length) % buttons.length];
|
|
24190
|
+
target2?.focus();
|
|
24133
24191
|
};
|
|
24134
24192
|
const onToggle = () => {
|
|
24135
24193
|
const openState = popoverOpen3(menu);
|
|
@@ -24894,9 +24952,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
24894
24952
|
// src/renderer-composer-dom.ts
|
|
24895
24953
|
var CODEX_COMPOSER_SELECTOR = "[data-codex-composer-root]";
|
|
24896
24954
|
var EDITOR_SELECTOR = 'textarea, [contenteditable="true"], [role="textbox"]';
|
|
24897
|
-
function eventElement(
|
|
24898
|
-
if (
|
|
24899
|
-
return
|
|
24955
|
+
function eventElement(target2) {
|
|
24956
|
+
if (target2 instanceof Element) return target2;
|
|
24957
|
+
return target2 instanceof Node ? target2.parentElement : null;
|
|
24900
24958
|
}
|
|
24901
24959
|
function controlDescription(element) {
|
|
24902
24960
|
const typed = element;
|
|
@@ -25646,9 +25704,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
25646
25704
|
const trace = (value, prefix) => new Proxy(
|
|
25647
25705
|
{ ...value },
|
|
25648
25706
|
{
|
|
25649
|
-
get(
|
|
25707
|
+
get(target2, property, receiver) {
|
|
25650
25708
|
if (typeof property === "string") read.add(`${prefix}.${property}`);
|
|
25651
|
-
return Reflect.get(
|
|
25709
|
+
return Reflect.get(target2, property, receiver);
|
|
25652
25710
|
}
|
|
25653
25711
|
}
|
|
25654
25712
|
);
|
|
@@ -25743,12 +25801,12 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
25743
25801
|
return found;
|
|
25744
25802
|
}
|
|
25745
25803
|
function project2(kind, { fiber, subscriber, store, atom, instance, subscribeEffect }) {
|
|
25746
|
-
for (const [
|
|
25804
|
+
for (const [target2, key] of [
|
|
25747
25805
|
[store, "sub"],
|
|
25748
25806
|
[subscriber, "getSnapshot"],
|
|
25749
25807
|
[instance, "getSnapshot"]
|
|
25750
25808
|
]) {
|
|
25751
|
-
if (Object.getOwnPropertyDescriptor(
|
|
25809
|
+
if (Object.getOwnPropertyDescriptor(target2, key)?.writable !== true) {
|
|
25752
25810
|
throw new Error("Codex usage gate is not writable");
|
|
25753
25811
|
}
|
|
25754
25812
|
}
|
|
@@ -26022,8 +26080,8 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26022
26080
|
}
|
|
26023
26081
|
async function verifyNativeCodexThread(sendRequest, threadId) {
|
|
26024
26082
|
const native = await sendRequest("thread/read", { threadId, includeTurns: false });
|
|
26025
|
-
const
|
|
26026
|
-
if (!isRecord4(
|
|
26083
|
+
const thread2 = isRecord4(native) ? native.thread : null;
|
|
26084
|
+
if (!isRecord4(thread2) || thread2.id !== threadId || typeof thread2.modelProvider !== "string" || !thread2.modelProvider || thread2.modelProvider === "codexhost" || typeof thread2.cliVersion !== "string" || !thread2.cliVersion || thread2.cliVersion === "codexhost") {
|
|
26027
26085
|
throw new Error("Native Thread response cannot establish Codex ownership");
|
|
26028
26086
|
}
|
|
26029
26087
|
}
|
|
@@ -26332,7 +26390,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26332
26390
|
const params = threadOwnershipListParamsSchema.parse(input);
|
|
26333
26391
|
const value = await manager.sendRequest(THREAD_OWNERSHIP_LIST_METHOD, params);
|
|
26334
26392
|
const result = threadOwnershipListResultSchema.parse(value);
|
|
26335
|
-
if (result.threads.length !== params.threadIds.length || result.threads.some((
|
|
26393
|
+
if (result.threads.length !== params.threadIds.length || result.threads.some((thread2, index) => thread2.threadId !== params.threadIds[index])) {
|
|
26336
26394
|
throw new Error("Thread ownership-list result does not match the requested IDs");
|
|
26337
26395
|
}
|
|
26338
26396
|
return result;
|
|
@@ -26485,9 +26543,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26485
26543
|
function isRecord6(value) {
|
|
26486
26544
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
26487
26545
|
}
|
|
26488
|
-
function installRendererExternalQueue(
|
|
26489
|
-
if (!isRecord6(
|
|
26490
|
-
const coordinator =
|
|
26546
|
+
function installRendererExternalQueue(target2) {
|
|
26547
|
+
if (!isRecord6(target2) || typeof target2.getTurnCoordinator !== "function") return null;
|
|
26548
|
+
const coordinator = target2.getTurnCoordinator();
|
|
26491
26549
|
const queue = isRecord6(coordinator) ? coordinator.serverQueue : null;
|
|
26492
26550
|
if (!isRecord6(queue) || typeof queue.isEnabled !== "function") return null;
|
|
26493
26551
|
return () => void 0;
|
|
@@ -26512,7 +26570,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26512
26570
|
return "official";
|
|
26513
26571
|
}
|
|
26514
26572
|
const result = threadOwnershipListResultSchema.parse(response);
|
|
26515
|
-
const owner = result.threads.find((
|
|
26573
|
+
const owner = result.threads.find((thread2) => thread2.threadId === threadId)?.owner;
|
|
26516
26574
|
if (!owner) throw new Error("Thread ownership could not be resolved for steering");
|
|
26517
26575
|
return owner === "codex" ? "official" : "newTurn";
|
|
26518
26576
|
}
|
|
@@ -26594,9 +26652,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26594
26652
|
});
|
|
26595
26653
|
};
|
|
26596
26654
|
}
|
|
26597
|
-
function installRendererExternalSteering(
|
|
26598
|
-
if (!isManager(
|
|
26599
|
-
const manager =
|
|
26655
|
+
function installRendererExternalSteering(target2, sendTurnStart, prepareTurnInput) {
|
|
26656
|
+
if (!isManager(target2)) return null;
|
|
26657
|
+
const manager = target2;
|
|
26600
26658
|
const originalSteer = manager.steerTurn;
|
|
26601
26659
|
const originalSend = manager.sendRequest;
|
|
26602
26660
|
const routes = /* @__PURE__ */ new Map();
|
|
@@ -26835,16 +26893,16 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26835
26893
|
for (let index = 0; index < decoded.length; index += 1) bytes[index] = decoded.charCodeAt(index);
|
|
26836
26894
|
return { contents: new Blob([bytes], { type: mimeType }), extension };
|
|
26837
26895
|
}
|
|
26838
|
-
function createRemoteAttachmentSender(
|
|
26896
|
+
function createRemoteAttachmentSender(target2, hostId2, isCurrent) {
|
|
26839
26897
|
const prepared = /* @__PURE__ */ new WeakMap();
|
|
26840
26898
|
return (params, send) => {
|
|
26841
|
-
if (hostId2 === "local" || !isRecord8(
|
|
26899
|
+
if (hostId2 === "local" || !isRecord8(target2) || !isRecord8(params) || typeof params.threadId !== "string" || !Array.isArray(params.input) || typeof target2.getConversation !== "function")
|
|
26842
26900
|
return send(params);
|
|
26843
26901
|
const images = params.input.filter(
|
|
26844
26902
|
(item) => isRecord8(item) && (item.type === "image" || item.type === "localImage")
|
|
26845
26903
|
);
|
|
26846
26904
|
if (images.length === 0) return send(params);
|
|
26847
|
-
const conversation =
|
|
26905
|
+
const conversation = target2.getConversation.call(target2, params.threadId);
|
|
26848
26906
|
if (!isRecord8(conversation) || conversation.id !== params.threadId || conversation.modelProvider !== "codexhost")
|
|
26849
26907
|
return send(params);
|
|
26850
26908
|
const assertCurrent = () => {
|
|
@@ -26874,7 +26932,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26874
26932
|
if (totalBytes > MAX_TOTAL_BYTES) throw new Error("Remote image attachments exceed 32 MiB");
|
|
26875
26933
|
return file2;
|
|
26876
26934
|
});
|
|
26877
|
-
if (files.some((file2) => "contents" in file2) && typeof
|
|
26935
|
+
if (files.some((file2) => "contents" in file2) && typeof target2.createFileAttachment !== "function") {
|
|
26878
26936
|
throw new Error("Desktop remote attachment storage is unavailable");
|
|
26879
26937
|
}
|
|
26880
26938
|
const created = [];
|
|
@@ -26886,7 +26944,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26886
26944
|
paths.push(file2.path);
|
|
26887
26945
|
continue;
|
|
26888
26946
|
}
|
|
26889
|
-
const saved = await
|
|
26947
|
+
const saved = await target2.createFileAttachment.call(target2, {
|
|
26890
26948
|
contents: file2.contents,
|
|
26891
26949
|
label: `image-${index + 1}.${file2.extension}`
|
|
26892
26950
|
});
|
|
@@ -26919,11 +26977,11 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
26919
26977
|
]
|
|
26920
26978
|
};
|
|
26921
26979
|
} catch (error51) {
|
|
26922
|
-
if (isCurrent() && typeof
|
|
26980
|
+
if (isCurrent() && typeof target2.removePastedTextAttachment === "function") {
|
|
26923
26981
|
await Promise.allSettled(
|
|
26924
26982
|
created.map(
|
|
26925
26983
|
(path) => Promise.resolve().then(
|
|
26926
|
-
() =>
|
|
26984
|
+
() => target2.removePastedTextAttachment.call(target2, path)
|
|
26927
26985
|
)
|
|
26928
26986
|
)
|
|
26929
26987
|
);
|
|
@@ -27062,13 +27120,13 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27062
27120
|
function isRecord9(value) {
|
|
27063
27121
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
27064
27122
|
}
|
|
27065
|
-
function installRendererManualCompaction(
|
|
27066
|
-
if (!messages || typeof messages.addEventListener !== "function" || typeof messages.removeEventListener !== "function" || !isRecord9(
|
|
27123
|
+
function installRendererManualCompaction(target2, hostId2, messages) {
|
|
27124
|
+
if (!messages || typeof messages.addEventListener !== "function" || typeof messages.removeEventListener !== "function" || !isRecord9(target2) || typeof target2.registerPendingManualContextCompaction !== "function" || typeof target2.getConversation !== "function") {
|
|
27067
27125
|
return null;
|
|
27068
27126
|
}
|
|
27069
|
-
const register =
|
|
27070
|
-
const getConversation =
|
|
27071
|
-
const getStreamRole = typeof
|
|
27127
|
+
const register = target2.registerPendingManualContextCompaction;
|
|
27128
|
+
const getConversation = target2.getConversation;
|
|
27129
|
+
const getStreamRole = typeof target2.getStreamRole === "function" ? target2.getStreamRole : null;
|
|
27072
27130
|
const listener = (event) => {
|
|
27073
27131
|
if (event.source != null && event.source !== messages) return;
|
|
27074
27132
|
const message2 = event.data;
|
|
@@ -27078,13 +27136,13 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27078
27136
|
const params = threadManualCompactionStartedSchema.safeParse(message2.params);
|
|
27079
27137
|
if (!params.success) return;
|
|
27080
27138
|
const { threadId } = params.data;
|
|
27081
|
-
const conversation = getConversation.call(
|
|
27139
|
+
const conversation = getConversation.call(target2, threadId);
|
|
27082
27140
|
if (!isRecord9(conversation) || conversation.id !== threadId || conversation.modelProvider !== "codexhost") {
|
|
27083
27141
|
return;
|
|
27084
27142
|
}
|
|
27085
|
-
const role = getStreamRole?.call(
|
|
27143
|
+
const role = getStreamRole?.call(target2, threadId);
|
|
27086
27144
|
if (isRecord9(role) && role.role === "follower") return;
|
|
27087
|
-
register.call(
|
|
27145
|
+
register.call(target2, threadId);
|
|
27088
27146
|
};
|
|
27089
27147
|
messages.addEventListener("message", listener);
|
|
27090
27148
|
return () => {
|
|
@@ -27111,7 +27169,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27111
27169
|
const cached2 = entries.get(route.hostId);
|
|
27112
27170
|
if (cached2?.route === route) return cached2.client;
|
|
27113
27171
|
retire(route.hostId);
|
|
27114
|
-
const
|
|
27172
|
+
const target2 = route.manager;
|
|
27115
27173
|
const cleanups = /* @__PURE__ */ new Set();
|
|
27116
27174
|
const nativeClient = createRendererModelClient([
|
|
27117
27175
|
{
|
|
@@ -27119,11 +27177,11 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27119
27177
|
if (disposed || readRouting()?.forHost(route.hostId) !== route) {
|
|
27120
27178
|
throw new Error(`Renderer request manager is unavailable for Host ${route.hostId}`);
|
|
27121
27179
|
}
|
|
27122
|
-
return options === void 0 ?
|
|
27180
|
+
return options === void 0 ? target2.sendRequest(method, params) : target2.sendRequest(method, params, options);
|
|
27123
27181
|
},
|
|
27124
|
-
...
|
|
27182
|
+
...target2.addNotificationCallback ? {
|
|
27125
27183
|
addNotificationCallback(methods, listener) {
|
|
27126
|
-
const unsubscribe =
|
|
27184
|
+
const unsubscribe = target2.addNotificationCallback?.(methods, listener);
|
|
27127
27185
|
if (!messages || !(typeof methods === "string" ? [methods] : methods).some(
|
|
27128
27186
|
(method) => [
|
|
27129
27187
|
THREAD_USAGE_UPDATED_METHOD,
|
|
@@ -27162,28 +27220,28 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27162
27220
|
if (!nativeClient) return null;
|
|
27163
27221
|
const client = restoreThreadReferenceCapability(
|
|
27164
27222
|
nativeClient,
|
|
27165
|
-
|
|
27223
|
+
target2,
|
|
27166
27224
|
() => !disposed && readRouting()?.forHost(route.hostId) === route,
|
|
27167
27225
|
messages
|
|
27168
27226
|
);
|
|
27169
27227
|
entries.set(route.hostId, { route, client, cleanups });
|
|
27170
27228
|
try {
|
|
27171
27229
|
for (const install2 of [
|
|
27172
|
-
() => installRendererExternalQueue(
|
|
27230
|
+
() => installRendererExternalQueue(target2),
|
|
27173
27231
|
() => installRendererExternalSteering(
|
|
27174
|
-
|
|
27232
|
+
target2,
|
|
27175
27233
|
createRemoteAttachmentSender(
|
|
27176
|
-
|
|
27234
|
+
target2,
|
|
27177
27235
|
route.hostId,
|
|
27178
27236
|
() => !disposed && readRouting()?.forHost(route.hostId) === route
|
|
27179
27237
|
),
|
|
27180
27238
|
createThreadReferenceContext(
|
|
27181
|
-
|
|
27239
|
+
target2,
|
|
27182
27240
|
route.hostId,
|
|
27183
27241
|
() => !disposed && readRouting()?.forHost(route.hostId) === route
|
|
27184
27242
|
)
|
|
27185
27243
|
),
|
|
27186
|
-
() => installRendererManualCompaction(
|
|
27244
|
+
() => installRendererManualCompaction(target2, route.hostId, messages)
|
|
27187
27245
|
]) {
|
|
27188
27246
|
const cleanup = install2();
|
|
27189
27247
|
if (cleanup) cleanups.add(cleanup);
|
|
@@ -27416,11 +27474,11 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27416
27474
|
changed.add(this.#row(element));
|
|
27417
27475
|
};
|
|
27418
27476
|
for (const mutation of mutations) {
|
|
27419
|
-
const
|
|
27420
|
-
const row =
|
|
27477
|
+
const target2 = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
|
|
27478
|
+
const row = target2?.closest(SIDEBAR_AGENT_ICON_ROW_SELECTOR);
|
|
27421
27479
|
if (row) changed.add(this.#row(row));
|
|
27422
|
-
else if (
|
|
27423
|
-
changed.add(this.#row(
|
|
27480
|
+
else if (target2 && this.#rowsByElement.has(target2))
|
|
27481
|
+
changed.add(this.#row(target2));
|
|
27424
27482
|
for (const node of mutation.addedNodes) collect(node);
|
|
27425
27483
|
for (const node of mutation.removedNodes) collect(node);
|
|
27426
27484
|
}
|
|
@@ -27805,18 +27863,18 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27805
27863
|
const button2 = origin?.closest("button");
|
|
27806
27864
|
if (!button2) return;
|
|
27807
27865
|
if (this.#replayed.delete(button2)) return;
|
|
27808
|
-
const
|
|
27809
|
-
if (!
|
|
27866
|
+
const target2 = rendererForkTargetFromButton(button2);
|
|
27867
|
+
if (!target2 || !onFork(target2)) return;
|
|
27810
27868
|
event.preventDefault();
|
|
27811
27869
|
event.stopImmediatePropagation();
|
|
27812
27870
|
};
|
|
27813
27871
|
document.addEventListener("click", listener, true);
|
|
27814
27872
|
return () => document.removeEventListener("click", listener, true);
|
|
27815
27873
|
}
|
|
27816
|
-
replay(
|
|
27817
|
-
if (!(
|
|
27818
|
-
this.#replayed.add(
|
|
27819
|
-
|
|
27874
|
+
replay(target2) {
|
|
27875
|
+
if (!(target2.control instanceof HTMLButtonElement) || !target2.control.isConnected) return;
|
|
27876
|
+
this.#replayed.add(target2.control);
|
|
27877
|
+
target2.control.click();
|
|
27820
27878
|
}
|
|
27821
27879
|
openThread(threadId) {
|
|
27822
27880
|
return openRendererThread(threadId);
|
|
@@ -27826,22 +27884,22 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
27826
27884
|
const dom = options.dom ?? new BrowserRendererForkDom();
|
|
27827
27885
|
const pending2 = /* @__PURE__ */ new Set();
|
|
27828
27886
|
let disposed = false;
|
|
27829
|
-
const stop = dom.listen((
|
|
27887
|
+
const stop = dom.listen((target2) => {
|
|
27830
27888
|
if (disposed) return false;
|
|
27831
27889
|
const client = options.getClient();
|
|
27832
27890
|
if (!client) return false;
|
|
27833
|
-
const key = `${
|
|
27891
|
+
const key = `${target2.threadId}\0${target2.turnId}`;
|
|
27834
27892
|
if (pending2.has(key)) return true;
|
|
27835
27893
|
pending2.add(key);
|
|
27836
|
-
void client.inspectThread({ threadId:
|
|
27894
|
+
void client.inspectThread({ threadId: target2.threadId }).then(async (inspection) => {
|
|
27837
27895
|
if (disposed) return;
|
|
27838
|
-
if (inspection.owner === "codex" || !inspection.history.fork || !
|
|
27839
|
-
dom.replay(
|
|
27896
|
+
if (inspection.owner === "codex" || !inspection.history.fork || !target2.isProjectlessConversation) {
|
|
27897
|
+
dom.replay(target2);
|
|
27840
27898
|
return;
|
|
27841
27899
|
}
|
|
27842
27900
|
const result = await client.forkThread({
|
|
27843
|
-
threadId:
|
|
27844
|
-
lastTurnId:
|
|
27901
|
+
threadId: target2.threadId,
|
|
27902
|
+
lastTurnId: target2.turnId
|
|
27845
27903
|
});
|
|
27846
27904
|
if (!disposed) await dom.openThread(result.threadId);
|
|
27847
27905
|
}).catch((error51) => options.reportError?.(error51)).finally(() => pending2.delete(key));
|
|
@@ -28024,11 +28082,11 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28024
28082
|
...thinking?.success ? { thinkingOptionId: thinking.data } : {}
|
|
28025
28083
|
};
|
|
28026
28084
|
}
|
|
28027
|
-
function threadIdFromComposerModelTarget(
|
|
28028
|
-
if (
|
|
28085
|
+
function threadIdFromComposerModelTarget(target2) {
|
|
28086
|
+
if (target2?.[0] !== "conversation" || typeof target2[1] !== "string" || target2[1].trim().length === 0) {
|
|
28029
28087
|
return null;
|
|
28030
28088
|
}
|
|
28031
|
-
return hostThreadIdSchema.parse(
|
|
28089
|
+
return hostThreadIdSchema.parse(target2[1]);
|
|
28032
28090
|
}
|
|
28033
28091
|
function findComposerFiber(composer) {
|
|
28034
28092
|
const selector = '[data-codex-composer], [contenteditable="true"][role="textbox"]';
|
|
@@ -28132,15 +28190,15 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28132
28190
|
function isDraftPrewarmPolicyReady(value) {
|
|
28133
28191
|
return isRecord12(value) && value.state === "ready" && typeof value.hostId === "string" && value.hostId.length > 0 && typeof value.select === "function" && typeof value.clear === "function";
|
|
28134
28192
|
}
|
|
28135
|
-
async function waitForRendererDraftPrewarmPolicy(
|
|
28193
|
+
async function waitForRendererDraftPrewarmPolicy(target2, composer) {
|
|
28136
28194
|
const deadline = Date.now() + DRAFT_PREWARM_POLICY_WAIT_TIMEOUT_MS;
|
|
28137
28195
|
while (true) {
|
|
28138
|
-
const policy =
|
|
28196
|
+
const policy = target2.__codexhostHostRoutingV1?.forComposer(composer)?.policy;
|
|
28139
28197
|
if (isDraftPrewarmPolicyReady(policy)) return policy;
|
|
28140
28198
|
const remaining = deadline - Date.now();
|
|
28141
28199
|
if (remaining <= 0) throw new Error("Renderer draft prewarm policy is unavailable");
|
|
28142
28200
|
await new Promise((resolve) => {
|
|
28143
|
-
|
|
28201
|
+
target2.setTimeout(resolve, Math.min(DRAFT_PREWARM_POLICY_POLL_INTERVAL_MS, remaining));
|
|
28144
28202
|
});
|
|
28145
28203
|
}
|
|
28146
28204
|
}
|
|
@@ -28330,12 +28388,12 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28330
28388
|
const route = window.__codexhostHostRoutingV1?.forComposer(composer);
|
|
28331
28389
|
if (!route) return false;
|
|
28332
28390
|
try {
|
|
28333
|
-
const
|
|
28334
|
-
if (
|
|
28335
|
-
if (
|
|
28391
|
+
const target2 = composer ? findComposerModelTarget(composer) : null;
|
|
28392
|
+
if (target2?.[0] === "conversation") return true;
|
|
28393
|
+
if (target2?.[0] !== "default" || typeof target2[1] !== "string" || !composer)
|
|
28336
28394
|
return agent === "codex";
|
|
28337
|
-
const binding = findScopedDraftModelBinding(composer,
|
|
28338
|
-
const draftKey =
|
|
28395
|
+
const binding = findScopedDraftModelBinding(composer, target2[1]);
|
|
28396
|
+
const draftKey = target2[1];
|
|
28339
28397
|
if (!binding || !route.policy.scopedCreation)
|
|
28340
28398
|
return agent === "codex" && !draftModels.has(draftKey);
|
|
28341
28399
|
const previous = draftModels.model(draftKey);
|
|
@@ -28820,20 +28878,20 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28820
28878
|
unmeteredRequests: 0
|
|
28821
28879
|
};
|
|
28822
28880
|
}
|
|
28823
|
-
function addTotals(
|
|
28824
|
-
|
|
28825
|
-
|
|
28826
|
-
|
|
28827
|
-
|
|
28828
|
-
|
|
28829
|
-
|
|
28830
|
-
|
|
28831
|
-
|
|
28832
|
-
|
|
28833
|
-
|
|
28834
|
-
|
|
28835
|
-
|
|
28836
|
-
return
|
|
28881
|
+
function addTotals(target2, source) {
|
|
28882
|
+
target2.requests += source.requests;
|
|
28883
|
+
target2.inputTokens += source.inputTokens;
|
|
28884
|
+
target2.cachedInputTokens += source.cachedInputTokens;
|
|
28885
|
+
target2.cacheWriteInputTokens += source.cacheWriteInputTokens;
|
|
28886
|
+
target2.cacheKnownInputTokens += source.cacheKnownInputTokens;
|
|
28887
|
+
target2.cacheHitCachedInputTokens += source.cacheHitCachedInputTokens;
|
|
28888
|
+
target2.cacheHitInputTokens += source.cacheHitInputTokens;
|
|
28889
|
+
target2.outputTokens += source.outputTokens;
|
|
28890
|
+
target2.reasoningOutputTokens += source.reasoningOutputTokens;
|
|
28891
|
+
target2.costUsd += source.costUsd;
|
|
28892
|
+
target2.unpricedRequests += source.unpricedRequests;
|
|
28893
|
+
target2.unmeteredRequests += source.unmeteredRequests;
|
|
28894
|
+
return target2;
|
|
28837
28895
|
}
|
|
28838
28896
|
function inputWithoutCache(totals2) {
|
|
28839
28897
|
return totals2.inputTokens - totals2.cachedInputTokens - totals2.cacheWriteInputTokens;
|
|
@@ -31791,7 +31849,7 @@ ${detail}` : ""}`
|
|
|
31791
31849
|
card.setAttribute("aria-label", connection.displayName);
|
|
31792
31850
|
card.setAttribute("aria-busy", String(locked));
|
|
31793
31851
|
const head = remoteElement(document2, "div", "settings-remote-card__head");
|
|
31794
|
-
const
|
|
31852
|
+
const identity3 = remoteElement(document2, "div", "settings-remote-card__identity");
|
|
31795
31853
|
const titleLine = remoteElement(document2, "div", "settings-remote-card__title");
|
|
31796
31854
|
const [tone, stateLabel] = connectionState(row, t);
|
|
31797
31855
|
const state = remoteElement(document2, "span", "settings-remote-card__state", stateLabel);
|
|
@@ -31804,7 +31862,7 @@ ${detail}` : ""}`
|
|
|
31804
31862
|
addressLine.append(
|
|
31805
31863
|
remoteElement(document2, "span", "settings-status-badge", t("SSH \u914D\u7F6E", "SSH config"))
|
|
31806
31864
|
);
|
|
31807
|
-
|
|
31865
|
+
identity3.append(titleLine, addressLine);
|
|
31808
31866
|
const headActions = remoteElement(document2, "div", "settings-remote-card__actions");
|
|
31809
31867
|
if (row.installation !== "not-installed" && !row.probing) {
|
|
31810
31868
|
if (row.state === "error" && connection.autoConnect)
|
|
@@ -31827,7 +31885,7 @@ ${detail}` : ""}`
|
|
|
31827
31885
|
remove.append(createRendererSettingsIcon("trash", 15));
|
|
31828
31886
|
remove.addEventListener("click", () => onAction("remove"));
|
|
31829
31887
|
headActions.append(remove);
|
|
31830
|
-
head.append(
|
|
31888
|
+
head.append(identity3, headActions);
|
|
31831
31889
|
card.append(head);
|
|
31832
31890
|
if (row.stateError) {
|
|
31833
31891
|
const detail = remoteElement(
|
|
@@ -31879,15 +31937,15 @@ ${detail}` : ""}`
|
|
|
31879
31937
|
}
|
|
31880
31938
|
if (!remote) serviceActions.append(command("recheck", t("\u91CD\u65B0\u68C0\u6D4B", "Check again")));
|
|
31881
31939
|
}
|
|
31882
|
-
const
|
|
31940
|
+
const target2 = remote ? remoteMaintenanceTarget(local, remote) : null;
|
|
31883
31941
|
if (row.installation === "not-installed") {
|
|
31884
31942
|
const install2 = command("install", t("\u5B89\u88C5\u5E76\u8FDE\u63A5", "Install and connect"), true);
|
|
31885
31943
|
install2.disabled ||= !remoteInstallVersion(local);
|
|
31886
31944
|
serviceActions.append(install2);
|
|
31887
|
-
} else if (remote &&
|
|
31945
|
+
} else if (remote && target2 && !remoteBusy(remote)) {
|
|
31888
31946
|
const update = command(
|
|
31889
31947
|
"update",
|
|
31890
|
-
|
|
31948
|
+
target2 === remote.installedVersion ? t("\u91CD\u542F\u5E76\u8FDE\u63A5", "Restart and connect") : t("\u66F4\u65B0\u5230\u672C\u673A\u7248\u672C", "Match local version"),
|
|
31891
31949
|
true
|
|
31892
31950
|
);
|
|
31893
31951
|
serviceActions.append(update);
|
|
@@ -32121,13 +32179,13 @@ ${detail}` : ""}`
|
|
|
32121
32179
|
port.min = "1";
|
|
32122
32180
|
port.max = "65535";
|
|
32123
32181
|
port.step = "1";
|
|
32124
|
-
const
|
|
32182
|
+
const identity3 = field2(
|
|
32125
32183
|
t("\u79C1\u94A5\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09", "Identity file (optional)"),
|
|
32126
32184
|
previous?.identity ?? "",
|
|
32127
32185
|
"~/.ssh/id_ed25519"
|
|
32128
32186
|
);
|
|
32129
32187
|
if (previous?.source === "discovered") {
|
|
32130
|
-
hostname3.disabled = port.disabled =
|
|
32188
|
+
hostname3.disabled = port.disabled = identity3.disabled = true;
|
|
32131
32189
|
dialog.body.append(
|
|
32132
32190
|
remoteElement(
|
|
32133
32191
|
document2,
|
|
@@ -32147,7 +32205,7 @@ ${detail}` : ""}`
|
|
|
32147
32205
|
displayName: name.value,
|
|
32148
32206
|
hostname: hostname3.value,
|
|
32149
32207
|
sshPort: port.value ? Number(port.value) : null,
|
|
32150
|
-
identity:
|
|
32208
|
+
identity: identity3.value.trim() || null
|
|
32151
32209
|
})
|
|
32152
32210
|
);
|
|
32153
32211
|
});
|
|
@@ -32468,8 +32526,8 @@ ${detail}` : ""}`
|
|
|
32468
32526
|
});
|
|
32469
32527
|
}
|
|
32470
32528
|
function focusAction(card, action) {
|
|
32471
|
-
const
|
|
32472
|
-
|
|
32529
|
+
const target2 = card.querySelector(`[data-action="${action}"]:not(:disabled)`) ?? card.querySelector("button:not(:disabled)");
|
|
32530
|
+
target2?.focus();
|
|
32473
32531
|
}
|
|
32474
32532
|
async function probe(row) {
|
|
32475
32533
|
const { hostId: hostId2 } = row.connection;
|
|
@@ -32750,15 +32808,15 @@ ${detail}` : ""}`
|
|
|
32750
32808
|
});
|
|
32751
32809
|
break;
|
|
32752
32810
|
case "update": {
|
|
32753
|
-
const
|
|
32754
|
-
if (!
|
|
32755
|
-
const restart =
|
|
32811
|
+
const target2 = row.remote ? remoteMaintenanceTarget(local, row.remote) : null;
|
|
32812
|
+
if (!target2) break;
|
|
32813
|
+
const restart = target2 === row.remote?.installedVersion;
|
|
32756
32814
|
void act(
|
|
32757
32815
|
row,
|
|
32758
32816
|
action,
|
|
32759
32817
|
restart ? t("\u6B63\u5728\u91CD\u542F\u8FDC\u7A0B\u670D\u52A1\u2026", "Restarting remote service\u2026") : t("\u6B63\u5728\u63D0\u4EA4\u66F4\u65B0\u2026", "Starting update\u2026"),
|
|
32760
32818
|
async () => {
|
|
32761
|
-
await control.update(hostId2,
|
|
32819
|
+
await control.update(hostId2, target2);
|
|
32762
32820
|
await setConnected(true);
|
|
32763
32821
|
}
|
|
32764
32822
|
);
|
|
@@ -33428,15 +33486,15 @@ ${detail}` : ""}`
|
|
|
33428
33486
|
cwd.className = "settings-session-import-row__cwd";
|
|
33429
33487
|
cwd.textContent = candidate.cwd;
|
|
33430
33488
|
cwd.title = candidate.cwd;
|
|
33431
|
-
const
|
|
33432
|
-
|
|
33433
|
-
|
|
33434
|
-
|
|
33489
|
+
const identity3 = document2.createElement("span");
|
|
33490
|
+
identity3.textContent = `${messages.sessionImportSessionId}: ${shortSessionId(candidate.nativeSessionId)}`;
|
|
33491
|
+
identity3.title = candidate.nativeSessionId;
|
|
33492
|
+
identity3.setAttribute("aria-hidden", "true");
|
|
33435
33493
|
copy.append(
|
|
33436
33494
|
title,
|
|
33437
33495
|
metadata,
|
|
33438
33496
|
cwd,
|
|
33439
|
-
|
|
33497
|
+
identity3,
|
|
33440
33498
|
createAccessibleText(
|
|
33441
33499
|
document2,
|
|
33442
33500
|
`${messages.sessionImportSessionId}: ${candidate.nativeSessionId}`
|
|
@@ -34102,12 +34160,12 @@ ${detail}` : ""}`
|
|
|
34102
34160
|
let hideEmails = false;
|
|
34103
34161
|
const shown = (text) => accountDisplayText(text, hideEmails);
|
|
34104
34162
|
const targetButtons = /* @__PURE__ */ new Map();
|
|
34105
|
-
const importedRecords = () => snapshot.targets.find((
|
|
34163
|
+
const importedRecords = () => snapshot.targets.find((target2) => target2.harnessId === TARGET_HARNESS_ID)?.imports ?? [];
|
|
34106
34164
|
const sourceOf = (record14) => snapshot.sources.find((source) => source.id === record14.source.id);
|
|
34107
34165
|
const piTarget = () => snapshot.targets.find((candidate) => candidate.harnessId === TARGET_HARNESS_ID);
|
|
34108
34166
|
const compatibleSources = () => {
|
|
34109
|
-
const
|
|
34110
|
-
return
|
|
34167
|
+
const target2 = piTarget();
|
|
34168
|
+
return target2 ? snapshot.sources.filter((source) => target2.providers.includes(source.provider)) : [];
|
|
34111
34169
|
};
|
|
34112
34170
|
const section = document2.createElement("section");
|
|
34113
34171
|
section.className = "settings-pi-accounts";
|
|
@@ -34199,8 +34257,8 @@ ${detail}` : ""}`
|
|
|
34199
34257
|
row.setAttribute("aria-label", shown(record14.source.label));
|
|
34200
34258
|
const agent = record14.source.harnessId;
|
|
34201
34259
|
const mark = createMark(agent);
|
|
34202
|
-
const
|
|
34203
|
-
|
|
34260
|
+
const identity3 = document2.createElement("div");
|
|
34261
|
+
identity3.className = "settings-pi-accounts__identity";
|
|
34204
34262
|
const label = document2.createElement("strong");
|
|
34205
34263
|
label.className = "settings-account-email";
|
|
34206
34264
|
label.textContent = shown(record14.source.label);
|
|
@@ -34224,7 +34282,7 @@ ${detail}` : ""}`
|
|
|
34224
34282
|
}
|
|
34225
34283
|
meta3.append(part);
|
|
34226
34284
|
});
|
|
34227
|
-
|
|
34285
|
+
identity3.append(label, meta3);
|
|
34228
34286
|
const actions = document2.createElement("div");
|
|
34229
34287
|
actions.className = "settings-pi-accounts__actions";
|
|
34230
34288
|
const reimport = document2.createElement("button");
|
|
@@ -34246,7 +34304,7 @@ ${detail}` : ""}`
|
|
|
34246
34304
|
remove.addEventListener("click", () => openDialog("remove", { record: record14 }, `row:${record14.name}`));
|
|
34247
34305
|
if (source) actions.append(reimport);
|
|
34248
34306
|
actions.append(remove);
|
|
34249
|
-
row.append(mark,
|
|
34307
|
+
row.append(mark, identity3, actions);
|
|
34250
34308
|
rows.set(record14.name, row);
|
|
34251
34309
|
return row;
|
|
34252
34310
|
};
|
|
@@ -34260,8 +34318,8 @@ ${detail}` : ""}`
|
|
|
34260
34318
|
[shown(login.label ?? login.provider), agent && rendererAgentLabel(agent, pluginFor(agent))].filter(Boolean).join(" \xB7 ")
|
|
34261
34319
|
);
|
|
34262
34320
|
const mark = createMark(agent);
|
|
34263
|
-
const
|
|
34264
|
-
|
|
34321
|
+
const identity3 = document2.createElement("div");
|
|
34322
|
+
identity3.className = "settings-pi-accounts__identity";
|
|
34265
34323
|
const title = document2.createElement("strong");
|
|
34266
34324
|
title.className = "settings-account-email";
|
|
34267
34325
|
title.textContent = shown(login.label ?? login.provider);
|
|
@@ -34280,15 +34338,15 @@ ${detail}` : ""}`
|
|
|
34280
34338
|
}
|
|
34281
34339
|
meta3.append(part);
|
|
34282
34340
|
});
|
|
34283
|
-
|
|
34284
|
-
row.append(mark,
|
|
34341
|
+
identity3.append(title, meta3);
|
|
34342
|
+
row.append(mark, identity3);
|
|
34285
34343
|
return row;
|
|
34286
34344
|
};
|
|
34287
34345
|
const renderSection = () => {
|
|
34288
|
-
const
|
|
34289
|
-
section.hidden = !
|
|
34346
|
+
const target2 = piTarget();
|
|
34347
|
+
section.hidden = !target2;
|
|
34290
34348
|
const records = importedRecords();
|
|
34291
|
-
const others =
|
|
34349
|
+
const others = target2?.others ?? [];
|
|
34292
34350
|
sectionCount.textContent = String(records.length + others.length);
|
|
34293
34351
|
card.hidden = !sectionExpanded;
|
|
34294
34352
|
sectionImport.hidden = compatibleSources().length === 0;
|
|
@@ -34545,8 +34603,8 @@ ${detail}` : ""}`
|
|
|
34545
34603
|
modal.addEventListener("close", () => {
|
|
34546
34604
|
modal.remove();
|
|
34547
34605
|
dialog = void 0;
|
|
34548
|
-
const
|
|
34549
|
-
(
|
|
34606
|
+
const target2 = returnKey ? returnKey === SECTION_IMPORT_KEY ? sectionImport : targetButtons.get(returnKey) ?? rows.get(returnKey.replace(/^row:/, "")) : void 0;
|
|
34607
|
+
(target2?.isConnected ? target2 : section).focus();
|
|
34550
34608
|
});
|
|
34551
34609
|
show(initialMode);
|
|
34552
34610
|
root.append(modal);
|
|
@@ -34574,11 +34632,11 @@ ${detail}` : ""}`
|
|
|
34574
34632
|
const source = snapshot.sources.find(
|
|
34575
34633
|
(candidate) => candidate.harnessId === harnessId && candidate.label === accountLabel
|
|
34576
34634
|
);
|
|
34577
|
-
const
|
|
34635
|
+
const target2 = snapshot.targets.find(
|
|
34578
34636
|
(candidate) => candidate.harnessId === TARGET_HARNESS_ID && source && candidate.providers.includes(source.provider)
|
|
34579
34637
|
);
|
|
34580
|
-
if (!source || !
|
|
34581
|
-
const record14 =
|
|
34638
|
+
if (!source || !target2) return null;
|
|
34639
|
+
const record14 = target2.imports.find((candidate) => candidate.source.id === source.id);
|
|
34582
34640
|
const key = `${harnessId}:${accountLabel}:import`;
|
|
34583
34641
|
const button2 = document2.createElement("button");
|
|
34584
34642
|
button2.type = "button";
|
|
@@ -34980,11 +35038,11 @@ ${detail}` : ""}`
|
|
|
34980
35038
|
const key = active.getAttribute("data-account-focus");
|
|
34981
35039
|
const accountId = active.closest(".settings-account-row")?.dataset.accountId;
|
|
34982
35040
|
return () => {
|
|
34983
|
-
const
|
|
34984
|
-
if (
|
|
34985
|
-
const dialog =
|
|
35041
|
+
const target2 = key ? list.querySelector(`[data-account-focus="${CSS.escape(key)}"]`) : null;
|
|
35042
|
+
if (target2 && !target2.matches(":disabled")) {
|
|
35043
|
+
const dialog = target2.closest("dialog");
|
|
34986
35044
|
if (dialog && !dialog.open) dialog.showModal();
|
|
34987
|
-
|
|
35045
|
+
target2.focus({ preventScroll: true });
|
|
34988
35046
|
return;
|
|
34989
35047
|
}
|
|
34990
35048
|
const row = accountId ? list.querySelector(
|
|
@@ -35027,8 +35085,8 @@ ${detail}` : ""}`
|
|
|
35027
35085
|
function createAccountPerson(document2, messages, input) {
|
|
35028
35086
|
const person = document2.createElement("div");
|
|
35029
35087
|
person.className = "settings-account-row__person";
|
|
35030
|
-
const
|
|
35031
|
-
|
|
35088
|
+
const identity3 = document2.createElement("div");
|
|
35089
|
+
identity3.className = "settings-account-row__identity";
|
|
35032
35090
|
const title = document2.createElement("strong");
|
|
35033
35091
|
title.className = "settings-account-email";
|
|
35034
35092
|
title.textContent = input.name;
|
|
@@ -35060,9 +35118,9 @@ ${detail}` : ""}`
|
|
|
35060
35118
|
badge.title = messages.accountDefaultHint;
|
|
35061
35119
|
metadata.append(badge);
|
|
35062
35120
|
}
|
|
35063
|
-
|
|
35064
|
-
if (metadata.childElementCount)
|
|
35065
|
-
person.append(input.mark,
|
|
35121
|
+
identity3.append(title);
|
|
35122
|
+
if (metadata.childElementCount) identity3.append(metadata);
|
|
35123
|
+
person.append(input.mark, identity3);
|
|
35066
35124
|
return person;
|
|
35067
35125
|
}
|
|
35068
35126
|
function appendAccountExtras(cell, items) {
|
|
@@ -35761,14 +35819,14 @@ ${detail}` : ""}`
|
|
|
35761
35819
|
function isWindowsRenderer(window2) {
|
|
35762
35820
|
const navigator2 = window2?.navigator;
|
|
35763
35821
|
if (!navigator2) return false;
|
|
35764
|
-
const
|
|
35765
|
-
return /windows|win32|win64/iu.test(
|
|
35822
|
+
const identity3 = `${rendererUserAgentData(navigator2)?.platform ?? ""} ${navigator2.platform ?? ""} ${navigator2.userAgent}`;
|
|
35823
|
+
return /windows|win32|win64/iu.test(identity3);
|
|
35766
35824
|
}
|
|
35767
35825
|
function windowsInstallerDownloadUrl(window2, version2) {
|
|
35768
35826
|
const navigator2 = window2?.navigator;
|
|
35769
35827
|
const hints = navigator2 ? rendererUserAgentData(navigator2) : void 0;
|
|
35770
|
-
const
|
|
35771
|
-
const architecture = /arm64|aarch64|\barm\b/iu.test(
|
|
35828
|
+
const identity3 = `${hints?.architecture ?? ""} ${hints?.platform ?? ""} ${navigator2?.platform ?? ""} ${navigator2?.userAgent ?? ""}`;
|
|
35829
|
+
const architecture = /arm64|aarch64|\barm\b/iu.test(identity3) ? "arm64" : "x64";
|
|
35772
35830
|
return `https://github.com/BytePioneer-AI/codex-host/releases/download/v${version2}/codexhost-${version2}-windows-${architecture}.exe`;
|
|
35773
35831
|
}
|
|
35774
35832
|
function panelIconName(view) {
|
|
@@ -41437,11 +41495,11 @@ ${renderer_brand_mark_default}`;
|
|
|
41437
41495
|
ownerDocument.defaultView?.setTimeout(restoreFocus, 0);
|
|
41438
41496
|
};
|
|
41439
41497
|
const onNavigationClick = (event) => {
|
|
41440
|
-
const
|
|
41441
|
-
const pageId =
|
|
41498
|
+
const target2 = event.target instanceof Element ? event.target.closest("button[data-page-id]") : null;
|
|
41499
|
+
const pageId = target2?.dataset.pageId;
|
|
41442
41500
|
if (!pageId || pageId === navigationState.activePageId) return;
|
|
41443
41501
|
activatePage(pageId);
|
|
41444
|
-
|
|
41502
|
+
target2.focus();
|
|
41445
41503
|
};
|
|
41446
41504
|
const hide = (restoreFocus) => {
|
|
41447
41505
|
if (disposed || surface.hidden) return;
|
|
@@ -41732,7 +41790,7 @@ ${renderer_brand_mark_default}`;
|
|
|
41732
41790
|
}
|
|
41733
41791
|
return hook == null ? result : [];
|
|
41734
41792
|
}
|
|
41735
|
-
function
|
|
41793
|
+
function identity2(owner) {
|
|
41736
41794
|
const props = owner.memoizedProps;
|
|
41737
41795
|
if (!record11(props) || !record11(props.dataAttributes)) return null;
|
|
41738
41796
|
const { conversationId: threadId, hostId: hostId2, dataAttributes: attributes } = props;
|
|
@@ -41761,7 +41819,7 @@ ${renderer_brand_mark_default}`;
|
|
|
41761
41819
|
}
|
|
41762
41820
|
function repairSidebarThreadState(owner) {
|
|
41763
41821
|
if (!record11(owner)) return null;
|
|
41764
|
-
const key =
|
|
41822
|
+
const key = identity2(owner);
|
|
41765
41823
|
if (!key) return null;
|
|
41766
41824
|
const candidates = [];
|
|
41767
41825
|
try {
|
|
@@ -41781,12 +41839,12 @@ ${renderer_brand_mark_default}`;
|
|
|
41781
41839
|
const candidate = candidates[0];
|
|
41782
41840
|
if (candidates.length !== 1 || !candidate) return null;
|
|
41783
41841
|
const { atom, store, subscriber, instance, effect } = candidate;
|
|
41784
|
-
for (const [
|
|
41842
|
+
for (const [target2, name] of [
|
|
41785
41843
|
[store, "sub"],
|
|
41786
41844
|
[subscriber, "getSnapshot"],
|
|
41787
41845
|
[instance, "getSnapshot"]
|
|
41788
41846
|
]) {
|
|
41789
|
-
if (Object.getOwnPropertyDescriptor(
|
|
41847
|
+
if (Object.getOwnPropertyDescriptor(target2, name)?.writable !== true) return null;
|
|
41790
41848
|
}
|
|
41791
41849
|
const originalSub = store.sub;
|
|
41792
41850
|
let notify2;
|
|
@@ -41853,7 +41911,7 @@ ${renderer_brand_mark_default}`;
|
|
|
41853
41911
|
if (!fiber) break;
|
|
41854
41912
|
if (seen.has(fiber)) return /* @__PURE__ */ new Set();
|
|
41855
41913
|
seen.add(fiber);
|
|
41856
|
-
if (
|
|
41914
|
+
if (identity2(fiber)) owners.add(fiber);
|
|
41857
41915
|
if (fiber !== first && record11(fiber.sibling)) stack.push(fiber.sibling);
|
|
41858
41916
|
if (record11(fiber.child)) stack.push(fiber.child);
|
|
41859
41917
|
}
|
|
@@ -42047,13 +42105,13 @@ ${renderer_brand_mark_default}`;
|
|
|
42047
42105
|
function filterDelegationTargets(targets, query) {
|
|
42048
42106
|
const needle = query.trim().toLowerCase();
|
|
42049
42107
|
if (!needle) return [...targets];
|
|
42050
|
-
const scored = targets.flatMap((
|
|
42051
|
-
const label =
|
|
42052
|
-
const id =
|
|
42108
|
+
const scored = targets.flatMap((target2, index) => {
|
|
42109
|
+
const label = target2.label.toLowerCase();
|
|
42110
|
+
const id = target2.agent.toLowerCase();
|
|
42053
42111
|
const score = label.startsWith(needle) || id.startsWith(needle) ? 2 : label.includes(needle) || id.includes(needle) ? 1 : 0;
|
|
42054
|
-
return score > 0 ? [{ target, score, index }] : [];
|
|
42112
|
+
return score > 0 ? [{ target: target2, score, index }] : [];
|
|
42055
42113
|
});
|
|
42056
|
-
return scored.sort((left, right) => right.score - left.score || left.index - right.index).map(({ target }) =>
|
|
42114
|
+
return scored.sort((left, right) => right.score - left.score || left.index - right.index).map(({ target: target2 }) => target2);
|
|
42057
42115
|
}
|
|
42058
42116
|
function filterDelegationCommands(commands, query) {
|
|
42059
42117
|
const needle = query.trim().toLowerCase().replace(/^\//u, "");
|
|
@@ -42250,13 +42308,13 @@ ${renderer_brand_mark_default}`;
|
|
|
42250
42308
|
entries = [];
|
|
42251
42309
|
if (targets.length > 0) {
|
|
42252
42310
|
rows.push(sectionHeader(agentsTitle(locale)));
|
|
42253
|
-
for (const
|
|
42311
|
+
for (const target2 of targets) {
|
|
42254
42312
|
rows.push(
|
|
42255
42313
|
optionRow(
|
|
42256
|
-
{ kind: "agent", target },
|
|
42314
|
+
{ kind: "agent", target: target2 },
|
|
42257
42315
|
rowContent(
|
|
42258
|
-
createRendererAgentIcon(
|
|
42259
|
-
|
|
42316
|
+
createRendererAgentIcon(target2.agent, 16, ownerDocument, target2.plugin),
|
|
42317
|
+
target2.label,
|
|
42260
42318
|
""
|
|
42261
42319
|
)
|
|
42262
42320
|
)
|
|
@@ -42369,17 +42427,17 @@ ${renderer_brand_mark_default}`;
|
|
|
42369
42427
|
await waitForSelectionSync();
|
|
42370
42428
|
return true;
|
|
42371
42429
|
};
|
|
42372
|
-
const insertAgent = async (trigger, range,
|
|
42373
|
-
const path = delegationMentionPath(
|
|
42430
|
+
const insertAgent = async (trigger, range, target2) => {
|
|
42431
|
+
const path = delegationMentionPath(target2.agent);
|
|
42374
42432
|
if (insertNativeAgentMention(trigger.editor, range, {
|
|
42375
|
-
name:
|
|
42376
|
-
displayName:
|
|
42433
|
+
name: target2.label,
|
|
42434
|
+
displayName: target2.label,
|
|
42377
42435
|
path
|
|
42378
42436
|
})) {
|
|
42379
42437
|
return;
|
|
42380
42438
|
}
|
|
42381
42439
|
if (!await selectTriggerText(trigger)) return;
|
|
42382
|
-
const carrier = `${formatDelegationMentionLink({ harnessId:
|
|
42440
|
+
const carrier = `${formatDelegationMentionLink({ harnessId: target2.agent, label: target2.label })} `;
|
|
42383
42441
|
const pasted = dispatchPlainTextPaste(trigger.editor, carrier);
|
|
42384
42442
|
if (!pasted) ownerDocument.execCommand("insertText", false, carrier);
|
|
42385
42443
|
};
|
|
@@ -43570,42 +43628,42 @@ ${renderer_brand_mark_default}`;
|
|
|
43570
43628
|
if (!isLateConversationTarget(mountedTarget, currentTarget)) return "none";
|
|
43571
43629
|
return mountedTarget?.[0] === "default" && (sourcePhase === "locked" || submissionPending) ? "transfer" : "inspect";
|
|
43572
43630
|
}
|
|
43573
|
-
function scopedComposerTarget(
|
|
43574
|
-
if (
|
|
43575
|
-
return ["conversation",
|
|
43631
|
+
function scopedComposerTarget(target2, hostId2) {
|
|
43632
|
+
if (target2?.[0] !== "conversation" || !hostId2) return target2;
|
|
43633
|
+
return ["conversation", target2[1], hostId2];
|
|
43576
43634
|
}
|
|
43577
|
-
function isComposerModelWriteAllowed(
|
|
43578
|
-
return
|
|
43635
|
+
function isComposerModelWriteAllowed(target2) {
|
|
43636
|
+
return target2?.[0] === "default";
|
|
43579
43637
|
}
|
|
43580
|
-
function applyComposerModelWrite(
|
|
43581
|
-
if (
|
|
43582
|
-
if (!isComposerModelWriteAllowed(
|
|
43638
|
+
function applyComposerModelWrite(target2, write) {
|
|
43639
|
+
if (target2?.[0] === "conversation") return true;
|
|
43640
|
+
if (!isComposerModelWriteAllowed(target2)) return false;
|
|
43583
43641
|
return write();
|
|
43584
43642
|
}
|
|
43585
43643
|
function mutationMayAffectComposer(mutation) {
|
|
43586
|
-
const
|
|
43587
|
-
if (!
|
|
43644
|
+
const target2 = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
|
|
43645
|
+
if (!target2) return true;
|
|
43588
43646
|
if (mutation.type === "attributes" && (mutation.attributeName === "data-codex-composer-root" || NATIVE_COMPOSER_REQUEST_ATTRIBUTES.some((attribute) => attribute === mutation.attributeName)))
|
|
43589
43647
|
return true;
|
|
43590
|
-
if (mutation.type !== "attributes" && editorForElement(
|
|
43648
|
+
if (mutation.type !== "attributes" && editorForElement(target2)) {
|
|
43591
43649
|
return mutation.type === "childList" && [...mutation.addedNodes, ...mutation.removedNodes].some(
|
|
43592
43650
|
(node) => node instanceof Element && hasNativeComposerRequest(node)
|
|
43593
43651
|
);
|
|
43594
43652
|
}
|
|
43595
|
-
if (
|
|
43653
|
+
if (target2.closest(CODEX_COMPOSER_SELECTOR)) return true;
|
|
43596
43654
|
if (mutation.type === "characterData") return false;
|
|
43597
|
-
if (!
|
|
43655
|
+
if (!target2.closest(
|
|
43598
43656
|
`${TRANSCRIPT_ITEM_SELECTOR}, [data-turn-key], [data-content-search-turn-key], [data-app-action-sidebar-scroll], [data-app-action-sidebar-section], ${SIDEBAR_THREAD_ROW_SELECTOR}`
|
|
43599
43657
|
))
|
|
43600
43658
|
return true;
|
|
43601
|
-
if (mutation.type === "attributes") return
|
|
43659
|
+
if (mutation.type === "attributes") return target2.querySelector(CODEX_COMPOSER_SELECTOR) !== null;
|
|
43602
43660
|
return mutation.type === "childList" && [...mutation.addedNodes, ...mutation.removedNodes].some(
|
|
43603
43661
|
(node) => node instanceof Element && (node.matches(CODEX_COMPOSER_SELECTOR) || node.querySelector(CODEX_COMPOSER_SELECTOR))
|
|
43604
43662
|
);
|
|
43605
43663
|
}
|
|
43606
43664
|
function mutationMayChangeComposerTarget(mutation) {
|
|
43607
|
-
const
|
|
43608
|
-
return !
|
|
43665
|
+
const target2 = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
|
|
43666
|
+
return !target2 || editorForElement(target2) === null;
|
|
43609
43667
|
}
|
|
43610
43668
|
function catalogWithConfigurationState(catalog, model2, state) {
|
|
43611
43669
|
if (!state.availableThinkingOptions) return catalog;
|
|
@@ -43653,7 +43711,7 @@ ${renderer_brand_mark_default}`;
|
|
|
43653
43711
|
const hostId2 = modelControl.currentHostId ? modelControl.currentHostId(composer) : "local";
|
|
43654
43712
|
return hostId2 === "durable" ? null : hostId2;
|
|
43655
43713
|
};
|
|
43656
|
-
const controllerTarget = (
|
|
43714
|
+
const controllerTarget = (target2, hostId2) => scopedComposerTarget(target2, hostId2);
|
|
43657
43715
|
const usageSubscriptions = /* @__PURE__ */ new Map();
|
|
43658
43716
|
const usageNotificationDispose = () => {
|
|
43659
43717
|
for (const subscription2 of usageSubscriptions.values()) subscription2.dispose();
|
|
@@ -43661,9 +43719,9 @@ ${renderer_brand_mark_default}`;
|
|
|
43661
43719
|
};
|
|
43662
43720
|
const localAgentForSidebarThread = (input) => {
|
|
43663
43721
|
for (const mounted of mountedByComposer.values()) {
|
|
43664
|
-
const
|
|
43665
|
-
const matchesDraft =
|
|
43666
|
-
const matchesConversation =
|
|
43722
|
+
const target2 = mounted.modelTarget;
|
|
43723
|
+
const matchesDraft = target2?.[0] === "default" && input.draftId !== null && target2[1] === input.draftId;
|
|
43724
|
+
const matchesConversation = target2?.[0] === "conversation" && input.threadId !== null && target2[1] === input.threadId && mounted.ownershipStatus === "ready";
|
|
43667
43725
|
if (!matchesDraft && !matchesConversation) continue;
|
|
43668
43726
|
const mountedHostId = activeModelHostId(mounted.composer);
|
|
43669
43727
|
if (input.hostId !== mountedHostId) return null;
|
|
@@ -45119,8 +45177,8 @@ ${renderer_brand_mark_default}`;
|
|
|
45119
45177
|
else void refreshDraftUsage(mounted);
|
|
45120
45178
|
continue;
|
|
45121
45179
|
}
|
|
45122
|
-
const
|
|
45123
|
-
if (controller.rebindConversation(mounted.composer,
|
|
45180
|
+
const target2 = controllerTarget(mounted.modelTarget, hostId2);
|
|
45181
|
+
if (controller.rebindConversation(mounted.composer, target2) === null) {
|
|
45124
45182
|
mounted.ownershipStatus = "error";
|
|
45125
45183
|
renderMounted(mounted);
|
|
45126
45184
|
continue;
|
|
@@ -45160,22 +45218,22 @@ ${renderer_brand_mark_default}`;
|
|
|
45160
45218
|
}
|
|
45161
45219
|
}
|
|
45162
45220
|
let connectionsChanged = false;
|
|
45163
|
-
for (const
|
|
45164
|
-
if (!
|
|
45165
|
-
const client = modelClientForHost(
|
|
45166
|
-
const previous = usageSubscriptions.get(
|
|
45221
|
+
for (const target2 of new Set([...mountedByComposer.values()].map((m) => m.hostId))) {
|
|
45222
|
+
if (!target2) continue;
|
|
45223
|
+
const client = modelClientForHost(target2);
|
|
45224
|
+
const previous = usageSubscriptions.get(target2);
|
|
45167
45225
|
if (previous?.client === client) continue;
|
|
45168
45226
|
connectionsChanged ||= previous !== void 0;
|
|
45169
45227
|
previous?.dispose();
|
|
45170
|
-
usageSubscriptions.delete(
|
|
45228
|
+
usageSubscriptions.delete(target2);
|
|
45171
45229
|
if (!client?.subscribeThreadUsage) continue;
|
|
45172
45230
|
try {
|
|
45173
45231
|
const dispose = client.subscribeThreadUsage((update) => {
|
|
45174
|
-
if (usageSubscriptions.get(
|
|
45175
|
-
if (modelClientForHost(
|
|
45176
|
-
applyThreadUsageUpdate(
|
|
45232
|
+
if (usageSubscriptions.get(target2)?.client !== client) return;
|
|
45233
|
+
if (modelClientForHost(target2) !== client) return;
|
|
45234
|
+
applyThreadUsageUpdate(target2, update);
|
|
45177
45235
|
});
|
|
45178
|
-
usageSubscriptions.set(
|
|
45236
|
+
usageSubscriptions.set(target2, { client, dispose });
|
|
45179
45237
|
connectionsChanged = true;
|
|
45180
45238
|
} catch {
|
|
45181
45239
|
}
|
|
@@ -45230,14 +45288,14 @@ ${renderer_brand_mark_default}`;
|
|
|
45230
45288
|
if (hostId2 === "durable") return Promise.resolve();
|
|
45231
45289
|
return refreshConnectionHosts(
|
|
45232
45290
|
[hostId2],
|
|
45233
|
-
(
|
|
45234
|
-
(
|
|
45291
|
+
(target2) => refreshHarnessAvailabilityForHost(target2, true, false, true),
|
|
45292
|
+
(target2) => hostHarnessAvailabilityState(target2).request?.promise
|
|
45235
45293
|
);
|
|
45236
45294
|
}
|
|
45237
45295
|
reconcileHarnessAvailabilityHost();
|
|
45238
45296
|
return refreshConnectionHosts(
|
|
45239
|
-
[...harnessAvailabilityByHost.keys()].filter((
|
|
45240
|
-
(
|
|
45297
|
+
[...harnessAvailabilityByHost.keys()].filter((target2) => target2 !== "durable"),
|
|
45298
|
+
(target2) => refreshHarnessAvailabilityForHost(target2, true, false, true)
|
|
45241
45299
|
);
|
|
45242
45300
|
},
|
|
45243
45301
|
async installation(hostId2, agent, action) {
|
|
@@ -45408,21 +45466,21 @@ ${renderer_brand_mark_default}`;
|
|
|
45408
45466
|
if (disposed) return;
|
|
45409
45467
|
settingsLifecycle.refresh();
|
|
45410
45468
|
const transferredComposers = /* @__PURE__ */ new Set();
|
|
45411
|
-
for (const [
|
|
45469
|
+
for (const [target2, replacement] of pendingReplacements) {
|
|
45412
45470
|
const sourceState = controller.get(replacement.source.composer);
|
|
45413
|
-
const replacementTarget = findComposerModelTarget(
|
|
45414
|
-
const replacementHostId = activeModelHostId(
|
|
45415
|
-
if (hasNativeComposerRequest(
|
|
45471
|
+
const replacementTarget = findComposerModelTarget(target2);
|
|
45472
|
+
const replacementHostId = activeModelHostId(target2);
|
|
45473
|
+
if (hasNativeComposerRequest(target2) || orbitComposerKind(target2) !== "codex" || !shouldTransferComposerState(
|
|
45416
45474
|
replacement.sourceModelTarget,
|
|
45417
45475
|
replacementTarget,
|
|
45418
45476
|
sourceState.phase,
|
|
45419
45477
|
controller.isSubmissionPending(replacement.source.composer)
|
|
45420
45478
|
) || !controller.transfer(
|
|
45421
45479
|
replacement.source.composer,
|
|
45422
|
-
|
|
45480
|
+
target2,
|
|
45423
45481
|
controllerTarget(replacementTarget, replacementHostId)
|
|
45424
45482
|
)) {
|
|
45425
|
-
pendingReplacements.delete(
|
|
45483
|
+
pendingReplacements.delete(target2);
|
|
45426
45484
|
} else {
|
|
45427
45485
|
transferredComposers.add(replacement.source.composer);
|
|
45428
45486
|
}
|
|
@@ -45516,10 +45574,10 @@ ${renderer_brand_mark_default}`;
|
|
|
45516
45574
|
for (const replacement of replacements.values()) {
|
|
45517
45575
|
if (replacement.removed.size !== 1 || replacement.added.size !== 1) continue;
|
|
45518
45576
|
const source = replacement.removed.values().next().value;
|
|
45519
|
-
const
|
|
45577
|
+
const target2 = replacement.added.values().next().value;
|
|
45520
45578
|
const mounted = mountedByComposer.get(source);
|
|
45521
|
-
if (source !==
|
|
45522
|
-
pendingReplacements.set(
|
|
45579
|
+
if (source !== target2 && mounted) {
|
|
45580
|
+
pendingReplacements.set(target2, {
|
|
45523
45581
|
source: mounted,
|
|
45524
45582
|
sourceModelTarget: mounted.modelTarget
|
|
45525
45583
|
});
|
|
@@ -45557,8 +45615,8 @@ ${renderer_brand_mark_default}`;
|
|
|
45557
45615
|
renderMounted(mounted);
|
|
45558
45616
|
return true;
|
|
45559
45617
|
};
|
|
45560
|
-
const composerForTarget = (
|
|
45561
|
-
const element = eventElement(
|
|
45618
|
+
const composerForTarget = (target2) => {
|
|
45619
|
+
const element = eventElement(target2);
|
|
45562
45620
|
const editor = element ? editorForElement(element) : null;
|
|
45563
45621
|
const composer = editor ? composerForEditor(editor) : null;
|
|
45564
45622
|
return composer && isMountedComposer(composer) ? composer : null;
|
|
@@ -46002,7 +46060,7 @@ ${renderer_brand_mark_default}`;
|
|
|
46002
46060
|
|
|
46003
46061
|
// src/renderer-rpc-steering.ts
|
|
46004
46062
|
var record13 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
|
|
46005
|
-
var invoke = (
|
|
46063
|
+
var invoke = (target2, name, ...args) => Reflect.apply(Reflect.get(target2, name), target2, args);
|
|
46006
46064
|
var running = (state) => record13(state) && (state.inProgress === true || !!state.activeTurnId);
|
|
46007
46065
|
var context = (previous, marker) => ({
|
|
46008
46066
|
...record13(previous) ? previous : {},
|
|
@@ -46037,7 +46095,7 @@ ${renderer_brand_mark_default}`;
|
|
|
46037
46095
|
current();
|
|
46038
46096
|
return delivery;
|
|
46039
46097
|
};
|
|
46040
|
-
const
|
|
46098
|
+
const target2 = async (threadId, messageId, delivery) => {
|
|
46041
46099
|
const state = await invoke(rpc, "getThreadExecutionState", threadId);
|
|
46042
46100
|
current();
|
|
46043
46101
|
if (!record13(state) || typeof state.activeTurnId !== "string" || !state.activeTurnId || typeof messageId !== "string" || !messageId)
|
|
@@ -46119,7 +46177,7 @@ ${renderer_brand_mark_default}`;
|
|
|
46119
46177
|
const restore = prepared.steer.restoreMessage;
|
|
46120
46178
|
messageId = record13(restore) && typeof restore.id === "string" ? restore.id : void 0;
|
|
46121
46179
|
const clientId = prepared.steer.clientUserMessageId ?? messageId;
|
|
46122
|
-
marker = await
|
|
46180
|
+
marker = await target2(threadId, clientId, delivery);
|
|
46123
46181
|
if (delivery === "activeTurn") return apply(prepared);
|
|
46124
46182
|
if (!messageId) throw new Error("Native queued message identity is unavailable");
|
|
46125
46183
|
finish = await prepareRpcSteeringQueue(
|