@codexhost/cli-win32-arm64 0.25.1 → 0.26.0
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 +307 -19
- package/app/console-web.js +613 -230
- package/app/desktop-controller.mjs +225 -5
- package/app/host-runtime.mjs +1189 -647
- package/app/plugins/antigravity/plugin.mjs +272 -19
- package/app/plugins/claude-code/plugin.mjs +265 -10
- package/app/plugins/codebuddy/plugin.mjs +224 -5
- package/app/plugins/codex-usage/plugin.mjs +224 -5
- package/app/plugins/copilot/plugin.mjs +224 -5
- package/app/plugins/cursor-cli/plugin.mjs +224 -5
- package/app/plugins/deepseek-harness/plugin.mjs +252 -36
- package/app/plugins/devin/plugin.mjs +224 -5
- package/app/plugins/grok/plugin.mjs +224 -5
- package/app/plugins/hermes/plugin.mjs +268 -20
- package/app/plugins/kimi-code/plugin.mjs +224 -5
- package/app/plugins/kiro-cli/plugin.mjs +224 -5
- package/app/plugins/omp/plugin.mjs +224 -5
- package/app/plugins/opencode/plugin.mjs +225 -9
- package/app/plugins/pi/plugin.mjs +366 -33
- package/app/plugins/qoder/plugin.mjs +224 -5
- package/app/plugins/qoder-cn/plugin.mjs +224 -5
- package/app/plugins/qwen-code/plugin.mjs +224 -5
- package/app/plugins/workbuddy/plugin.mjs +224 -5
- package/app/plugins/zcode/plugin.mjs +224 -5
- package/app/renderer-extension.js +1202 -330
- package/app/web/assets/index-BDWdtbFT.js +203 -0
- package/app/web/assets/index-jLAmV7OU.css +1 -0
- package/app/web/codexhost-settings.js +230 -140
- package/app/web/index.html +2 -2
- 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 +8 -10
- package/app/web/plugins/deepseek-ai__dsh-api-workspace-controller/client.js +3 -3
- package/app/web/plugins/deepseek-ai__dsh-client-ui-brand-official/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +74 -74
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +74 -74
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +96 -96
- package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.js +9 -9
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-theme/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 +132 -11
- package/app/web-modules/server.mjs +71157 -65816
- package/bin/codexhost.exe +0 -0
- package/libexec/codexhost-node-repl.exe +0 -0
- package/libexec/codexhost-shell.exe +0 -0
- package/libexec/codexhost-shim.exe +0 -0
- package/libexec/codexhost-updater.exe +0 -0
- package/package.json +1 -1
- package/app/web/assets/index-CTCFIQbU.css +0 -1
- package/app/web/assets/index-DUOvhHbV.js +0 -203
|
@@ -16149,7 +16149,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16149
16149
|
assignments: external_exports.record(external_exports.string(), external_exports.string()),
|
|
16150
16150
|
projectless: external_exports.array(external_exports.string()),
|
|
16151
16151
|
/** Canonical external pin membership; pins/list provides the native merged order. */
|
|
16152
|
-
pinned: external_exports.array(external_exports.string())
|
|
16152
|
+
pinned: external_exports.array(external_exports.string()),
|
|
16153
|
+
/** Projects Desktop placed in each custom section, keyed by the official section ID, in
|
|
16154
|
+
* Desktop's section order. Omitted when no section holds a project. */
|
|
16155
|
+
sectionProjects: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())).optional()
|
|
16153
16156
|
});
|
|
16154
16157
|
var record2 = external_exports.record(external_exports.string(), external_exports.unknown());
|
|
16155
16158
|
var clientChannelCursorSchema = external_exports.object({
|
|
@@ -16342,7 +16345,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16342
16345
|
var threadCatalogReadParamsSchema = external_exports.object({
|
|
16343
16346
|
includeArchived: external_exports.boolean().optional(),
|
|
16344
16347
|
/** Absent means first page; null means this branch is exhausted. Native cursors only. */
|
|
16345
|
-
officialCursor: external_exports.object({ live: external_exports.string().nullable(), archived: external_exports.string().nullable().optional() }).strict().optional()
|
|
16348
|
+
officialCursor: external_exports.object({ live: external_exports.string().nullable(), archived: external_exports.string().nullable().optional() }).strict().optional(),
|
|
16349
|
+
/**
|
|
16350
|
+
* Keep reading native pages until one holds a Thread in `cwd` but outside every
|
|
16351
|
+
* `excludeCwds` folder, the branch ends, or a page bound is reached. Every row read is
|
|
16352
|
+
* returned, so the native cursors stay contiguous.
|
|
16353
|
+
*/
|
|
16354
|
+
scope: external_exports.object({
|
|
16355
|
+
cwd: external_exports.string().min(1).max(4096),
|
|
16356
|
+
excludeCwds: external_exports.array(external_exports.string().min(1).max(4096)).max(1024)
|
|
16357
|
+
}).strict().optional()
|
|
16346
16358
|
}).strict();
|
|
16347
16359
|
var threadCatalogReadResultSchema = external_exports.object({
|
|
16348
16360
|
threads: external_exports.array(jsonObjectSchema),
|
|
@@ -16681,7 +16693,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16681
16693
|
timeoutMinutes: external_exports.number().int().min(IDLE_RELEASE_TIMEOUT_MINUTES_MIN).max(IDLE_RELEASE_TIMEOUT_MINUTES_MAX)
|
|
16682
16694
|
});
|
|
16683
16695
|
var DEFAULT_IDLE_RELEASE_SETTINGS = Object.freeze({
|
|
16684
|
-
enabled:
|
|
16696
|
+
enabled: true,
|
|
16685
16697
|
timeoutMinutes: 10
|
|
16686
16698
|
});
|
|
16687
16699
|
|
|
@@ -17627,7 +17639,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17627
17639
|
var UPDATE_ERROR_MAX_LENGTH = 500;
|
|
17628
17640
|
var UPDATE_SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/u;
|
|
17629
17641
|
var updateSemanticVersionSchema = external_exports.string().regex(UPDATE_SEMVER_PATTERN);
|
|
17630
|
-
var updateInstallationSchema = external_exports.enum([
|
|
17642
|
+
var updateInstallationSchema = external_exports.enum([
|
|
17643
|
+
"npm",
|
|
17644
|
+
"windows-installer",
|
|
17645
|
+
"macos-dmg",
|
|
17646
|
+
"linux-archive"
|
|
17647
|
+
]);
|
|
17631
17648
|
var updatePhaseSchema = external_exports.enum([
|
|
17632
17649
|
"prepared",
|
|
17633
17650
|
"downloading",
|
|
@@ -17798,7 +17815,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17798
17815
|
var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
|
|
17799
17816
|
var REMOTE_IDENTITY_MAX_LENGTH = 1024;
|
|
17800
17817
|
var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
|
|
17801
|
-
var target = {
|
|
17818
|
+
var target = {
|
|
17819
|
+
hostId: identity.regex(/^(?:remote-(?:ssh(?:-|:)|control:)|remote-peer:[a-zA-Z0-9_-]{1,64}$)/u)
|
|
17820
|
+
};
|
|
17802
17821
|
var thread = { ...target, threadId: identity };
|
|
17803
17822
|
var text = external_exports.string().min(1).max(8e3);
|
|
17804
17823
|
var input = { text, requestId: identity };
|
|
@@ -18017,6 +18036,206 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18017
18036
|
var webUiExtensionEnabledSchema = external_exports.object({ id: webUiExtensionIdSchema, enabled: external_exports.boolean() }).strict();
|
|
18018
18037
|
var webUiExtensionRemoveSchema = external_exports.object({ id: webUiExtensionIdSchema }).strict();
|
|
18019
18038
|
|
|
18039
|
+
// ../shared-contracts/dist/remote-peers.js
|
|
18040
|
+
var REMOTE_PEER_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/u;
|
|
18041
|
+
var remotePeerIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
18042
|
+
var remotePeerHostIdSchema = external_exports.string().regex(/^remote-peer:[a-zA-Z0-9_-]{1,64}$/u);
|
|
18043
|
+
var remotePeerTransportKindSchema = external_exports.enum(["relay", "tailscale", "lan", "custom"]);
|
|
18044
|
+
var REMOTE_PEER_COLORS = [
|
|
18045
|
+
"blue",
|
|
18046
|
+
"purple",
|
|
18047
|
+
"cyan",
|
|
18048
|
+
"green",
|
|
18049
|
+
"amber",
|
|
18050
|
+
"rose",
|
|
18051
|
+
"slate"
|
|
18052
|
+
];
|
|
18053
|
+
var remotePeerColorSchema = external_exports.enum(REMOTE_PEER_COLORS);
|
|
18054
|
+
var REMOTE_PEER_COLOR_SET = new Set(REMOTE_PEER_COLORS);
|
|
18055
|
+
var remotePeerStateSchema = external_exports.enum([
|
|
18056
|
+
"connected",
|
|
18057
|
+
"connecting",
|
|
18058
|
+
"auth-error",
|
|
18059
|
+
"offline",
|
|
18060
|
+
"disabled"
|
|
18061
|
+
]);
|
|
18062
|
+
var remotePeerSummarySchema = external_exports.object({
|
|
18063
|
+
peerId: remotePeerIdSchema,
|
|
18064
|
+
hostId: remotePeerHostIdSchema,
|
|
18065
|
+
name: external_exports.string().min(1).max(120),
|
|
18066
|
+
color: remotePeerColorSchema.optional(),
|
|
18067
|
+
origin: external_exports.string().min(1).max(2048),
|
|
18068
|
+
transportKind: remotePeerTransportKindSchema,
|
|
18069
|
+
encrypted: external_exports.boolean(),
|
|
18070
|
+
enabled: external_exports.boolean(),
|
|
18071
|
+
state: remotePeerStateSchema,
|
|
18072
|
+
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
18073
|
+
version: external_exports.string().max(128).optional(),
|
|
18074
|
+
platform: external_exports.string().max(64).optional(),
|
|
18075
|
+
hostname: external_exports.string().max(255).optional(),
|
|
18076
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
18077
|
+
lastError: external_exports.string().max(1e3).optional(),
|
|
18078
|
+
projectCount: external_exports.number().int().nonnegative(),
|
|
18079
|
+
createdAt: external_exports.string(),
|
|
18080
|
+
updatedAt: external_exports.string()
|
|
18081
|
+
});
|
|
18082
|
+
var remotePeerListResultSchema = external_exports.object({
|
|
18083
|
+
peers: external_exports.array(remotePeerSummarySchema)
|
|
18084
|
+
});
|
|
18085
|
+
var remotePeerAddParamsSchema = external_exports.object({
|
|
18086
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
18087
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
18088
|
+
token: external_exports.string().min(1).max(2048).optional(),
|
|
18089
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
18090
|
+
color: remotePeerColorSchema.optional()
|
|
18091
|
+
}).refine((input2) => Boolean(input2.connectionUrl) || Boolean(input2.origin) && Boolean(input2.token), "Provide either connectionUrl or both origin and token");
|
|
18092
|
+
var remotePeerUpdateParamsSchema = external_exports.object({
|
|
18093
|
+
peerId: remotePeerIdSchema,
|
|
18094
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
18095
|
+
color: remotePeerColorSchema.nullable().optional(),
|
|
18096
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
18097
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
18098
|
+
token: external_exports.string().min(1).max(2048).optional(),
|
|
18099
|
+
enabled: external_exports.boolean().optional()
|
|
18100
|
+
});
|
|
18101
|
+
var remotePeerIdParamsSchema = external_exports.object({
|
|
18102
|
+
peerId: remotePeerIdSchema
|
|
18103
|
+
});
|
|
18104
|
+
var remotePeerRemoveResultSchema = external_exports.object({
|
|
18105
|
+
removed: external_exports.boolean()
|
|
18106
|
+
});
|
|
18107
|
+
var remotePeerTestParamsSchema = external_exports.object({
|
|
18108
|
+
peerId: remotePeerIdSchema.optional(),
|
|
18109
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
18110
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
18111
|
+
token: external_exports.string().min(1).max(2048).optional()
|
|
18112
|
+
}).refine((input2) => Boolean(input2.peerId) || Boolean(input2.connectionUrl) || Boolean(input2.origin) && Boolean(input2.token), "Provide peerId, connectionUrl, or both origin and token");
|
|
18113
|
+
var remotePeerTestProjectSchema = external_exports.object({
|
|
18114
|
+
id: external_exports.string().min(1).max(1024),
|
|
18115
|
+
name: external_exports.string().min(1).max(512),
|
|
18116
|
+
path: external_exports.string().min(1).max(8192)
|
|
18117
|
+
});
|
|
18118
|
+
var remotePeerTestResultSchema = external_exports.object({
|
|
18119
|
+
ok: external_exports.boolean(),
|
|
18120
|
+
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
18121
|
+
origin: external_exports.string().max(2048).optional(),
|
|
18122
|
+
transportKind: remotePeerTransportKindSchema.optional(),
|
|
18123
|
+
encrypted: external_exports.boolean().optional(),
|
|
18124
|
+
version: external_exports.string().max(128).optional(),
|
|
18125
|
+
platform: external_exports.string().max(64).optional(),
|
|
18126
|
+
hostname: external_exports.string().max(255).optional(),
|
|
18127
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
18128
|
+
projectCount: external_exports.number().int().nonnegative().optional(),
|
|
18129
|
+
projects: external_exports.array(remotePeerTestProjectSchema).optional(),
|
|
18130
|
+
error: external_exports.string().max(1e3).optional()
|
|
18131
|
+
});
|
|
18132
|
+
var remotePeerManifestProjectSchema = external_exports.object({
|
|
18133
|
+
id: external_exports.string().min(1).max(1024),
|
|
18134
|
+
name: external_exports.string().min(1).max(512),
|
|
18135
|
+
path: external_exports.string().min(1).max(8192),
|
|
18136
|
+
threadIds: external_exports.array(external_exports.string().min(1).max(1024))
|
|
18137
|
+
});
|
|
18138
|
+
var remotePeerCapabilitiesSchema = external_exports.object({
|
|
18139
|
+
/** /api/peer/v1/uploads, /api/peer/v1/prompt, and /api/peer/v1/file are all available. */
|
|
18140
|
+
attachments: external_exports.literal(1).optional(),
|
|
18141
|
+
/** /api/peer/v1/workspace-files/rpc and /api/peer/v1/workspace-files/download are available. */
|
|
18142
|
+
workspaceFiles: external_exports.literal(1).optional(),
|
|
18143
|
+
/** Peer supports officeToPdf/render over /api/peer/v1/workspace-files/rpc. */
|
|
18144
|
+
officePreview: external_exports.literal(1).optional()
|
|
18145
|
+
});
|
|
18146
|
+
var remotePeerManifestSchema = external_exports.object({
|
|
18147
|
+
version: external_exports.string().max(128),
|
|
18148
|
+
platform: external_exports.string().max(64),
|
|
18149
|
+
hostname: external_exports.string().max(255),
|
|
18150
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
18151
|
+
epoch: external_exports.string().min(1).max(256),
|
|
18152
|
+
projects: external_exports.array(remotePeerManifestProjectSchema),
|
|
18153
|
+
capabilities: remotePeerCapabilitiesSchema.optional()
|
|
18154
|
+
});
|
|
18155
|
+
var REMOTE_PEER_UPLOAD_SCOPE_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/u;
|
|
18156
|
+
var remotePeerPromptParamsSchema = external_exports.strictObject({
|
|
18157
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
18158
|
+
scope: external_exports.string().regex(REMOTE_PEER_UPLOAD_SCOPE_PATTERN).optional(),
|
|
18159
|
+
requestId: external_exports.string().min(1).max(256).optional(),
|
|
18160
|
+
mode: external_exports.enum(["queue", "steer"]).optional(),
|
|
18161
|
+
expectedTurnId: external_exports.string().min(1).max(1024).nullable().optional(),
|
|
18162
|
+
content: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
18163
|
+
external_exports.strictObject({ type: external_exports.literal("text"), text: external_exports.string() }),
|
|
18164
|
+
external_exports.strictObject({ type: external_exports.literal("file"), receiptId: external_exports.string().min(1).max(128) })
|
|
18165
|
+
])).min(1).max(64)
|
|
18166
|
+
});
|
|
18167
|
+
var remotePeerErrorEnvelopeSchema = external_exports.object({
|
|
18168
|
+
ok: external_exports.literal(false),
|
|
18169
|
+
error: external_exports.object({
|
|
18170
|
+
code: external_exports.string(),
|
|
18171
|
+
message: external_exports.string(),
|
|
18172
|
+
details: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
18173
|
+
})
|
|
18174
|
+
});
|
|
18175
|
+
var remotePeerUploadResultSchema = external_exports.union([
|
|
18176
|
+
external_exports.object({
|
|
18177
|
+
ok: external_exports.literal(true),
|
|
18178
|
+
value: external_exports.object({
|
|
18179
|
+
receiptId: external_exports.string().min(1),
|
|
18180
|
+
file: external_exports.object({
|
|
18181
|
+
attachmentId: external_exports.string(),
|
|
18182
|
+
name: external_exports.string(),
|
|
18183
|
+
bytes: external_exports.number().int().nonnegative()
|
|
18184
|
+
})
|
|
18185
|
+
})
|
|
18186
|
+
}),
|
|
18187
|
+
remotePeerErrorEnvelopeSchema
|
|
18188
|
+
]);
|
|
18189
|
+
var remotePeerPromptResultSchema = external_exports.union([
|
|
18190
|
+
external_exports.object({
|
|
18191
|
+
ok: external_exports.literal(true),
|
|
18192
|
+
value: external_exports.object({ accepted: external_exports.literal(true) })
|
|
18193
|
+
}),
|
|
18194
|
+
remotePeerErrorEnvelopeSchema
|
|
18195
|
+
]);
|
|
18196
|
+
var remotePeerDirectoryEntrySchema = external_exports.object({
|
|
18197
|
+
name: external_exports.string().min(1).max(512),
|
|
18198
|
+
path: external_exports.string().min(1).max(8192),
|
|
18199
|
+
kind: external_exports.literal("directory")
|
|
18200
|
+
});
|
|
18201
|
+
var remotePeerListDirsParamsSchema = external_exports.object({
|
|
18202
|
+
peerId: remotePeerIdSchema,
|
|
18203
|
+
path: external_exports.string().min(1).max(8192).optional()
|
|
18204
|
+
});
|
|
18205
|
+
var remotePeerListDirsResultSchema = external_exports.object({
|
|
18206
|
+
path: external_exports.string().min(1).max(8192),
|
|
18207
|
+
parentPath: external_exports.string().min(1).max(8192).nullable(),
|
|
18208
|
+
homeDir: external_exports.string().min(1).max(8192).optional(),
|
|
18209
|
+
entries: external_exports.array(remotePeerDirectoryEntrySchema)
|
|
18210
|
+
});
|
|
18211
|
+
var remotePeerCreateDirParamsSchema = external_exports.object({
|
|
18212
|
+
peerId: remotePeerIdSchema,
|
|
18213
|
+
parentPath: external_exports.string().min(1).max(8192),
|
|
18214
|
+
name: external_exports.string().min(1).max(255).refine((value) => value.trim().length > 0, "Directory name cannot be blank")
|
|
18215
|
+
});
|
|
18216
|
+
var remotePeerCreateDirResultSchema = external_exports.object({
|
|
18217
|
+
path: external_exports.string().min(1).max(8192),
|
|
18218
|
+
name: external_exports.string().min(1).max(255)
|
|
18219
|
+
});
|
|
18220
|
+
var remotePeerCreateWorkspaceParamsSchema = external_exports.object({
|
|
18221
|
+
peerId: remotePeerIdSchema,
|
|
18222
|
+
path: external_exports.string().min(1).max(8192),
|
|
18223
|
+
title: external_exports.string().trim().min(1).max(255).optional()
|
|
18224
|
+
});
|
|
18225
|
+
var remotePeerRenameWorkspaceParamsSchema = external_exports.object({
|
|
18226
|
+
peerId: remotePeerIdSchema,
|
|
18227
|
+
workspaceId: external_exports.string().min(1).max(1024),
|
|
18228
|
+
title: external_exports.string().trim().min(1).max(255)
|
|
18229
|
+
});
|
|
18230
|
+
var remotePeerDeleteWorkspaceParamsSchema = external_exports.object({
|
|
18231
|
+
peerId: remotePeerIdSchema,
|
|
18232
|
+
workspaceId: external_exports.string().min(1).max(1024)
|
|
18233
|
+
});
|
|
18234
|
+
var remotePeerWorkspaceMutationResultSchema = external_exports.object({
|
|
18235
|
+
workspaceId: external_exports.string().min(1).max(1024).optional(),
|
|
18236
|
+
manifest: remotePeerManifestSchema
|
|
18237
|
+
});
|
|
18238
|
+
|
|
18020
18239
|
// ../shared-contracts/dist/index.js
|
|
18021
18240
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
18022
18241
|
|
|
@@ -20279,6 +20498,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20279
20498
|
var TRIGGER_CHIP_ROOT_CLASS = "codexhost-trigger-chip-root";
|
|
20280
20499
|
var COMPACT_COMPOSER_ATTRIBUTE = "data-codexhost-compact-composer";
|
|
20281
20500
|
var COMPACT_COMPOSER_WIDTH = 420;
|
|
20501
|
+
var COMPACT_PERMISSION_COMPOSER_ATTRIBUTE = "data-codexhost-compact-permission-composer";
|
|
20502
|
+
var COMPACT_PERMISSION_COMPOSER_WIDTH = 600;
|
|
20282
20503
|
var TRIGGER_CHIP_SQUEEZE_MIN_WIDTH = "48px";
|
|
20283
20504
|
function rendererModelTriggerMaxWidth() {
|
|
20284
20505
|
return "min(280px, 36vw)";
|
|
@@ -20312,17 +20533,24 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20312
20533
|
const update = () => {
|
|
20313
20534
|
const width = composer.getBoundingClientRect().width;
|
|
20314
20535
|
if (width > 0) {
|
|
20536
|
+
composer.toggleAttribute(
|
|
20537
|
+
COMPACT_PERMISSION_COMPOSER_ATTRIBUTE,
|
|
20538
|
+
width <= COMPACT_PERMISSION_COMPOSER_WIDTH
|
|
20539
|
+
);
|
|
20315
20540
|
composer.toggleAttribute(COMPACT_COMPOSER_ATTRIBUTE, width <= COMPACT_COMPOSER_WIDTH);
|
|
20316
20541
|
}
|
|
20317
20542
|
};
|
|
20543
|
+
const clear = () => {
|
|
20544
|
+
composer.removeAttribute(COMPACT_PERMISSION_COMPOSER_ATTRIBUTE);
|
|
20545
|
+
composer.removeAttribute(COMPACT_COMPOSER_ATTRIBUTE);
|
|
20546
|
+
};
|
|
20318
20547
|
update();
|
|
20319
|
-
if (typeof ResizeObserver === "undefined")
|
|
20320
|
-
return () => composer.removeAttribute(COMPACT_COMPOSER_ATTRIBUTE);
|
|
20548
|
+
if (typeof ResizeObserver === "undefined") return clear;
|
|
20321
20549
|
const observer = new ResizeObserver(update);
|
|
20322
20550
|
observer.observe(composer, { box: "border-box" });
|
|
20323
20551
|
return () => {
|
|
20324
20552
|
observer.disconnect();
|
|
20325
|
-
|
|
20553
|
+
clear();
|
|
20326
20554
|
};
|
|
20327
20555
|
}
|
|
20328
20556
|
function ensureRendererTriggerChipStyle(ownerDocument) {
|
|
@@ -20366,19 +20594,25 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20366
20594
|
[${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-model-control] [data-codexhost-model-thinking] {
|
|
20367
20595
|
display: none !important;
|
|
20368
20596
|
}
|
|
20597
|
+
[${COMPACT_PERMISSION_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-mode-control],
|
|
20369
20598
|
[${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-mode-control] {
|
|
20370
20599
|
min-width: 30px !important;
|
|
20371
20600
|
max-width: 30px !important;
|
|
20372
20601
|
}
|
|
20602
|
+
[${COMPACT_PERMISSION_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-mode-control] .${TRIGGER_CHIP_CLASS},
|
|
20373
20603
|
[${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-mode-control] .${TRIGGER_CHIP_CLASS} {
|
|
20374
20604
|
padding-inline: 6px !important;
|
|
20375
20605
|
}
|
|
20606
|
+
[${COMPACT_PERMISSION_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-label],
|
|
20607
|
+
[${COMPACT_PERMISSION_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-chevron],
|
|
20376
20608
|
[${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-label],
|
|
20377
20609
|
[${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-chevron],
|
|
20378
20610
|
[${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-credits-label],
|
|
20379
20611
|
[${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-usage-label] {
|
|
20380
20612
|
display: none !important;
|
|
20381
20613
|
}
|
|
20614
|
+
[${COMPACT_PERMISSION_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-mode-control]:has([data-codexhost-permission-lock]:not([hidden])) [data-codexhost-permission-shield],
|
|
20615
|
+
[${COMPACT_PERMISSION_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-mode-control]:has([data-codexhost-permission-error]:not([hidden])) [data-codexhost-permission-shield],
|
|
20382
20616
|
[${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-mode-control]:has([data-codexhost-permission-lock]:not([hidden])) [data-codexhost-permission-shield],
|
|
20383
20617
|
[${COMPACT_COMPOSER_ATTRIBUTE}] [data-codexhost-permission-mode-control]:has([data-codexhost-permission-error]:not([hidden])) [data-codexhost-permission-shield] {
|
|
20384
20618
|
display: none !important;
|
|
@@ -24177,7 +24411,7 @@ ${error51.stderrTail}`] : []
|
|
|
24177
24411
|
screenshotPreviewLabel: "\u9884\u89C8\u7B2C {index} \u5F20\u622A\u56FE\uFF08\u5171 {total} \u5F20\uFF09",
|
|
24178
24412
|
previousScreenshot: "\u4E0A\u4E00\u5F20\u622A\u56FE",
|
|
24179
24413
|
nextScreenshot: "\u4E0B\u4E00\u5F20\u622A\u56FE",
|
|
24180
|
-
closePreview: "\
|
|
24414
|
+
closePreview: "\u5173\u95ED\u9884\u89C8",
|
|
24181
24415
|
openExtensionSettings: "\u6253\u5F00\u8BBE\u7F6E",
|
|
24182
24416
|
extensionSettingsTitle: "\u63D2\u4EF6\u8BBE\u7F6E",
|
|
24183
24417
|
extensionSettingsDisabledHint: "\u7981\u7528\u65F6\u4E5F\u53EF\u7F16\u8F91",
|
|
@@ -24501,6 +24735,7 @@ ${error51.stderrTail}`] : []
|
|
|
24501
24735
|
updateInstallationNpm: "npm",
|
|
24502
24736
|
updateInstallationWindowsInstaller: "Windows installer",
|
|
24503
24737
|
updateInstallationMacOsDmg: "macOS DMG",
|
|
24738
|
+
updateInstallationLinuxArchive: "Linux archive (.tar.gz)",
|
|
24504
24739
|
updateInstallationUnknown: "Unknown",
|
|
24505
24740
|
updateLatestVersion: "Latest version",
|
|
24506
24741
|
updateUpToDate: "You are up to date.",
|
|
@@ -24803,6 +25038,7 @@ ${error51.stderrTail}`] : []
|
|
|
24803
25038
|
updateInstallationNpm: "npm",
|
|
24804
25039
|
updateInstallationWindowsInstaller: "Windows \u5B89\u88C5\u7A0B\u5E8F",
|
|
24805
25040
|
updateInstallationMacOsDmg: "macOS DMG",
|
|
25041
|
+
updateInstallationLinuxArchive: "Linux \u538B\u7F29\u5305\uFF08.tar.gz\uFF09",
|
|
24806
25042
|
updateInstallationUnknown: "\u672A\u77E5",
|
|
24807
25043
|
updateLatestVersion: "\u6700\u65B0\u7248\u672C",
|
|
24808
25044
|
updateUpToDate: "\u5F53\u524D\u5DF2\u662F\u6700\u65B0\u7248\u672C\u3002",
|
|
@@ -25907,6 +26143,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
25907
26143
|
function isRendererModelPickerDisabled(view) {
|
|
25908
26144
|
return view.status === "waitingForAdapter" || view.status === "loading" || view.status === "selecting" || view.status === "empty" || view.catalog === void 0;
|
|
25909
26145
|
}
|
|
26146
|
+
function canRetryRendererModelCatalog(view) {
|
|
26147
|
+
return view.status === "error" && view.catalog === void 0 && view.refreshing !== true;
|
|
26148
|
+
}
|
|
25910
26149
|
function shouldCloseRendererModelPicker(view) {
|
|
25911
26150
|
return isRendererModelPickerDisabled(view) && view.status !== "selecting";
|
|
25912
26151
|
}
|
|
@@ -26229,6 +26468,10 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26229
26468
|
positionAdvancedMenus(control);
|
|
26230
26469
|
};
|
|
26231
26470
|
const onTriggerClick = () => {
|
|
26471
|
+
if (trigger.hasAttribute("data-codexhost-retry-models")) {
|
|
26472
|
+
onRefreshModels?.();
|
|
26473
|
+
return;
|
|
26474
|
+
}
|
|
26232
26475
|
if (pickerOpen()) close();
|
|
26233
26476
|
else open();
|
|
26234
26477
|
};
|
|
@@ -26531,7 +26774,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26531
26774
|
syncRendererLabelText(control.thinkingLabel, secondaryLabel ?? "");
|
|
26532
26775
|
control.thinkingLabel.hidden = secondaryLabel === void 0;
|
|
26533
26776
|
const accessibleLabel = secondaryLabel ? `${presentation.modelLabel}, ${secondaryLabel}` : presentation.modelLabel;
|
|
26534
|
-
|
|
26777
|
+
const retryCatalog = control.refreshButton !== void 0 && canRetryRendererModelCatalog(view);
|
|
26778
|
+
control.trigger.title = retryCatalog ? `${view.error ?? accessibleLabel}
|
|
26779
|
+
${messages.refreshModels}` : view.error ?? accessibleLabel;
|
|
26535
26780
|
const selectionFailed = rendererModelSelectionFailed(view);
|
|
26536
26781
|
control.errorMark.hidden = !selectionFailed;
|
|
26537
26782
|
control.errorMark.style.display = selectionFailed ? "inline-flex" : "none";
|
|
@@ -26543,14 +26788,16 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26543
26788
|
"aria-busy",
|
|
26544
26789
|
String(view.status === "loading" || view.status === "selecting")
|
|
26545
26790
|
);
|
|
26546
|
-
|
|
26547
|
-
control.
|
|
26791
|
+
const pickerDisabled = isRendererModelPickerDisabled(view);
|
|
26792
|
+
control.trigger.disabled = pickerDisabled && !retryCatalog;
|
|
26793
|
+
control.trigger.toggleAttribute("data-codexhost-retry-models", retryCatalog);
|
|
26794
|
+
control.fast.render(view.catalog, view.selected, pickerDisabled, locale === "zh-CN");
|
|
26548
26795
|
control.trigger.style.paddingLeft = control.fast.button.hidden ? "8px" : "2px";
|
|
26549
26796
|
if (control.fast.button.hidden) control.fast.button.remove();
|
|
26550
26797
|
else if (control.fast.button.parentElement !== control.root)
|
|
26551
26798
|
control.root.prepend(control.fast.button);
|
|
26552
26799
|
if (shouldCloseRendererModelPicker(view) && !keepOpenMenu) control.close();
|
|
26553
|
-
control.modelButton.disabled =
|
|
26800
|
+
control.modelButton.disabled = pickerDisabled;
|
|
26554
26801
|
for (const [modelId2, option] of control.options) {
|
|
26555
26802
|
const selected = sameHarnessModelRef(
|
|
26556
26803
|
harnessModelRefFromKey(modelId2),
|
|
@@ -26558,14 +26805,14 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
26558
26805
|
);
|
|
26559
26806
|
option.button.setAttribute("aria-checked", String(selected));
|
|
26560
26807
|
option.button.classList.toggle("bg-token-list-hover-background", selected);
|
|
26561
|
-
option.button.disabled =
|
|
26808
|
+
option.button.disabled = pickerDisabled;
|
|
26562
26809
|
option.check.style.visibility = selected ? "visible" : "hidden";
|
|
26563
26810
|
}
|
|
26564
26811
|
for (const [thinkingOptionId, option] of control.thinkingOptions) {
|
|
26565
26812
|
const selected = thinkingOptionId === view.selectedThinkingOptionId;
|
|
26566
26813
|
option.button.setAttribute("aria-checked", String(selected));
|
|
26567
26814
|
option.button.classList.toggle("bg-token-list-hover-background", selected);
|
|
26568
|
-
option.button.disabled =
|
|
26815
|
+
option.button.disabled = pickerDisabled || !presentation.thinkingSelectionEnabled;
|
|
26569
26816
|
option.check.style.visibility = selected ? "visible" : "hidden";
|
|
26570
26817
|
}
|
|
26571
26818
|
syncModelSelectionNotice(control, view, locale);
|
|
@@ -27747,6 +27994,21 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
27747
27994
|
};
|
|
27748
27995
|
}
|
|
27749
27996
|
|
|
27997
|
+
// src/renderer-native-model-loading.ts
|
|
27998
|
+
function isNativeModelCarrierLoadingButton(button2) {
|
|
27999
|
+
if (!button2.disabled || button2.getAttribute("data-composer-navigation-target") !== "reasoning" || button2.getAttribute("aria-busy") !== "true" || button2.hasAttribute("aria-haspopup"))
|
|
28000
|
+
return false;
|
|
28001
|
+
for (const label of button2.children) {
|
|
28002
|
+
const text2 = label.firstChild;
|
|
28003
|
+
if (label.localName !== "span" || text2?.nodeName !== "#text") continue;
|
|
28004
|
+
try {
|
|
28005
|
+
if (decodeHarnessPluginRoute(text2.nodeValue)) return true;
|
|
28006
|
+
} catch {
|
|
28007
|
+
}
|
|
28008
|
+
}
|
|
28009
|
+
return false;
|
|
28010
|
+
}
|
|
28011
|
+
|
|
27750
28012
|
// src/renderer-native-model-retry.ts
|
|
27751
28013
|
function record9(value) {
|
|
27752
28014
|
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : void 0;
|
|
@@ -27952,7 +28214,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
27952
28214
|
'button[aria-haspopup="menu"], button[data-composer-navigation-target="reasoning"]'
|
|
27953
28215
|
)
|
|
27954
28216
|
].filter(
|
|
27955
|
-
(button2) => !isOwnedRendererControl(button2) && button2.closest(CODEX_COMPOSER_SELECTOR) === composer && (isNativeModelControlCandidate(button2) || isNativeModelRetryButton(button2, composer))
|
|
28217
|
+
(button2) => !isOwnedRendererControl(button2) && button2.closest(CODEX_COMPOSER_SELECTOR) === composer && (isNativeModelControlCandidate(button2) || isNativeModelRetryButton(button2, composer) || isNativeModelCarrierLoadingButton(button2))
|
|
27956
28218
|
);
|
|
27957
28219
|
return candidates.length === 1 ? candidates[0] ?? null : null;
|
|
27958
28220
|
}
|
|
@@ -28855,6 +29117,260 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
28855
29117
|
};
|
|
28856
29118
|
}
|
|
28857
29119
|
|
|
29120
|
+
// src/renderer-native-provider-usage-banner.ts
|
|
29121
|
+
var COMPOSER_SELECTOR = "[data-codex-composer-root]";
|
|
29122
|
+
function isRecord4(value) {
|
|
29123
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29124
|
+
}
|
|
29125
|
+
function isCodexUsageBanner(element, composer) {
|
|
29126
|
+
if (element.closest(COMPOSER_SELECTOR) !== composer) return false;
|
|
29127
|
+
const key2 = Object.getOwnPropertyNames(element).find((name) => name.startsWith("__reactFiber$"));
|
|
29128
|
+
if (!key2) return false;
|
|
29129
|
+
for (const { memoizedProps: props } of committedReactAncestors(
|
|
29130
|
+
Object.getOwnPropertyDescriptor(element, key2)?.value
|
|
29131
|
+
)) {
|
|
29132
|
+
if (!isRecord4(props) || !isRecord4(props.banner)) continue;
|
|
29133
|
+
const type = props.banner.banner_type;
|
|
29134
|
+
return typeof type === "string" && /^(?:[a-z0-9]+_)*rate_limit_reached$/u.test(type);
|
|
29135
|
+
}
|
|
29136
|
+
return false;
|
|
29137
|
+
}
|
|
29138
|
+
function createRendererNativeProviderUsageBanner(composer) {
|
|
29139
|
+
const hidden = /* @__PURE__ */ new Map();
|
|
29140
|
+
let bypassed = false;
|
|
29141
|
+
let disposed = false;
|
|
29142
|
+
const Observer = composer.ownerDocument?.defaultView?.MutationObserver;
|
|
29143
|
+
const observer = Observer ? new Observer(() => {
|
|
29144
|
+
if (!disposed && bypassed) reconcile();
|
|
29145
|
+
}) : null;
|
|
29146
|
+
const restore = (element, state) => {
|
|
29147
|
+
if (element.hidden === true) element.hidden = state.hidden;
|
|
29148
|
+
if (element.getAttribute("aria-hidden") === "true") {
|
|
29149
|
+
if (state.ariaHidden === null) element.removeAttribute("aria-hidden");
|
|
29150
|
+
else element.setAttribute("aria-hidden", state.ariaHidden);
|
|
29151
|
+
}
|
|
29152
|
+
if (element.style.getPropertyValue("display") === "none" && element.style.getPropertyPriority("display") === "important") {
|
|
29153
|
+
if (state.display) element.style.setProperty("display", state.display, state.priority);
|
|
29154
|
+
else element.style.removeProperty("display");
|
|
29155
|
+
}
|
|
29156
|
+
hidden.delete(element);
|
|
29157
|
+
};
|
|
29158
|
+
const release = () => {
|
|
29159
|
+
for (const [element, state] of hidden) restore(element, state);
|
|
29160
|
+
};
|
|
29161
|
+
const reconcile = () => {
|
|
29162
|
+
if (!bypassed || !composer.isConnected) {
|
|
29163
|
+
release();
|
|
29164
|
+
return;
|
|
29165
|
+
}
|
|
29166
|
+
const banners = new Set(
|
|
29167
|
+
[...composer.querySelectorAll('aside[role="status"]')].filter(
|
|
29168
|
+
(element) => isCodexUsageBanner(element, composer)
|
|
29169
|
+
)
|
|
29170
|
+
);
|
|
29171
|
+
for (const [element, state] of hidden) {
|
|
29172
|
+
if (!banners.has(element)) restore(element, state);
|
|
29173
|
+
}
|
|
29174
|
+
for (const element of banners) {
|
|
29175
|
+
if (!hidden.has(element)) {
|
|
29176
|
+
hidden.set(element, {
|
|
29177
|
+
hidden: element.hidden,
|
|
29178
|
+
ariaHidden: element.getAttribute("aria-hidden"),
|
|
29179
|
+
display: element.style.getPropertyValue("display"),
|
|
29180
|
+
priority: element.style.getPropertyPriority("display")
|
|
29181
|
+
});
|
|
29182
|
+
}
|
|
29183
|
+
if (element.hidden !== true) element.hidden = true;
|
|
29184
|
+
if (element.getAttribute("aria-hidden") !== "true")
|
|
29185
|
+
element.setAttribute("aria-hidden", "true");
|
|
29186
|
+
if (element.style.getPropertyValue("display") !== "none" || element.style.getPropertyPriority("display") !== "important") {
|
|
29187
|
+
element.style.setProperty("display", "none", "important");
|
|
29188
|
+
}
|
|
29189
|
+
}
|
|
29190
|
+
};
|
|
29191
|
+
return {
|
|
29192
|
+
update(next) {
|
|
29193
|
+
if (disposed) return;
|
|
29194
|
+
if (next !== bypassed) {
|
|
29195
|
+
bypassed = next;
|
|
29196
|
+
observer?.disconnect();
|
|
29197
|
+
if (bypassed) {
|
|
29198
|
+
observer?.observe(composer, {
|
|
29199
|
+
subtree: true,
|
|
29200
|
+
childList: true,
|
|
29201
|
+
characterData: true,
|
|
29202
|
+
attributes: true,
|
|
29203
|
+
attributeFilter: ["hidden", "aria-hidden", "style"]
|
|
29204
|
+
});
|
|
29205
|
+
}
|
|
29206
|
+
}
|
|
29207
|
+
reconcile();
|
|
29208
|
+
},
|
|
29209
|
+
dispose() {
|
|
29210
|
+
disposed = true;
|
|
29211
|
+
bypassed = false;
|
|
29212
|
+
observer?.disconnect();
|
|
29213
|
+
release();
|
|
29214
|
+
}
|
|
29215
|
+
};
|
|
29216
|
+
}
|
|
29217
|
+
|
|
29218
|
+
// src/renderer-native-inference-route.ts
|
|
29219
|
+
var REFRESH_MS = 5e3;
|
|
29220
|
+
var CHECK_TIMEOUT_MS = 5e3;
|
|
29221
|
+
function nonEmpty(value) {
|
|
29222
|
+
return typeof value === "string" && value.trim().length > 0 ? value : null;
|
|
29223
|
+
}
|
|
29224
|
+
function createRendererNativeDraftWorkspaceStore() {
|
|
29225
|
+
const bindings = /* @__PURE__ */ new Map();
|
|
29226
|
+
const clearHost = (hostId2) => {
|
|
29227
|
+
for (const [composer, entry] of bindings) {
|
|
29228
|
+
if (entry.hostId === hostId2) bindings.delete(composer);
|
|
29229
|
+
}
|
|
29230
|
+
};
|
|
29231
|
+
return {
|
|
29232
|
+
publish(input2, activeDrafts) {
|
|
29233
|
+
const hostId2 = nonEmpty(input2.hostId);
|
|
29234
|
+
const cwd = nonEmpty(input2.cwd);
|
|
29235
|
+
if (!hostId2 || !cwd) return;
|
|
29236
|
+
const explicitDraftId = nonEmpty(input2.draftId);
|
|
29237
|
+
const hostDrafts = activeDrafts.filter(
|
|
29238
|
+
(candidate) => candidate.hostId === hostId2 && nonEmpty(candidate.draftId) !== null
|
|
29239
|
+
);
|
|
29240
|
+
if (explicitDraftId) {
|
|
29241
|
+
const matches = hostDrafts.filter((candidate) => candidate.draftId === explicitDraftId);
|
|
29242
|
+
if (matches.length !== 1 || !matches[0]) {
|
|
29243
|
+
for (const candidate of matches) bindings.delete(candidate.composer);
|
|
29244
|
+
return;
|
|
29245
|
+
}
|
|
29246
|
+
bindings.set(matches[0].composer, { hostId: hostId2, draftId: explicitDraftId, cwd });
|
|
29247
|
+
return;
|
|
29248
|
+
}
|
|
29249
|
+
if (hostDrafts.length !== 1 || !hostDrafts[0]) {
|
|
29250
|
+
if (hostDrafts.length > 1) clearHost(hostId2);
|
|
29251
|
+
return;
|
|
29252
|
+
}
|
|
29253
|
+
bindings.set(hostDrafts[0].composer, { hostId: hostId2, draftId: hostDrafts[0].draftId, cwd });
|
|
29254
|
+
},
|
|
29255
|
+
resolve(draft) {
|
|
29256
|
+
const hostId2 = nonEmpty(draft.hostId);
|
|
29257
|
+
const draftId = nonEmpty(draft.draftId);
|
|
29258
|
+
if (!hostId2 || !draftId) {
|
|
29259
|
+
bindings.delete(draft.composer);
|
|
29260
|
+
return null;
|
|
29261
|
+
}
|
|
29262
|
+
const entry = bindings.get(draft.composer);
|
|
29263
|
+
if (!entry) return null;
|
|
29264
|
+
if (entry.hostId !== hostId2 || entry.draftId !== draftId) {
|
|
29265
|
+
bindings.delete(draft.composer);
|
|
29266
|
+
return null;
|
|
29267
|
+
}
|
|
29268
|
+
return { draftId: entry.draftId, cwd: entry.cwd };
|
|
29269
|
+
},
|
|
29270
|
+
delete(composer) {
|
|
29271
|
+
bindings.delete(composer);
|
|
29272
|
+
},
|
|
29273
|
+
clear(hostId2) {
|
|
29274
|
+
if (hostId2 === void 0) bindings.clear();
|
|
29275
|
+
else clearHost(hostId2);
|
|
29276
|
+
}
|
|
29277
|
+
};
|
|
29278
|
+
}
|
|
29279
|
+
function createRendererNativeInferenceRoute(onChange) {
|
|
29280
|
+
let route = null;
|
|
29281
|
+
let timer = null;
|
|
29282
|
+
let disposed = false;
|
|
29283
|
+
let requestGeneration = 0;
|
|
29284
|
+
const clearTimer = () => {
|
|
29285
|
+
if (timer !== null) clearTimeout(timer);
|
|
29286
|
+
timer = null;
|
|
29287
|
+
};
|
|
29288
|
+
const invalidate = () => {
|
|
29289
|
+
requestGeneration++;
|
|
29290
|
+
clearTimer();
|
|
29291
|
+
route = null;
|
|
29292
|
+
};
|
|
29293
|
+
const check2 = (current) => {
|
|
29294
|
+
const generation = ++requestGeneration;
|
|
29295
|
+
clearTimer();
|
|
29296
|
+
current.pending = true;
|
|
29297
|
+
const finish = (independent) => {
|
|
29298
|
+
if (disposed || route !== current || !current.pending || requestGeneration !== generation)
|
|
29299
|
+
return;
|
|
29300
|
+
clearTimer();
|
|
29301
|
+
current.pending = false;
|
|
29302
|
+
current.independent = independent;
|
|
29303
|
+
current.checkedAt = Date.now();
|
|
29304
|
+
timer = setTimeout(() => {
|
|
29305
|
+
timer = null;
|
|
29306
|
+
if (!disposed && route === current) onChange();
|
|
29307
|
+
}, REFRESH_MS);
|
|
29308
|
+
onChange();
|
|
29309
|
+
};
|
|
29310
|
+
timer = setTimeout(() => {
|
|
29311
|
+
if (disposed || route !== current || !current.pending || requestGeneration !== generation)
|
|
29312
|
+
return;
|
|
29313
|
+
console.warn(
|
|
29314
|
+
"codexhost native inference route verification timed out; retaining Codex usage gate"
|
|
29315
|
+
);
|
|
29316
|
+
finish(false);
|
|
29317
|
+
}, CHECK_TIMEOUT_MS);
|
|
29318
|
+
void (async () => {
|
|
29319
|
+
try {
|
|
29320
|
+
const target2 = current.threadId ? { threadId: current.threadId } : current.draftCwd ? { cwd: current.draftCwd } : null;
|
|
29321
|
+
if (!target2) {
|
|
29322
|
+
finish(false);
|
|
29323
|
+
return;
|
|
29324
|
+
}
|
|
29325
|
+
const independent = await current.client.usesIndependentNativeInference?.(target2) === true;
|
|
29326
|
+
finish(independent);
|
|
29327
|
+
} catch (error51) {
|
|
29328
|
+
if (disposed || route !== current || !current.pending || requestGeneration !== generation)
|
|
29329
|
+
return;
|
|
29330
|
+
console.warn(
|
|
29331
|
+
"codexhost native inference route could not be verified; retaining Codex usage gate",
|
|
29332
|
+
error51 instanceof Error ? error51.name : "UnknownError"
|
|
29333
|
+
);
|
|
29334
|
+
finish(false);
|
|
29335
|
+
}
|
|
29336
|
+
})();
|
|
29337
|
+
};
|
|
29338
|
+
return {
|
|
29339
|
+
update(client, threadId, eligible, draft = null) {
|
|
29340
|
+
if (disposed || !eligible || !client) {
|
|
29341
|
+
invalidate();
|
|
29342
|
+
return false;
|
|
29343
|
+
}
|
|
29344
|
+
const draftId = threadId ? null : nonEmpty(draft?.draftId);
|
|
29345
|
+
const draftCwd = threadId ? null : nonEmpty(draft?.cwd);
|
|
29346
|
+
if (!threadId && (!draftId || !draftCwd)) {
|
|
29347
|
+
invalidate();
|
|
29348
|
+
return false;
|
|
29349
|
+
}
|
|
29350
|
+
if (route?.client !== client || route.threadId !== threadId || route.draftId !== draftId || route.draftCwd !== draftCwd) {
|
|
29351
|
+
invalidate();
|
|
29352
|
+
route = {
|
|
29353
|
+
client,
|
|
29354
|
+
threadId,
|
|
29355
|
+
draftId,
|
|
29356
|
+
draftCwd,
|
|
29357
|
+
independent: false,
|
|
29358
|
+
pending: false,
|
|
29359
|
+
checkedAt: 0
|
|
29360
|
+
};
|
|
29361
|
+
check2(route);
|
|
29362
|
+
} else if (!route.pending && Date.now() - route.checkedAt >= REFRESH_MS) {
|
|
29363
|
+
check2(route);
|
|
29364
|
+
}
|
|
29365
|
+
return route.independent;
|
|
29366
|
+
},
|
|
29367
|
+
dispose() {
|
|
29368
|
+
disposed = true;
|
|
29369
|
+
invalidate();
|
|
29370
|
+
}
|
|
29371
|
+
};
|
|
29372
|
+
}
|
|
29373
|
+
|
|
28858
29374
|
// src/agent-group-sync.ts
|
|
28859
29375
|
function startAgentGroupSync(store, getClient, options) {
|
|
28860
29376
|
const owner = options.owner ?? (typeof window === "undefined" ? void 0 : window);
|
|
@@ -29010,15 +29526,42 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29010
29526
|
}
|
|
29011
29527
|
|
|
29012
29528
|
// src/renderer-native-thread.ts
|
|
29013
|
-
function
|
|
29529
|
+
function isRecord5(value) {
|
|
29014
29530
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29015
29531
|
}
|
|
29016
|
-
|
|
29532
|
+
function usesIndependentNativeInference(value, modelProvider) {
|
|
29533
|
+
const config2 = isRecord5(value) ? value.config : null;
|
|
29534
|
+
if (!isRecord5(config2)) return false;
|
|
29535
|
+
const providerId = modelProvider ?? config2.model_provider;
|
|
29536
|
+
if (typeof providerId !== "string") return false;
|
|
29537
|
+
if (["openai", "cc-switch-official", "codexhost"].includes(providerId)) return false;
|
|
29538
|
+
const providers = config2.model_providers;
|
|
29539
|
+
const provider = isRecord5(providers) ? providers[providerId] : null;
|
|
29540
|
+
if (!isRecord5(provider) || typeof provider.base_url !== "string") return false;
|
|
29541
|
+
if (!URL.canParse(provider.base_url)) return false;
|
|
29542
|
+
const endpoint = new URL(provider.base_url);
|
|
29543
|
+
if (!["http:", "https:"].includes(endpoint.protocol)) return false;
|
|
29544
|
+
const hostname3 = endpoint.hostname.replace(/\.$/u, "");
|
|
29545
|
+
if (["openai.com", "chatgpt.com"].some(
|
|
29546
|
+
(domain2) => hostname3 === domain2 || hostname3.endsWith(`.${domain2}`)
|
|
29547
|
+
)) {
|
|
29548
|
+
return false;
|
|
29549
|
+
}
|
|
29550
|
+
return provider.requires_openai_auth === false || typeof provider.experimental_bearer_token === "string" && provider.experimental_bearer_token.trim().length > 0 || typeof provider.env_key === "string" && provider.env_key.trim().length > 0;
|
|
29551
|
+
}
|
|
29552
|
+
async function readNativeCodexThread(sendRequest, threadId) {
|
|
29017
29553
|
const native = await sendRequest("thread/read", { threadId, includeTurns: false });
|
|
29018
|
-
const thread2 =
|
|
29019
|
-
if (!
|
|
29554
|
+
const thread2 = isRecord5(native) ? native.thread : null;
|
|
29555
|
+
if (!isRecord5(thread2) || thread2.id !== threadId || typeof thread2.modelProvider !== "string" || !thread2.modelProvider || thread2.modelProvider === "codexhost" || typeof thread2.cliVersion !== "string" || !thread2.cliVersion || thread2.cliVersion === "codexhost") {
|
|
29020
29556
|
throw new Error("Native Thread response cannot establish Codex ownership");
|
|
29021
29557
|
}
|
|
29558
|
+
return {
|
|
29559
|
+
modelProvider: thread2.modelProvider,
|
|
29560
|
+
cwd: typeof thread2.cwd === "string" && thread2.cwd.trim().length > 0 ? thread2.cwd : null
|
|
29561
|
+
};
|
|
29562
|
+
}
|
|
29563
|
+
async function verifyNativeCodexThread(sendRequest, threadId) {
|
|
29564
|
+
await readNativeCodexThread(sendRequest, threadId);
|
|
29022
29565
|
}
|
|
29023
29566
|
|
|
29024
29567
|
// src/renderer-session-import-client.ts
|
|
@@ -29095,15 +29638,15 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29095
29638
|
var CODEX_ACCOUNT_LIST_METHOD = "codexhost/account/list";
|
|
29096
29639
|
var CODEX_ACCOUNT_REFRESH_METHOD = "codexhost/account/refresh";
|
|
29097
29640
|
var CODEX_ACCOUNT_CHANGED_METHOD = "codexhost/account/changed";
|
|
29098
|
-
function
|
|
29641
|
+
function isRecord6(value) {
|
|
29099
29642
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
29100
29643
|
}
|
|
29101
29644
|
function notifiedThreadId(notification) {
|
|
29102
|
-
if (!
|
|
29645
|
+
if (!isRecord6(notification) || !THREAD_USAGE_REFRESH_METHODS.includes(notification.method)) {
|
|
29103
29646
|
return null;
|
|
29104
29647
|
}
|
|
29105
29648
|
const params = notification.params;
|
|
29106
|
-
if (!
|
|
29649
|
+
if (!isRecord6(params)) return null;
|
|
29107
29650
|
const parsed = hostThreadIdSchema.safeParse(params.threadId);
|
|
29108
29651
|
return parsed.success ? parsed.data : null;
|
|
29109
29652
|
}
|
|
@@ -29183,7 +29726,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29183
29726
|
THREAD_TREE_SNAPSHOT_METHOD,
|
|
29184
29727
|
(message2) => {
|
|
29185
29728
|
const result = threadTreeWatchResultSchema.safeParse(
|
|
29186
|
-
|
|
29729
|
+
isRecord6(message2) ? message2.params : void 0
|
|
29187
29730
|
);
|
|
29188
29731
|
if (!closed && result.success && subscriptionId2 === result.data.subscriptionId && result.data.snapshot.revision > revision) {
|
|
29189
29732
|
revision = result.data.snapshot.revision;
|
|
@@ -29259,6 +29802,31 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29259
29802
|
return harnessConfigurationStateSchema.parse(result);
|
|
29260
29803
|
};
|
|
29261
29804
|
return Object.freeze({
|
|
29805
|
+
async usesIndependentNativeInference(input2) {
|
|
29806
|
+
if (!input2) return false;
|
|
29807
|
+
if ("threadId" in input2) {
|
|
29808
|
+
const thread2 = await readNativeCodexThread(
|
|
29809
|
+
manager.sendRequest,
|
|
29810
|
+
threadInspectionParamsSchema.parse(input2).threadId
|
|
29811
|
+
);
|
|
29812
|
+
if (!thread2.cwd) return false;
|
|
29813
|
+
return usesIndependentNativeInference(
|
|
29814
|
+
await manager.sendRequest("config/read", {
|
|
29815
|
+
includeLayers: false,
|
|
29816
|
+
cwd: thread2.cwd
|
|
29817
|
+
}),
|
|
29818
|
+
thread2.modelProvider
|
|
29819
|
+
);
|
|
29820
|
+
}
|
|
29821
|
+
const cwd = typeof input2.cwd === "string" && input2.cwd.trim().length > 0 ? input2.cwd : null;
|
|
29822
|
+
if (!cwd) return false;
|
|
29823
|
+
return usesIndependentNativeInference(
|
|
29824
|
+
await manager.sendRequest("config/read", {
|
|
29825
|
+
includeLayers: false,
|
|
29826
|
+
cwd
|
|
29827
|
+
})
|
|
29828
|
+
);
|
|
29829
|
+
},
|
|
29262
29830
|
async getHarnessPreferences(scope = "external") {
|
|
29263
29831
|
return harnessPreferenceSnapshotSchema.parse(
|
|
29264
29832
|
await manager.sendRequest(
|
|
@@ -29278,7 +29846,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29278
29846
|
watchThreadTree,
|
|
29279
29847
|
async hasDesktopThread(threadId) {
|
|
29280
29848
|
const result = await manager.sendRequest("thread/read", { threadId, includeTurns: false });
|
|
29281
|
-
return
|
|
29849
|
+
return isRecord6(result) && isRecord6(result.thread) && result.thread.id === threadId;
|
|
29282
29850
|
},
|
|
29283
29851
|
subscribeHarnessPreferences(listener) {
|
|
29284
29852
|
return notificationTarget(source)?.addNotificationCallback?.(
|
|
@@ -29354,7 +29922,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29354
29922
|
},
|
|
29355
29923
|
subscribeSkillsChanged(listener) {
|
|
29356
29924
|
return notificationTarget(source)?.addNotificationCallback?.(SKILLS_CHANGED_METHOD, (value) => {
|
|
29357
|
-
if (!
|
|
29925
|
+
if (!isRecord6(value) || value.method !== SKILLS_CHANGED_METHOD) return;
|
|
29358
29926
|
const parsed = skillsChangedParamsSchema.safeParse(value.params);
|
|
29359
29927
|
if (parsed.success) listener(parsed.data);
|
|
29360
29928
|
}) ?? (() => {
|
|
@@ -29634,7 +30202,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29634
30202
|
throw new Error("Renderer Account notification callback is unavailable");
|
|
29635
30203
|
}
|
|
29636
30204
|
return notifications.addNotificationCallback(CODEX_ACCOUNT_CHANGED_METHOD, (notification) => {
|
|
29637
|
-
if (!
|
|
30205
|
+
if (!isRecord6(notification) || notification.method !== CODEX_ACCOUNT_CHANGED_METHOD) return;
|
|
29638
30206
|
const state = codexAccountChangedSchema.safeParse(notification.params);
|
|
29639
30207
|
if (state.success) listener(state.data);
|
|
29640
30208
|
});
|
|
@@ -29646,14 +30214,14 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29646
30214
|
}
|
|
29647
30215
|
|
|
29648
30216
|
// src/renderer-external-queue.ts
|
|
29649
|
-
function
|
|
30217
|
+
function isRecord7(value) {
|
|
29650
30218
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
29651
30219
|
}
|
|
29652
30220
|
function installRendererExternalQueue(target2) {
|
|
29653
|
-
if (!
|
|
30221
|
+
if (!isRecord7(target2) || typeof target2.getTurnCoordinator !== "function") return null;
|
|
29654
30222
|
const coordinator = target2.getTurnCoordinator();
|
|
29655
|
-
const queue =
|
|
29656
|
-
if (!
|
|
30223
|
+
const queue = isRecord7(coordinator) ? coordinator.serverQueue : null;
|
|
30224
|
+
if (!isRecord7(queue) || typeof queue.isEnabled !== "function") return null;
|
|
29657
30225
|
return () => void 0;
|
|
29658
30226
|
}
|
|
29659
30227
|
|
|
@@ -29682,19 +30250,19 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29682
30250
|
}
|
|
29683
30251
|
|
|
29684
30252
|
// src/renderer-external-steering.ts
|
|
29685
|
-
function
|
|
30253
|
+
function isRecord8(value) {
|
|
29686
30254
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
29687
30255
|
}
|
|
29688
30256
|
function isManager(value) {
|
|
29689
|
-
return
|
|
30257
|
+
return isRecord8(value) && ["sendRequest", "steerTurn", "startTurn", "getTurnCoordinator"].every(
|
|
29690
30258
|
(key2) => typeof value[key2] === "function"
|
|
29691
30259
|
);
|
|
29692
30260
|
}
|
|
29693
30261
|
function submissionHost(manager) {
|
|
29694
30262
|
const coordinator = manager.getTurnCoordinator();
|
|
29695
|
-
const options =
|
|
29696
|
-
const host =
|
|
29697
|
-
if (!
|
|
30263
|
+
const options = isRecord8(coordinator) ? coordinator.options : null;
|
|
30264
|
+
const host = isRecord8(options) ? options.submissionHost : null;
|
|
30265
|
+
if (!isRecord8(host) || typeof host.getActiveTurnId !== "function" || typeof host.hasPendingTurnStart !== "function") {
|
|
29698
30266
|
throw new Error("Desktop turn submission binding is unavailable");
|
|
29699
30267
|
}
|
|
29700
30268
|
return {
|
|
@@ -29736,20 +30304,20 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29736
30304
|
var INTERRUPTED_QUEUE_REASON = "Interrupted before the steer was accepted.";
|
|
29737
30305
|
async function preserveQueuedFollowUps(manager, threadId) {
|
|
29738
30306
|
const coordinator = manager.getTurnCoordinator();
|
|
29739
|
-
if (!
|
|
30307
|
+
if (!isRecord8(coordinator) || typeof coordinator.loadMessages !== "function" || typeof coordinator.readMessages !== "function" || typeof coordinator.mutate !== "function") {
|
|
29740
30308
|
throw new Error("Desktop follow-up queue binding is unavailable");
|
|
29741
30309
|
}
|
|
29742
30310
|
await coordinator.loadMessages.call(coordinator, threadId);
|
|
29743
30311
|
const messages = coordinator.readMessages.call(coordinator, threadId);
|
|
29744
30312
|
if (!Array.isArray(messages)) throw new Error("Desktop follow-up queue is unavailable");
|
|
29745
30313
|
const alreadyPaused = new Set(
|
|
29746
|
-
messages.filter((message2) =>
|
|
30314
|
+
messages.filter((message2) => isRecord8(message2) && message2.pausedReason != null).map((message2) => message2.id)
|
|
29747
30315
|
);
|
|
29748
30316
|
return () => {
|
|
29749
30317
|
coordinator.mutate.call(coordinator, threadId, (current) => {
|
|
29750
30318
|
if (!Array.isArray(current)) return current;
|
|
29751
30319
|
return current.map((message2) => {
|
|
29752
|
-
if (!
|
|
30320
|
+
if (!isRecord8(message2) || alreadyPaused.has(message2.id) || message2.pausedReason !== INTERRUPTED_QUEUE_REASON)
|
|
29753
30321
|
return message2;
|
|
29754
30322
|
const resumed = { ...message2 };
|
|
29755
30323
|
delete resumed.pausedReason;
|
|
@@ -29771,16 +30339,16 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29771
30339
|
if ((method === "turn/start" || method === "turn/steer") && prepareTurnInput) {
|
|
29772
30340
|
params = prepareTurnInput(params);
|
|
29773
30341
|
}
|
|
29774
|
-
const messageId =
|
|
29775
|
-
const route = typeof messageId === "string" &&
|
|
29776
|
-
if (method !== "turn/start" || !
|
|
30342
|
+
const messageId = isRecord8(params) ? params.clientUserMessageId : null;
|
|
30343
|
+
const route = typeof messageId === "string" && isRecord8(params) ? routes.get(`${params.threadId}\0${messageId}`) : void 0;
|
|
30344
|
+
if (method !== "turn/start" || !isRecord8(params) || !route || route.threadId !== params.threadId) {
|
|
29777
30345
|
if (method === "turn/start" && sendTurnStart) {
|
|
29778
30346
|
return sendTurnStart(params, (input2) => {
|
|
29779
30347
|
if (disposed) throw new Error("External submission binding was disposed");
|
|
29780
30348
|
return originalSend.call(manager, method, input2, options);
|
|
29781
30349
|
});
|
|
29782
30350
|
}
|
|
29783
|
-
if (method === "turn/steer" &&
|
|
30351
|
+
if (method === "turn/steer" && isRecord8(params) && typeof params.threadId === "string" && activeTurnSteers.has(params.threadId)) {
|
|
29784
30352
|
params = { ...params, [THREAD_STEER_DELIVERY_PARAM]: "activeTurn" };
|
|
29785
30353
|
}
|
|
29786
30354
|
return originalSend.call(manager, method, params, options);
|
|
@@ -29803,7 +30371,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29803
30371
|
options
|
|
29804
30372
|
)
|
|
29805
30373
|
).then((response) => {
|
|
29806
|
-
if (!
|
|
30374
|
+
if (!isRecord8(response) || typeof response.turnId !== "string" || !response.turnId) {
|
|
29807
30375
|
throw new Error("External steering returned no replacement Turn identity");
|
|
29808
30376
|
}
|
|
29809
30377
|
return {
|
|
@@ -29841,7 +30409,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29841
30409
|
] = args;
|
|
29842
30410
|
if (typeof threadId !== "string") return originalSteer.apply(manager, args);
|
|
29843
30411
|
const role = manager.getStreamRole?.(threadId);
|
|
29844
|
-
if (
|
|
30412
|
+
if (isRecord8(role) && role.role === "follower") return originalSteer.apply(manager, args);
|
|
29845
30413
|
let host = null;
|
|
29846
30414
|
let expectedTurnId;
|
|
29847
30415
|
try {
|
|
@@ -29849,7 +30417,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29849
30417
|
expectedTurnId = host.getActiveTurnId(threadId);
|
|
29850
30418
|
} catch {
|
|
29851
30419
|
}
|
|
29852
|
-
const text2 = Array.isArray(input2) ? input2.filter((item) =>
|
|
30420
|
+
const text2 = Array.isArray(input2) ? input2.filter((item) => isRecord8(item) && typeof item.text === "string").map((item) => item.text).join("\n") : void 0;
|
|
29853
30421
|
const delivery = await inspectDelivery(threadId, text2);
|
|
29854
30422
|
if (disposed) throw new Error("External steering binding was disposed");
|
|
29855
30423
|
if (delivery === "official") return originalSteer.apply(manager, args);
|
|
@@ -29865,21 +30433,21 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29865
30433
|
}
|
|
29866
30434
|
if (!host) throw new Error("Desktop turn submission binding is unavailable");
|
|
29867
30435
|
const currentRole = manager.getStreamRole?.(threadId);
|
|
29868
|
-
if (
|
|
30436
|
+
if (isRecord8(currentRole) && currentRole.role === "follower")
|
|
29869
30437
|
return originalSteer.apply(manager, args);
|
|
29870
30438
|
if (!Array.isArray(input2) || input2.length === 0 || input2.some((item) => {
|
|
29871
|
-
if (!
|
|
30439
|
+
if (!isRecord8(item)) return true;
|
|
29872
30440
|
if (item.type === "text") return typeof item.text !== "string";
|
|
29873
30441
|
if (item.type === "localImage") return typeof item.path !== "string" || !item.path;
|
|
29874
30442
|
if (item.type === "image") return typeof item.url !== "string" || !item.url;
|
|
29875
30443
|
return true;
|
|
29876
30444
|
}) || !input2.some(
|
|
29877
|
-
(item) =>
|
|
30445
|
+
(item) => isRecord8(item) && (item.type !== "text" || typeof item.text === "string" && item.text.trim())
|
|
29878
30446
|
)) {
|
|
29879
30447
|
throw new Error("External steering requires non-empty text or image input");
|
|
29880
30448
|
}
|
|
29881
30449
|
if (toolOutput != null) throw new Error("External steering cannot replace a tool response");
|
|
29882
|
-
if (!
|
|
30450
|
+
if (!isRecord8(restoreMessage) || !isRecord8(restoreMessage.context)) {
|
|
29883
30451
|
throw new Error("Desktop steering message context is unavailable");
|
|
29884
30452
|
}
|
|
29885
30453
|
const messageId = typeof clientUserMessageId === "string" && clientUserMessageId ? clientUserMessageId : typeof restoreMessage.id === "string" && restoreMessage.id ? restoreMessage.id : crypto.randomUUID();
|
|
@@ -29929,7 +30497,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29929
30497
|
},
|
|
29930
30498
|
onMessageAdded
|
|
29931
30499
|
);
|
|
29932
|
-
if (!
|
|
30500
|
+
if (!isRecord8(response) || !isRecord8(response.turn) || typeof response.turn.id !== "string") {
|
|
29933
30501
|
throw new Error("Desktop returned no replacement Turn identity");
|
|
29934
30502
|
}
|
|
29935
30503
|
try {
|
|
@@ -29960,7 +30528,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
29960
30528
|
}
|
|
29961
30529
|
|
|
29962
30530
|
// src/renderer-remote-attachments.ts
|
|
29963
|
-
function
|
|
30531
|
+
function isRecord9(value) {
|
|
29964
30532
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
29965
30533
|
}
|
|
29966
30534
|
var MAX_IMAGE_BYTES = 20 * 1024 * 1024;
|
|
@@ -30002,14 +30570,14 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
30002
30570
|
function createRemoteAttachmentSender(target2, hostId2, isCurrent) {
|
|
30003
30571
|
const prepared = /* @__PURE__ */ new WeakMap();
|
|
30004
30572
|
return (params, send) => {
|
|
30005
|
-
if (hostId2 === "local" || !
|
|
30573
|
+
if (hostId2 === "local" || !isRecord9(target2) || !isRecord9(params) || typeof params.threadId !== "string" || !Array.isArray(params.input) || typeof target2.getConversation !== "function")
|
|
30006
30574
|
return send(params);
|
|
30007
30575
|
const images = params.input.filter(
|
|
30008
|
-
(item) =>
|
|
30576
|
+
(item) => isRecord9(item) && (item.type === "image" || item.type === "localImage")
|
|
30009
30577
|
);
|
|
30010
30578
|
if (images.length === 0) return send(params);
|
|
30011
30579
|
const conversation = target2.getConversation.call(target2, params.threadId);
|
|
30012
|
-
if (!
|
|
30580
|
+
if (!isRecord9(conversation) || conversation.id !== params.threadId || conversation.modelProvider !== "codexhost")
|
|
30013
30581
|
return send(params);
|
|
30014
30582
|
const assertCurrent = () => {
|
|
30015
30583
|
if (!isCurrent()) throw new Error("Remote attachment connection is no longer available");
|
|
@@ -30022,7 +30590,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
30022
30590
|
const cached2 = prepared.get(params);
|
|
30023
30591
|
if (cached2) return cached2.then(dispatch);
|
|
30024
30592
|
const input2 = params.input;
|
|
30025
|
-
const text2 = input2.filter((item) =>
|
|
30593
|
+
const text2 = input2.filter((item) => isRecord9(item) && item.type === "text").map((item) => isRecord9(item) && typeof item.text === "string" ? item.text : "").join("\n");
|
|
30026
30594
|
const existingPaths = desktopImageAttachmentPaths(text2);
|
|
30027
30595
|
const prepare = async () => {
|
|
30028
30596
|
if (existingPaths.length === images.length) return params;
|
|
@@ -30054,7 +30622,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
30054
30622
|
contents: file2.contents,
|
|
30055
30623
|
label: `image-${index + 1}.${file2.extension}`
|
|
30056
30624
|
});
|
|
30057
|
-
if (!
|
|
30625
|
+
if (!isRecord9(saved) || !filePath2(saved.path) || saved.fsPath !== saved.path) {
|
|
30058
30626
|
throw new Error("Desktop returned an invalid remote attachment path");
|
|
30059
30627
|
}
|
|
30060
30628
|
created.push(saved.path);
|
|
@@ -30223,11 +30791,11 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
30223
30791
|
}
|
|
30224
30792
|
|
|
30225
30793
|
// src/renderer-manual-compaction.ts
|
|
30226
|
-
function
|
|
30794
|
+
function isRecord10(value) {
|
|
30227
30795
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
30228
30796
|
}
|
|
30229
30797
|
function installRendererManualCompaction(target2, hostId2, messages) {
|
|
30230
|
-
if (!messages || typeof messages.addEventListener !== "function" || typeof messages.removeEventListener !== "function" || !
|
|
30798
|
+
if (!messages || typeof messages.addEventListener !== "function" || typeof messages.removeEventListener !== "function" || !isRecord10(target2) || typeof target2.registerPendingManualContextCompaction !== "function" || typeof target2.getConversation !== "function") {
|
|
30231
30799
|
return null;
|
|
30232
30800
|
}
|
|
30233
30801
|
const register2 = target2.registerPendingManualContextCompaction;
|
|
@@ -30236,18 +30804,18 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
30236
30804
|
const listener = (event) => {
|
|
30237
30805
|
if (event.source != null && event.source !== messages) return;
|
|
30238
30806
|
const message2 = event.data;
|
|
30239
|
-
if (!
|
|
30807
|
+
if (!isRecord10(message2) || message2.type !== "mcp-notification" || message2.hostId !== hostId2 || message2.method !== THREAD_MANUAL_COMPACTION_STARTED_METHOD) {
|
|
30240
30808
|
return;
|
|
30241
30809
|
}
|
|
30242
30810
|
const params = threadManualCompactionStartedSchema.safeParse(message2.params);
|
|
30243
30811
|
if (!params.success) return;
|
|
30244
30812
|
const { threadId } = params.data;
|
|
30245
30813
|
const conversation = getConversation.call(target2, threadId);
|
|
30246
|
-
if (!
|
|
30814
|
+
if (!isRecord10(conversation) || conversation.id !== threadId || conversation.modelProvider !== "codexhost") {
|
|
30247
30815
|
return;
|
|
30248
30816
|
}
|
|
30249
30817
|
const role = getStreamRole?.call(target2, threadId);
|
|
30250
|
-
if (
|
|
30818
|
+
if (isRecord10(role) && role.role === "follower") return;
|
|
30251
30819
|
register2.call(target2, threadId);
|
|
30252
30820
|
};
|
|
30253
30821
|
messages.addEventListener("message", listener);
|
|
@@ -30424,7 +30992,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
30424
30992
|
var SIDEBAR_AGENT_ICON_ATTRIBUTE = "data-codexhost-sidebar-agent-icon";
|
|
30425
30993
|
var SIDEBAR_AGENT_ICON_ROW_SELECTOR = `${SIDEBAR_THREAD_ROW_SELECTOR}, ${NATIVE_SCHEDULE_SIDEBAR_ROW_SELECTOR}`;
|
|
30426
30994
|
var OWNERSHIP_RETRY_DELAYS_MS = [100, 300, 800, 1500, 3e3];
|
|
30427
|
-
function
|
|
30995
|
+
function isRecord11(value) {
|
|
30428
30996
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
30429
30997
|
}
|
|
30430
30998
|
function sidebarThreadAttributes(element) {
|
|
@@ -30451,19 +31019,19 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
30451
31019
|
const fiberName = fiberNames[0];
|
|
30452
31020
|
if (fiberNames.length !== 1 || !fiberName) return null;
|
|
30453
31021
|
const firstFiber2 = Object.getOwnPropertyDescriptor(element, fiberName)?.value;
|
|
30454
|
-
if (!
|
|
31022
|
+
if (!isRecord11(firstFiber2)) return null;
|
|
30455
31023
|
const candidates = /* @__PURE__ */ new Set();
|
|
30456
31024
|
let fiber = firstFiber2;
|
|
30457
31025
|
for (let depth = 0; fiber && depth < 12; depth += 1) {
|
|
30458
31026
|
const props = fiber.memoizedProps;
|
|
30459
|
-
if (
|
|
31027
|
+
if (isRecord11(props) && isRecord11(props.dataAttributes)) {
|
|
30460
31028
|
const dataAttributes = props.dataAttributes;
|
|
30461
31029
|
const threadId = hostThreadIdSchema.safeParse(props.conversationId);
|
|
30462
31030
|
if (threadId.success && dataAttributes[SIDEBAR_THREAD_ROW_ATTRIBUTE] === rowMarker && dataAttributes[SIDEBAR_THREAD_ID_ATTRIBUTE] === taskKey && dataAttributes[SIDEBAR_THREAD_HOST_ID_ATTRIBUTE] === hostId2) {
|
|
30463
31031
|
candidates.add(threadId.data);
|
|
30464
31032
|
}
|
|
30465
31033
|
}
|
|
30466
|
-
fiber =
|
|
31034
|
+
fiber = isRecord11(fiber.return) ? fiber.return : null;
|
|
30467
31035
|
}
|
|
30468
31036
|
return candidates.size === 1 ? candidates.values().next().value ?? null : null;
|
|
30469
31037
|
}
|
|
@@ -30960,7 +31528,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
30960
31528
|
if (row) finish(row);
|
|
30961
31529
|
});
|
|
30962
31530
|
}
|
|
30963
|
-
function
|
|
31531
|
+
function isRecord12(value) {
|
|
30964
31532
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
30965
31533
|
}
|
|
30966
31534
|
function firstFiber(element) {
|
|
@@ -30970,7 +31538,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
30970
31538
|
const name = names[0];
|
|
30971
31539
|
if (names.length !== 1 || !name) return null;
|
|
30972
31540
|
const value = Object.getOwnPropertyDescriptor(element, name)?.value;
|
|
30973
|
-
return
|
|
31541
|
+
return isRecord12(value) ? value : null;
|
|
30974
31542
|
}
|
|
30975
31543
|
function directForkAncestors(first) {
|
|
30976
31544
|
const ancestors2 = [];
|
|
@@ -30980,7 +31548,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
30980
31548
|
if (seen.has(fiber)) return [];
|
|
30981
31549
|
seen.add(fiber);
|
|
30982
31550
|
ancestors2.push(fiber);
|
|
30983
|
-
fiber =
|
|
31551
|
+
fiber = isRecord12(fiber.return) ? fiber.return : null;
|
|
30984
31552
|
}
|
|
30985
31553
|
return ancestors2;
|
|
30986
31554
|
}
|
|
@@ -30998,7 +31566,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
30998
31566
|
let hasForkCallback = false;
|
|
30999
31567
|
for (const fiber of ancestors2) {
|
|
31000
31568
|
const props = fiber.memoizedProps;
|
|
31001
|
-
if (!
|
|
31569
|
+
if (!isRecord12(props)) continue;
|
|
31002
31570
|
if (!hasForkCallback && typeof props.onFork !== "function" && ownsOtherCallback(fiber, props)) {
|
|
31003
31571
|
return null;
|
|
31004
31572
|
}
|
|
@@ -31030,7 +31598,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31030
31598
|
if (!threadId.success || !turnId.success) return null;
|
|
31031
31599
|
const fiber = firstFiber(button2);
|
|
31032
31600
|
const buttonProps = fiber?.memoizedProps;
|
|
31033
|
-
if (!fiber || !
|
|
31601
|
+
if (!fiber || !isRecord12(buttonProps) || !Object.hasOwn(buttonProps, "aria-busy")) return null;
|
|
31034
31602
|
return forkTargetFromAncestors(button2, threadId.data, turnId.data, directForkAncestors(fiber)) ?? forkTargetFromAncestors(button2, threadId.data, turnId.data, committedReactAncestors(fiber));
|
|
31035
31603
|
}
|
|
31036
31604
|
var BrowserRendererForkDom = class {
|
|
@@ -31120,7 +31688,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31120
31688
|
}
|
|
31121
31689
|
var DRAFT_PREWARM_POLICY_WAIT_TIMEOUT_MS = 1e4;
|
|
31122
31690
|
var DRAFT_PREWARM_POLICY_POLL_INTERVAL_MS = 25;
|
|
31123
|
-
function
|
|
31691
|
+
function isRecord13(value) {
|
|
31124
31692
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31125
31693
|
}
|
|
31126
31694
|
function decodeOpenCodeTransportModelId(value) {
|
|
@@ -31285,7 +31853,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31285
31853
|
let fiber = findComposerFiber(composer);
|
|
31286
31854
|
for (let depth = 0; fiber && depth < 120; depth += 1) {
|
|
31287
31855
|
const props = fiber.memoizedProps;
|
|
31288
|
-
if (
|
|
31856
|
+
if (isRecord13(props) && "conversationId" in props && props.conversationId != null) {
|
|
31289
31857
|
const candidate = hostThreadIdSchema.safeParse(props.conversationId);
|
|
31290
31858
|
if (!candidate.success || threadId !== void 0 && threadId !== candidate.data) {
|
|
31291
31859
|
return null;
|
|
@@ -31298,12 +31866,12 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31298
31866
|
return threadId;
|
|
31299
31867
|
}
|
|
31300
31868
|
function isLegacySevenSlotDraftWrapper(value) {
|
|
31301
|
-
if (!Array.isArray(value) || value.length !== 7 || value[3] !== value[5] || value[3] !== value[6] || !
|
|
31869
|
+
if (!Array.isArray(value) || value.length !== 7 || value[3] !== value[5] || value[3] !== value[6] || !isRecord13(value[3]) || typeof value[3].get !== "function" || typeof value[2] !== "string" && value[2] !== null) {
|
|
31302
31870
|
return false;
|
|
31303
31871
|
}
|
|
31304
31872
|
try {
|
|
31305
31873
|
const draft = value[3].get();
|
|
31306
|
-
return
|
|
31874
|
+
return isRecord13(draft) && "modelSettings" in draft && "isManuallyChanged" in draft;
|
|
31307
31875
|
} catch {
|
|
31308
31876
|
return false;
|
|
31309
31877
|
}
|
|
@@ -31337,8 +31905,8 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31337
31905
|
let fiber = findComposerFiber(composer);
|
|
31338
31906
|
for (let depth = 0; fiber && depth < 120; depth += 1) {
|
|
31339
31907
|
const updateQueue = fiber.updateQueue;
|
|
31340
|
-
const memoCache =
|
|
31341
|
-
const data =
|
|
31908
|
+
const memoCache = isRecord13(updateQueue) ? updateQueue.memoCache : null;
|
|
31909
|
+
const data = isRecord13(memoCache) && Array.isArray(memoCache.data) ? memoCache.data : [];
|
|
31342
31910
|
for (const value of data) {
|
|
31343
31911
|
const draftId = draftIdFromMemoValue(value);
|
|
31344
31912
|
if (draftId) draftIds.add(draftId);
|
|
@@ -31366,7 +31934,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31366
31934
|
return ["default", draftIds.values().next().value];
|
|
31367
31935
|
}
|
|
31368
31936
|
function isDraftPrewarmPolicyReady(value) {
|
|
31369
|
-
return
|
|
31937
|
+
return isRecord13(value) && value.state === "ready" && typeof value.hostId === "string" && value.hostId.length > 0 && typeof value.select === "function" && typeof value.clear === "function";
|
|
31370
31938
|
}
|
|
31371
31939
|
async function waitForRendererDraftPrewarmPolicy(target2, composer) {
|
|
31372
31940
|
const deadline = Date.now() + DRAFT_PREWARM_POLICY_WAIT_TIMEOUT_MS;
|
|
@@ -31472,6 +32040,10 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31472
32040
|
forkThread: (input2) => currentModelClient().forkThread(input2),
|
|
31473
32041
|
inspectHarness: (...args) => currentModelClient().inspectHarness(...args),
|
|
31474
32042
|
inspectThread: (input2) => currentModelClient().inspectThread(input2),
|
|
32043
|
+
usesIndependentNativeInference: async (input2) => {
|
|
32044
|
+
const client = currentModelClient();
|
|
32045
|
+
return client.usesIndependentNativeInference ? client.usesIndependentNativeInference(input2) : false;
|
|
32046
|
+
},
|
|
31475
32047
|
inspectHarnessCommands: (input2) => currentModelClient().inspectHarnessCommands(input2),
|
|
31476
32048
|
inspectThreadCommands: (input2) => currentModelClient().inspectThreadCommands(input2),
|
|
31477
32049
|
executeThreadCommand: (input2) => currentModelClient().executeThreadCommand(input2),
|
|
@@ -31660,11 +32232,11 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31660
32232
|
return null;
|
|
31661
32233
|
}
|
|
31662
32234
|
}
|
|
31663
|
-
function
|
|
32235
|
+
function isRecord14(value) {
|
|
31664
32236
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31665
32237
|
}
|
|
31666
32238
|
function parseExternalConfiguration(value) {
|
|
31667
|
-
if (!
|
|
32239
|
+
if (!isRecord14(value)) return void 0;
|
|
31668
32240
|
const model2 = harnessModelRefSchema.safeParse(value.model);
|
|
31669
32241
|
if (!model2.success) return void 0;
|
|
31670
32242
|
const thinkingOptionId = harnessThinkingOptionIdSchema.safeParse(value.thinkingOptionId);
|
|
@@ -31681,10 +32253,10 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31681
32253
|
const raw = storage.getItem(RENDERER_NEW_THREAD_PREFERENCE_KEY);
|
|
31682
32254
|
if (!raw) return void 0;
|
|
31683
32255
|
const parsed = JSON.parse(raw);
|
|
31684
|
-
if (!
|
|
32256
|
+
if (!isRecord14(parsed) || parsed.version !== 1) return void 0;
|
|
31685
32257
|
if (parsed.lastAgent !== "codex" && !harnessPluginIdSchema.safeParse(parsed.lastAgent).success)
|
|
31686
32258
|
return void 0;
|
|
31687
|
-
const externalByAgent =
|
|
32259
|
+
const externalByAgent = isRecord14(parsed.externalByAgent) ? parsed.externalByAgent : {};
|
|
31688
32260
|
const parsedExternal = Object.fromEntries(
|
|
31689
32261
|
Object.keys(externalByAgent).filter((agent) => harnessPluginIdSchema.safeParse(agent).success).flatMap((agent) => {
|
|
31690
32262
|
const configuration = parseExternalConfiguration(externalByAgent[agent]);
|
|
@@ -31829,16 +32401,16 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31829
32401
|
// src/codex-locale-adapter.ts
|
|
31830
32402
|
var DEFAULT_LOCALE_REQUEST_TIMEOUT_MS = 750;
|
|
31831
32403
|
function isNativeLocaleServices(value) {
|
|
31832
|
-
if (!
|
|
32404
|
+
if (!isRecord15(value) || !Object.hasOwn(value, "appInfo")) return false;
|
|
31833
32405
|
const appInfo = value.appInfo;
|
|
31834
32406
|
return appInfo != null && typeof appInfo.getLocaleInfo === "function";
|
|
31835
32407
|
}
|
|
31836
32408
|
function isNativeSettingsServices(value) {
|
|
31837
|
-
if (!
|
|
32409
|
+
if (!isRecord15(value) || !Object.hasOwn(value, "settings")) return false;
|
|
31838
32410
|
const settings = value.settings;
|
|
31839
32411
|
return typeof settings?.read === "function" && typeof settings?.write === "function";
|
|
31840
32412
|
}
|
|
31841
|
-
function
|
|
32413
|
+
function isRecord15(value) {
|
|
31842
32414
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
31843
32415
|
}
|
|
31844
32416
|
function canonicalLocale(value) {
|
|
@@ -31860,7 +32432,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31860
32432
|
return new DOMException("The operation was aborted", "AbortError");
|
|
31861
32433
|
}
|
|
31862
32434
|
function parseLocaleOverride(response) {
|
|
31863
|
-
if (!
|
|
32435
|
+
if (!isRecord15(response) || !Object.hasOwn(response, "effective")) {
|
|
31864
32436
|
throw new Error("Codex native locale override response is malformed");
|
|
31865
32437
|
}
|
|
31866
32438
|
if (response.effective === null) return null;
|
|
@@ -31875,7 +32447,7 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
31875
32447
|
return locale;
|
|
31876
32448
|
}
|
|
31877
32449
|
function parseLocaleInfo(value) {
|
|
31878
|
-
if (!
|
|
32450
|
+
if (!isRecord15(value)) throw new Error("Codex locale info response is malformed");
|
|
31879
32451
|
return {
|
|
31880
32452
|
ideLocale: optionalLocale(value.ideLocale, "IDE locale"),
|
|
31881
32453
|
systemLocale: optionalLocale(value.systemLocale, "system locale")
|
|
@@ -33472,6 +34044,9 @@ ${text2.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
33472
34044
|
const roundedM = Math.round(normalized / 1e6 * 10) / 10;
|
|
33473
34045
|
return `${Number.isInteger(roundedM) ? roundedM.toFixed(0) : roundedM.toFixed(1)}m`;
|
|
33474
34046
|
}
|
|
34047
|
+
function formatPositiveExtensionCount(count3) {
|
|
34048
|
+
return isValidExtensionCount(count3) && count3 > 0 ? formatExtensionCount(count3) : null;
|
|
34049
|
+
}
|
|
33475
34050
|
function arrayBufferToBase64(buffer) {
|
|
33476
34051
|
const bytes = new Uint8Array(buffer);
|
|
33477
34052
|
const chunkSize = 32768;
|
|
@@ -38953,8 +39528,6 @@ ${detail}` : ""}`
|
|
|
38953
39528
|
iconUrl: iconUrl2,
|
|
38954
39529
|
author,
|
|
38955
39530
|
version: version2,
|
|
38956
|
-
repository,
|
|
38957
|
-
stars,
|
|
38958
39531
|
downloads,
|
|
38959
39532
|
trustTier,
|
|
38960
39533
|
statusState,
|
|
@@ -39068,21 +39641,25 @@ ${detail}` : ""}`
|
|
|
39068
39641
|
card.append(body);
|
|
39069
39642
|
}
|
|
39070
39643
|
if (update) {
|
|
39644
|
+
card.dataset.updateAvailable = "true";
|
|
39071
39645
|
const row = createEl(document2, "div", "settings-extensions-card__update");
|
|
39072
39646
|
row.dataset.updateAvailable = "true";
|
|
39073
39647
|
update.action.addEventListener("click", stopTrigger);
|
|
39074
39648
|
update.action.addEventListener("keydown", stopTrigger);
|
|
39075
|
-
|
|
39649
|
+
const label = createEl(
|
|
39650
|
+
document2,
|
|
39651
|
+
"span",
|
|
39652
|
+
"settings-extensions-card__update-label",
|
|
39653
|
+
update.label
|
|
39654
|
+
);
|
|
39655
|
+
row.append(label, update.action);
|
|
39076
39656
|
card.append(row);
|
|
39077
39657
|
}
|
|
39078
39658
|
const authorVersion = formatAuthorVersion(author, version2);
|
|
39079
|
-
const
|
|
39080
|
-
const formattedStars = isValidExtensionCount(stars) ? formatExtensionCount(stars) : null;
|
|
39081
|
-
const formattedDownloads = isValidExtensionCount(downloads) ? formatExtensionCount(downloads) : null;
|
|
39659
|
+
const formattedDownloads = formatPositiveExtensionCount(downloads);
|
|
39082
39660
|
const categoryLabels = (categories ?? []).slice(0, MAX_CARD_CATEGORIES).map((category) => contentCopy.categories[category] ?? category);
|
|
39083
39661
|
const categoriesText = categoryLabels.join(" \xB7 ");
|
|
39084
|
-
|
|
39085
|
-
if (authorVersion || repositoryHref || formattedStars || formattedDownloads || categoriesText) {
|
|
39662
|
+
if (authorVersion || formattedDownloads || categoriesText) {
|
|
39086
39663
|
const metaRow = createEl(document2, "div", "settings-extensions-card__meta");
|
|
39087
39664
|
const metaLeft = createEl(document2, "div", "settings-extensions-card__meta-left");
|
|
39088
39665
|
if (authorVersion) {
|
|
@@ -39095,35 +39672,6 @@ ${detail}` : ""}`
|
|
|
39095
39672
|
authorVersionWrap.title = authorVersion;
|
|
39096
39673
|
metaLeft.append(authorVersionWrap);
|
|
39097
39674
|
}
|
|
39098
|
-
if (repositoryHref) {
|
|
39099
|
-
const starLink = createEl(
|
|
39100
|
-
document2,
|
|
39101
|
-
"a",
|
|
39102
|
-
"settings-extensions-card__star settings-extensions-card__star--link"
|
|
39103
|
-
);
|
|
39104
|
-
starLink.href = repositoryHref;
|
|
39105
|
-
starLink.target = "_blank";
|
|
39106
|
-
starLink.rel = "noopener noreferrer";
|
|
39107
|
-
starLink.dataset.action = "open-repository";
|
|
39108
|
-
const label = formattedStars ? `${copy.githubRepository} \xB7 ${formattedStars}` : copy.githubRepository;
|
|
39109
|
-
starLink.title = label;
|
|
39110
|
-
starLink.setAttribute("aria-label", label);
|
|
39111
|
-
starLink.append(createRendererSettingsIcon("star", 11));
|
|
39112
|
-
if (formattedStars) {
|
|
39113
|
-
starLink.append(createEl(document2, "span", "", formattedStars));
|
|
39114
|
-
}
|
|
39115
|
-
starLink.addEventListener("click", stopTrigger);
|
|
39116
|
-
starLink.addEventListener("keydown", stopTrigger);
|
|
39117
|
-
starControl = starLink;
|
|
39118
|
-
metaLeft.append(starLink);
|
|
39119
|
-
} else if (formattedStars) {
|
|
39120
|
-
const starBadge = createEl(document2, "span", "settings-extensions-card__star");
|
|
39121
|
-
starBadge.append(
|
|
39122
|
-
createRendererSettingsIcon("star", 11),
|
|
39123
|
-
createEl(document2, "span", "", formattedStars)
|
|
39124
|
-
);
|
|
39125
|
-
metaLeft.append(starBadge);
|
|
39126
|
-
}
|
|
39127
39675
|
if (formattedDownloads) {
|
|
39128
39676
|
const downloadsBadge = createEl(document2, "span", "settings-extensions-card__downloads");
|
|
39129
39677
|
downloadsBadge.dataset.metric = "downloads";
|
|
@@ -39151,12 +39699,10 @@ ${detail}` : ""}`
|
|
|
39151
39699
|
}
|
|
39152
39700
|
card.addEventListener("click", (event) => {
|
|
39153
39701
|
if (isWithinElement(event.target, actionWrap)) return;
|
|
39154
|
-
if (starControl && isWithinElement(event.target, starControl)) return;
|
|
39155
39702
|
onOpenDetails();
|
|
39156
39703
|
});
|
|
39157
39704
|
card.addEventListener("keydown", (event) => {
|
|
39158
39705
|
if (isWithinElement(event.target, actionWrap)) return;
|
|
39159
|
-
if (starControl && isWithinElement(event.target, starControl)) return;
|
|
39160
39706
|
if (event.key === "Enter" || event.key === " ") {
|
|
39161
39707
|
event.preventDefault();
|
|
39162
39708
|
onOpenDetails();
|
|
@@ -39675,20 +40221,17 @@ ${detail}` : ""}`
|
|
|
39675
40221
|
let settingsSection = null;
|
|
39676
40222
|
let descriptionSection = null;
|
|
39677
40223
|
let screenshotsSection = null;
|
|
39678
|
-
let previewStage = null;
|
|
39679
|
-
let previewImage = null;
|
|
39680
|
-
let previewCounter = null;
|
|
39681
|
-
let previewPrevButton = null;
|
|
39682
|
-
let previewNextButton = null;
|
|
39683
40224
|
let galleryGrid = null;
|
|
40225
|
+
let lightboxDialog = null;
|
|
40226
|
+
let lightboxImage = null;
|
|
40227
|
+
let lightboxCounter = null;
|
|
40228
|
+
let lightboxPrevButton = null;
|
|
40229
|
+
let lightboxNextButton = null;
|
|
40230
|
+
let lightboxReturnFocus = null;
|
|
39684
40231
|
let currentScreenshots = [];
|
|
39685
40232
|
let currentDisplayName = "";
|
|
39686
|
-
const
|
|
39687
|
-
if (!
|
|
39688
|
-
const total = currentScreenshots.length;
|
|
39689
|
-
if (activeScreenshotIndex !== null && (activeScreenshotIndex < 0 || activeScreenshotIndex >= total)) {
|
|
39690
|
-
activeScreenshotIndex = null;
|
|
39691
|
-
}
|
|
40233
|
+
const syncThumbPressed = () => {
|
|
40234
|
+
if (!galleryGrid) return;
|
|
39692
40235
|
const thumbButtons = galleryGrid.children;
|
|
39693
40236
|
for (let i = 0; i < thumbButtons.length; i += 1) {
|
|
39694
40237
|
const button2 = thumbButtons[i];
|
|
@@ -39696,28 +40239,138 @@ ${detail}` : ""}`
|
|
|
39696
40239
|
button2.setAttribute("aria-pressed", String(activeScreenshotIndex === i));
|
|
39697
40240
|
}
|
|
39698
40241
|
}
|
|
39699
|
-
|
|
39700
|
-
|
|
39701
|
-
|
|
39702
|
-
|
|
40242
|
+
};
|
|
40243
|
+
const cleanupLightbox = () => {
|
|
40244
|
+
const previous = lightboxDialog;
|
|
40245
|
+
const restore = lightboxReturnFocus;
|
|
40246
|
+
lightboxDialog = null;
|
|
40247
|
+
lightboxImage = null;
|
|
40248
|
+
lightboxCounter = null;
|
|
40249
|
+
lightboxPrevButton = null;
|
|
40250
|
+
lightboxNextButton = null;
|
|
40251
|
+
lightboxReturnFocus = null;
|
|
40252
|
+
activeScreenshotIndex = null;
|
|
40253
|
+
previous?.remove();
|
|
40254
|
+
syncThumbPressed();
|
|
40255
|
+
if (restore && restore.isConnected && typeof restore.focus === "function") {
|
|
40256
|
+
restore.focus();
|
|
40257
|
+
}
|
|
40258
|
+
};
|
|
40259
|
+
const closeLightbox = () => {
|
|
40260
|
+
if (!lightboxDialog) {
|
|
40261
|
+
activeScreenshotIndex = null;
|
|
40262
|
+
syncThumbPressed();
|
|
40263
|
+
return;
|
|
40264
|
+
}
|
|
40265
|
+
if (lightboxDialog.open) {
|
|
40266
|
+
lightboxDialog.close();
|
|
40267
|
+
} else {
|
|
40268
|
+
cleanupLightbox();
|
|
40269
|
+
}
|
|
40270
|
+
};
|
|
40271
|
+
const syncLightbox = () => {
|
|
40272
|
+
const total = currentScreenshots.length;
|
|
40273
|
+
if (activeScreenshotIndex === null || total === 0 || activeScreenshotIndex < 0 || activeScreenshotIndex >= total) {
|
|
40274
|
+
closeLightbox();
|
|
39703
40275
|
return;
|
|
39704
40276
|
}
|
|
39705
40277
|
const activeUrl = currentScreenshots[activeScreenshotIndex];
|
|
39706
40278
|
if (!activeUrl) {
|
|
39707
|
-
|
|
39708
|
-
previewImage.src = "";
|
|
39709
|
-
previewImage.alt = "";
|
|
40279
|
+
closeLightbox();
|
|
39710
40280
|
return;
|
|
39711
40281
|
}
|
|
39712
|
-
|
|
39713
|
-
|
|
39714
|
-
|
|
39715
|
-
|
|
39716
|
-
|
|
39717
|
-
|
|
39718
|
-
|
|
39719
|
-
|
|
39720
|
-
|
|
40282
|
+
if (!lightboxDialog) {
|
|
40283
|
+
const modal = createEl(document2, "dialog", "settings-extensions-lightbox");
|
|
40284
|
+
modal.setAttribute("aria-label", copy.screenshotsTitle);
|
|
40285
|
+
modal.tabIndex = -1;
|
|
40286
|
+
lightboxImage = createEl(document2, "img", "settings-extensions-lightbox__img");
|
|
40287
|
+
const closeBtn = createEl(
|
|
40288
|
+
document2,
|
|
40289
|
+
"button",
|
|
40290
|
+
"settings-extensions-lightbox__btn settings-extensions-lightbox__close"
|
|
40291
|
+
);
|
|
40292
|
+
closeBtn.type = "button";
|
|
40293
|
+
closeBtn.title = copy.closePreview;
|
|
40294
|
+
closeBtn.setAttribute("aria-label", copy.closePreview);
|
|
40295
|
+
closeBtn.append(createRendererSettingsIcon("close", 16));
|
|
40296
|
+
closeBtn.addEventListener("click", () => modal.close());
|
|
40297
|
+
lightboxPrevButton = createEl(
|
|
40298
|
+
document2,
|
|
40299
|
+
"button",
|
|
40300
|
+
"settings-extensions-lightbox__btn settings-extensions-lightbox__nav settings-extensions-lightbox__nav--prev"
|
|
40301
|
+
);
|
|
40302
|
+
lightboxPrevButton.type = "button";
|
|
40303
|
+
lightboxPrevButton.title = copy.previousScreenshot;
|
|
40304
|
+
lightboxPrevButton.setAttribute("aria-label", copy.previousScreenshot);
|
|
40305
|
+
lightboxPrevButton.append(createRendererSettingsIcon("chevron-left", 18));
|
|
40306
|
+
lightboxPrevButton.addEventListener("click", () => {
|
|
40307
|
+
if (activeScreenshotIndex === null || currentScreenshots.length <= 1) return;
|
|
40308
|
+
activeScreenshotIndex = (activeScreenshotIndex - 1 + currentScreenshots.length) % currentScreenshots.length;
|
|
40309
|
+
syncLightbox();
|
|
40310
|
+
});
|
|
40311
|
+
lightboxNextButton = createEl(
|
|
40312
|
+
document2,
|
|
40313
|
+
"button",
|
|
40314
|
+
"settings-extensions-lightbox__btn settings-extensions-lightbox__nav settings-extensions-lightbox__nav--next"
|
|
40315
|
+
);
|
|
40316
|
+
lightboxNextButton.type = "button";
|
|
40317
|
+
lightboxNextButton.title = copy.nextScreenshot;
|
|
40318
|
+
lightboxNextButton.setAttribute("aria-label", copy.nextScreenshot);
|
|
40319
|
+
lightboxNextButton.append(createRendererSettingsIcon("chevron-right", 18));
|
|
40320
|
+
lightboxNextButton.addEventListener("click", () => {
|
|
40321
|
+
if (activeScreenshotIndex === null || currentScreenshots.length <= 1) return;
|
|
40322
|
+
activeScreenshotIndex = (activeScreenshotIndex + 1) % currentScreenshots.length;
|
|
40323
|
+
syncLightbox();
|
|
40324
|
+
});
|
|
40325
|
+
lightboxCounter = createEl(document2, "span", "settings-extensions-lightbox__count");
|
|
40326
|
+
modal.append(
|
|
40327
|
+
lightboxImage,
|
|
40328
|
+
closeBtn,
|
|
40329
|
+
lightboxPrevButton,
|
|
40330
|
+
lightboxNextButton,
|
|
40331
|
+
lightboxCounter
|
|
40332
|
+
);
|
|
40333
|
+
modal.addEventListener("click", (event) => {
|
|
40334
|
+
if (event.target === modal) modal.close();
|
|
40335
|
+
});
|
|
40336
|
+
modal.addEventListener("keydown", (event) => {
|
|
40337
|
+
if (event.key === "Escape") {
|
|
40338
|
+
event.preventDefault();
|
|
40339
|
+
event.stopPropagation?.();
|
|
40340
|
+
modal.close();
|
|
40341
|
+
} else if (event.key === "ArrowLeft" && currentScreenshots.length > 1) {
|
|
40342
|
+
event.preventDefault();
|
|
40343
|
+
event.stopPropagation?.();
|
|
40344
|
+
activeScreenshotIndex = ((activeScreenshotIndex ?? 0) - 1 + currentScreenshots.length) % currentScreenshots.length;
|
|
40345
|
+
syncLightbox();
|
|
40346
|
+
} else if (event.key === "ArrowRight" && currentScreenshots.length > 1) {
|
|
40347
|
+
event.preventDefault();
|
|
40348
|
+
event.stopPropagation?.();
|
|
40349
|
+
activeScreenshotIndex = ((activeScreenshotIndex ?? 0) + 1) % currentScreenshots.length;
|
|
40350
|
+
syncLightbox();
|
|
40351
|
+
}
|
|
40352
|
+
});
|
|
40353
|
+
modal.addEventListener("close", cleanupLightbox);
|
|
40354
|
+
lightboxDialog = modal;
|
|
40355
|
+
host.append(modal);
|
|
40356
|
+
modal.showModal();
|
|
40357
|
+
modal.focus();
|
|
40358
|
+
}
|
|
40359
|
+
if (lightboxImage) {
|
|
40360
|
+
lightboxImage.src = activeUrl;
|
|
40361
|
+
lightboxImage.alt = formatMessage(copy.screenshotAlt, {
|
|
40362
|
+
name: currentDisplayName,
|
|
40363
|
+
index: String(activeScreenshotIndex + 1)
|
|
40364
|
+
});
|
|
40365
|
+
}
|
|
40366
|
+
const multi = total > 1;
|
|
40367
|
+
if (lightboxPrevButton) lightboxPrevButton.hidden = !multi;
|
|
40368
|
+
if (lightboxNextButton) lightboxNextButton.hidden = !multi;
|
|
40369
|
+
if (lightboxCounter) {
|
|
40370
|
+
lightboxCounter.hidden = !multi;
|
|
40371
|
+
lightboxCounter.textContent = multi ? `${activeScreenshotIndex + 1} / ${total}` : "";
|
|
40372
|
+
}
|
|
40373
|
+
syncThumbPressed();
|
|
39721
40374
|
};
|
|
39722
40375
|
const renderScreenshots = (extensionId, installed, catalogEntry, displayName) => {
|
|
39723
40376
|
if (!screenshotsSection || !galleryGrid) return;
|
|
@@ -39726,21 +40379,20 @@ ${detail}` : ""}`
|
|
|
39726
40379
|
currentDisplayName = displayName;
|
|
39727
40380
|
if (urls.length === 0) {
|
|
39728
40381
|
renderedScreenshotsKey = "";
|
|
39729
|
-
activeScreenshotIndex = null;
|
|
39730
40382
|
screenshotsSection.hidden = true;
|
|
39731
40383
|
galleryGrid.replaceChildren();
|
|
39732
|
-
|
|
40384
|
+
closeLightbox();
|
|
39733
40385
|
return;
|
|
39734
40386
|
}
|
|
39735
40387
|
screenshotsSection.hidden = false;
|
|
39736
40388
|
const signature = `${extensionId}\0${urls.join("\0")}`;
|
|
39737
40389
|
if (signature === renderedScreenshotsKey) {
|
|
39738
|
-
|
|
40390
|
+
if (activeScreenshotIndex !== null) syncLightbox();
|
|
39739
40391
|
return;
|
|
39740
40392
|
}
|
|
39741
40393
|
renderedScreenshotsKey = signature;
|
|
39742
40394
|
if (activeScreenshotIndex !== null && activeScreenshotIndex >= urls.length) {
|
|
39743
|
-
|
|
40395
|
+
closeLightbox();
|
|
39744
40396
|
}
|
|
39745
40397
|
const thumbs = [];
|
|
39746
40398
|
for (let i = 0; i < urls.length; i += 1) {
|
|
@@ -39766,13 +40418,14 @@ ${detail}` : ""}`
|
|
|
39766
40418
|
image.loading = "lazy";
|
|
39767
40419
|
thumbButton.append(image);
|
|
39768
40420
|
thumbButton.addEventListener("click", () => {
|
|
39769
|
-
|
|
39770
|
-
|
|
40421
|
+
lightboxReturnFocus = thumbButton;
|
|
40422
|
+
activeScreenshotIndex = i;
|
|
40423
|
+
syncLightbox();
|
|
39771
40424
|
});
|
|
39772
40425
|
thumbs.push(thumbButton);
|
|
39773
40426
|
}
|
|
39774
40427
|
galleryGrid.replaceChildren(...thumbs);
|
|
39775
|
-
|
|
40428
|
+
if (activeScreenshotIndex !== null) syncLightbox();
|
|
39776
40429
|
};
|
|
39777
40430
|
const renderInlineSettings = (installed, contentLocale) => {
|
|
39778
40431
|
if (!settingsSection) return;
|
|
@@ -40385,8 +41038,8 @@ ${detail}` : ""}`
|
|
|
40385
41038
|
const repositoryHref = parseSafeRepositoryUrl(
|
|
40386
41039
|
(installed?.state === "valid" ? installed.manifest.repository : void 0) ?? catalogEntry?.repository
|
|
40387
41040
|
);
|
|
40388
|
-
const formattedStars =
|
|
40389
|
-
const formattedDownloads =
|
|
41041
|
+
const formattedStars = formatPositiveExtensionCount(catalogEntry?.stars);
|
|
41042
|
+
const formattedDownloads = formatPositiveExtensionCount(catalogEntry?.downloads);
|
|
40390
41043
|
if (repositoryHref) {
|
|
40391
41044
|
const repoLink = createEl(document2, "a", "settings-extensions-detail-modal__repo");
|
|
40392
41045
|
repoLink.href = repositoryHref;
|
|
@@ -40472,6 +41125,7 @@ ${detail}` : ""}`
|
|
|
40472
41125
|
};
|
|
40473
41126
|
const cleanup = () => {
|
|
40474
41127
|
signal.removeEventListener("abort", cleanup);
|
|
41128
|
+
closeLightbox();
|
|
40475
41129
|
settingsLoadToken += 1;
|
|
40476
41130
|
const previous = dialog;
|
|
40477
41131
|
dialog = null;
|
|
@@ -40499,11 +41153,6 @@ ${detail}` : ""}`
|
|
|
40499
41153
|
settingsSection = null;
|
|
40500
41154
|
descriptionSection = null;
|
|
40501
41155
|
screenshotsSection = null;
|
|
40502
|
-
previewStage = null;
|
|
40503
|
-
previewImage = null;
|
|
40504
|
-
previewCounter = null;
|
|
40505
|
-
previewPrevButton = null;
|
|
40506
|
-
previewNextButton = null;
|
|
40507
41156
|
galleryGrid = null;
|
|
40508
41157
|
previous?.remove();
|
|
40509
41158
|
onClose?.();
|
|
@@ -40585,60 +41234,8 @@ ${detail}` : ""}`
|
|
|
40585
41234
|
"settings-extensions-detail-modal__section-title",
|
|
40586
41235
|
copy.screenshotsTitle
|
|
40587
41236
|
);
|
|
40588
|
-
previewStage = createEl(document2, "div", "settings-extensions-detail-modal__preview");
|
|
40589
|
-
previewStage.hidden = true;
|
|
40590
|
-
previewImage = createEl(document2, "img", "settings-extensions-detail-modal__preview-img");
|
|
40591
|
-
const previewBar = createEl(document2, "div", "settings-extensions-detail-modal__preview-bar");
|
|
40592
|
-
previewCounter = createEl(document2, "span", "settings-extensions-detail-modal__preview-count");
|
|
40593
|
-
const previewControls = createEl(
|
|
40594
|
-
document2,
|
|
40595
|
-
"div",
|
|
40596
|
-
"settings-extensions-detail-modal__preview-controls"
|
|
40597
|
-
);
|
|
40598
|
-
previewPrevButton = createEl(
|
|
40599
|
-
document2,
|
|
40600
|
-
"button",
|
|
40601
|
-
"settings-icon-button settings-extensions-detail-modal__preview-nav"
|
|
40602
|
-
);
|
|
40603
|
-
previewPrevButton.type = "button";
|
|
40604
|
-
previewPrevButton.title = copy.previousScreenshot;
|
|
40605
|
-
previewPrevButton.setAttribute("aria-label", copy.previousScreenshot);
|
|
40606
|
-
previewPrevButton.append(createRendererSettingsIcon("chevron-left", 14));
|
|
40607
|
-
previewPrevButton.addEventListener("click", () => {
|
|
40608
|
-
if (activeScreenshotIndex === null || currentScreenshots.length <= 1) return;
|
|
40609
|
-
activeScreenshotIndex = (activeScreenshotIndex - 1 + currentScreenshots.length) % currentScreenshots.length;
|
|
40610
|
-
syncPreviewStage();
|
|
40611
|
-
});
|
|
40612
|
-
previewNextButton = createEl(
|
|
40613
|
-
document2,
|
|
40614
|
-
"button",
|
|
40615
|
-
"settings-icon-button settings-extensions-detail-modal__preview-nav"
|
|
40616
|
-
);
|
|
40617
|
-
previewNextButton.type = "button";
|
|
40618
|
-
previewNextButton.title = copy.nextScreenshot;
|
|
40619
|
-
previewNextButton.setAttribute("aria-label", copy.nextScreenshot);
|
|
40620
|
-
previewNextButton.append(createRendererSettingsIcon("chevron-right", 14));
|
|
40621
|
-
previewNextButton.addEventListener("click", () => {
|
|
40622
|
-
if (activeScreenshotIndex === null || currentScreenshots.length <= 1) return;
|
|
40623
|
-
activeScreenshotIndex = (activeScreenshotIndex + 1) % currentScreenshots.length;
|
|
40624
|
-
syncPreviewStage();
|
|
40625
|
-
});
|
|
40626
|
-
const closePreviewButton = createEl(
|
|
40627
|
-
document2,
|
|
40628
|
-
"button",
|
|
40629
|
-
"settings-extensions-detail-modal__preview-close",
|
|
40630
|
-
copy.closePreview
|
|
40631
|
-
);
|
|
40632
|
-
closePreviewButton.type = "button";
|
|
40633
|
-
closePreviewButton.addEventListener("click", () => {
|
|
40634
|
-
activeScreenshotIndex = null;
|
|
40635
|
-
syncPreviewStage();
|
|
40636
|
-
});
|
|
40637
|
-
previewControls.append(previewPrevButton, previewNextButton, closePreviewButton);
|
|
40638
|
-
previewBar.append(previewCounter, previewControls);
|
|
40639
|
-
previewStage.append(previewImage, previewBar);
|
|
40640
41237
|
galleryGrid = createEl(document2, "div", "settings-extensions-detail-modal__gallery");
|
|
40641
|
-
screenshotsSection.append(screenshotsHeading,
|
|
41238
|
+
screenshotsSection.append(screenshotsHeading, galleryGrid);
|
|
40642
41239
|
modalBody.append(
|
|
40643
41240
|
feedbackBar,
|
|
40644
41241
|
attentionBar,
|
|
@@ -40656,8 +41253,7 @@ ${detail}` : ""}`
|
|
|
40656
41253
|
event.preventDefault();
|
|
40657
41254
|
event.stopPropagation?.();
|
|
40658
41255
|
if (activeScreenshotIndex !== null) {
|
|
40659
|
-
|
|
40660
|
-
syncPreviewStage();
|
|
41256
|
+
closeLightbox();
|
|
40661
41257
|
return;
|
|
40662
41258
|
}
|
|
40663
41259
|
modal.close();
|
|
@@ -40665,8 +41261,7 @@ ${detail}` : ""}`
|
|
|
40665
41261
|
modal.addEventListener("cancel", (event) => {
|
|
40666
41262
|
if (activeScreenshotIndex !== null) {
|
|
40667
41263
|
event.preventDefault();
|
|
40668
|
-
|
|
40669
|
-
syncPreviewStage();
|
|
41264
|
+
closeLightbox();
|
|
40670
41265
|
}
|
|
40671
41266
|
});
|
|
40672
41267
|
modal.addEventListener("close", cleanup);
|
|
@@ -40691,7 +41286,7 @@ ${detail}` : ""}`
|
|
|
40691
41286
|
const { installed, catalogEntry } = resolveEntries(extensionId, state);
|
|
40692
41287
|
if (!installed && !catalogEntry) return;
|
|
40693
41288
|
if (openExtensionId !== extensionId) {
|
|
40694
|
-
|
|
41289
|
+
closeLightbox();
|
|
40695
41290
|
renderedIconKey = "";
|
|
40696
41291
|
renderedScreenshotsKey = "";
|
|
40697
41292
|
renderedDetailsKey = "";
|
|
@@ -41272,8 +41867,6 @@ ${detail}` : ""}`
|
|
|
41272
41867
|
iconUrl: entry.icon,
|
|
41273
41868
|
author: entry.author,
|
|
41274
41869
|
version: entry.version,
|
|
41275
|
-
repository: entry.repository,
|
|
41276
|
-
stars: entry.stars,
|
|
41277
41870
|
downloads: entry.downloads,
|
|
41278
41871
|
trustTier: entry.trustTier,
|
|
41279
41872
|
description: catalogDescription(entry, contentLocale),
|
|
@@ -41954,7 +42547,7 @@ ${detail}` : ""}`
|
|
|
41954
42547
|
const button2 = createEl(
|
|
41955
42548
|
document2,
|
|
41956
42549
|
"button",
|
|
41957
|
-
"settings-command-button settings-
|
|
42550
|
+
"settings-command-button settings-extensions-card__button settings-extensions-card__update-button",
|
|
41958
42551
|
updating ? copy.updating : copy.update
|
|
41959
42552
|
);
|
|
41960
42553
|
button2.type = "button";
|
|
@@ -41982,8 +42575,6 @@ ${detail}` : ""}`
|
|
|
41982
42575
|
iconUrl: resolveInstalledExtensionIconUrl(item, catalogEntry),
|
|
41983
42576
|
author: (item.state === "valid" ? item.manifest.author : void 0) ?? catalogEntry?.author,
|
|
41984
42577
|
version: item.state === "valid" ? item.manifest.version : void 0,
|
|
41985
|
-
repository: (item.state === "valid" ? item.manifest.repository : void 0) ?? catalogEntry?.repository,
|
|
41986
|
-
stars: catalogEntry?.stars,
|
|
41987
42578
|
downloads: catalogEntry?.downloads,
|
|
41988
42579
|
trustTier: catalogEntry?.trustTier,
|
|
41989
42580
|
statusState,
|
|
@@ -46460,6 +47051,7 @@ ${detail}` : ""}`
|
|
|
46460
47051
|
return messages.updateInstallationWindowsInstaller;
|
|
46461
47052
|
}
|
|
46462
47053
|
if (installation === "macos-dmg") return messages.updateInstallationMacOsDmg;
|
|
47054
|
+
if (installation === "linux-archive") return messages.updateInstallationLinuxArchive;
|
|
46463
47055
|
return messages.updateInstallationUnknown;
|
|
46464
47056
|
}
|
|
46465
47057
|
function isPendingStatus(status) {
|
|
@@ -50504,7 +51096,6 @@ ${detail}` : ""}`
|
|
|
50504
51096
|
white-space: nowrap;
|
|
50505
51097
|
}
|
|
50506
51098
|
|
|
50507
|
-
.settings-extensions-card__star,
|
|
50508
51099
|
.settings-extensions-card__downloads {
|
|
50509
51100
|
display: inline-flex;
|
|
50510
51101
|
align-items: center;
|
|
@@ -50519,19 +51110,13 @@ ${detail}` : ""}`
|
|
|
50519
51110
|
transition: color 140ms ease;
|
|
50520
51111
|
}
|
|
50521
51112
|
|
|
50522
|
-
.settings-extensions-
|
|
50523
|
-
|
|
50524
|
-
padding: 0 2px;
|
|
50525
|
-
cursor: pointer;
|
|
51113
|
+
.settings-extensions-card[data-update-available="true"] {
|
|
51114
|
+
border-color: color-mix(in srgb, var(--settings-focus) 34%, var(--settings-border));
|
|
50526
51115
|
}
|
|
50527
51116
|
|
|
50528
|
-
.settings-extensions-
|
|
50529
|
-
color: var(--settings-
|
|
50530
|
-
|
|
50531
|
-
|
|
50532
|
-
.settings-extensions-card__star--link:focus-visible {
|
|
50533
|
-
outline: 2px solid var(--settings-focus);
|
|
50534
|
-
outline-offset: 2px;
|
|
51117
|
+
.settings-extensions-card[data-update-available="true"]:hover {
|
|
51118
|
+
border-color: color-mix(in srgb, var(--settings-focus) 54%, var(--settings-border));
|
|
51119
|
+
box-shadow: 0 4px 14px color-mix(in srgb, var(--settings-focus) 12%, transparent);
|
|
50535
51120
|
}
|
|
50536
51121
|
|
|
50537
51122
|
.settings-extensions-card__update {
|
|
@@ -50539,7 +51124,12 @@ ${detail}` : ""}`
|
|
|
50539
51124
|
flex-wrap: wrap;
|
|
50540
51125
|
align-items: center;
|
|
50541
51126
|
justify-content: space-between;
|
|
50542
|
-
gap:
|
|
51127
|
+
gap: 6px 10px;
|
|
51128
|
+
margin-top: 2px;
|
|
51129
|
+
padding: 6px 8px 6px 10px;
|
|
51130
|
+
border: 1px solid color-mix(in srgb, var(--settings-focus) 24%, transparent);
|
|
51131
|
+
border-radius: 9px;
|
|
51132
|
+
background: color-mix(in srgb, var(--settings-focus) 9%, transparent);
|
|
50543
51133
|
color: var(--settings-focus);
|
|
50544
51134
|
font-size: 12px;
|
|
50545
51135
|
font-weight: 600;
|
|
@@ -50547,6 +51137,29 @@ ${detail}` : ""}`
|
|
|
50547
51137
|
overflow-wrap: anywhere;
|
|
50548
51138
|
}
|
|
50549
51139
|
|
|
51140
|
+
.settings-extensions-card__update-label {
|
|
51141
|
+
display: inline-flex;
|
|
51142
|
+
align-items: center;
|
|
51143
|
+
gap: 7px;
|
|
51144
|
+
font-variant-numeric: tabular-nums;
|
|
51145
|
+
}
|
|
51146
|
+
|
|
51147
|
+
.settings-extensions-card__update-label::before {
|
|
51148
|
+
content: "";
|
|
51149
|
+
flex: none;
|
|
51150
|
+
width: 6px;
|
|
51151
|
+
height: 6px;
|
|
51152
|
+
border-radius: 50%;
|
|
51153
|
+
background: var(--settings-focus);
|
|
51154
|
+
box-shadow: 0 0 0 3px color-mix(in srgb, var(--settings-focus) 20%, transparent);
|
|
51155
|
+
}
|
|
51156
|
+
|
|
51157
|
+
.settings-extensions-card__update .settings-extensions-card__update-button {
|
|
51158
|
+
min-height: 26px;
|
|
51159
|
+
padding: 3px 11px;
|
|
51160
|
+
font-weight: 600;
|
|
51161
|
+
}
|
|
51162
|
+
|
|
50550
51163
|
.settings-extensions-card__categories-text {
|
|
50551
51164
|
flex: 0 1 auto;
|
|
50552
51165
|
max-width: 52%;
|
|
@@ -51294,8 +51907,8 @@ dialog.settings-account-dialog.settings-extensions-create-dialog::backdrop {
|
|
|
51294
51907
|
.settings-extensions-detail-modal__alert[hidden],
|
|
51295
51908
|
.settings-extensions-detail-modal__description[hidden],
|
|
51296
51909
|
.settings-extensions-detail-modal__screenshots[hidden],
|
|
51297
|
-
.settings-extensions-
|
|
51298
|
-
.settings-extensions-
|
|
51910
|
+
.settings-extensions-lightbox__nav[hidden],
|
|
51911
|
+
.settings-extensions-lightbox__count[hidden] {
|
|
51299
51912
|
display: none;
|
|
51300
51913
|
}
|
|
51301
51914
|
|
|
@@ -51461,68 +52074,9 @@ dialog.settings-account-dialog.settings-extensions-create-dialog::backdrop {
|
|
|
51461
52074
|
line-height: 16px;
|
|
51462
52075
|
}
|
|
51463
52076
|
|
|
51464
|
-
.settings-extensions-detail-modal__preview {
|
|
51465
|
-
display: grid;
|
|
51466
|
-
gap: 8px;
|
|
51467
|
-
padding: 10px;
|
|
51468
|
-
background: var(--settings-inset);
|
|
51469
|
-
border: 1px solid var(--settings-border);
|
|
51470
|
-
border-radius: 10px;
|
|
51471
|
-
}
|
|
51472
|
-
|
|
51473
|
-
.settings-extensions-detail-modal__preview-img {
|
|
51474
|
-
display: block;
|
|
51475
|
-
width: 100%;
|
|
51476
|
-
max-height: 340px;
|
|
51477
|
-
object-fit: contain;
|
|
51478
|
-
background: var(--settings-surface);
|
|
51479
|
-
border-radius: 7px;
|
|
51480
|
-
}
|
|
51481
|
-
|
|
51482
|
-
.settings-extensions-detail-modal__preview-bar {
|
|
51483
|
-
display: flex;
|
|
51484
|
-
align-items: center;
|
|
51485
|
-
justify-content: space-between;
|
|
51486
|
-
gap: 8px;
|
|
51487
|
-
}
|
|
51488
|
-
|
|
51489
|
-
.settings-extensions-detail-modal__preview-count {
|
|
51490
|
-
color: var(--settings-subtle);
|
|
51491
|
-
font-size: 11.5px;
|
|
51492
|
-
font-variant-numeric: tabular-nums;
|
|
51493
|
-
}
|
|
51494
|
-
|
|
51495
|
-
.settings-extensions-detail-modal__preview-controls {
|
|
51496
|
-
display: flex;
|
|
51497
|
-
align-items: center;
|
|
51498
|
-
gap: 4px;
|
|
51499
|
-
}
|
|
51500
|
-
|
|
51501
|
-
.settings-extensions-detail-modal__preview-close {
|
|
51502
|
-
height: 24px;
|
|
51503
|
-
padding: 0 8px;
|
|
51504
|
-
color: var(--settings-muted);
|
|
51505
|
-
font: inherit;
|
|
51506
|
-
font-size: 11.5px;
|
|
51507
|
-
background: var(--settings-panel);
|
|
51508
|
-
border: 1px solid var(--settings-border);
|
|
51509
|
-
border-radius: 6px;
|
|
51510
|
-
cursor: pointer;
|
|
51511
|
-
}
|
|
51512
|
-
|
|
51513
|
-
.settings-extensions-detail-modal__preview-close:hover {
|
|
51514
|
-
color: var(--settings-text);
|
|
51515
|
-
background: var(--settings-hover);
|
|
51516
|
-
}
|
|
51517
|
-
|
|
51518
|
-
.settings-extensions-detail-modal__preview-close:focus-visible {
|
|
51519
|
-
outline: 2px solid var(--settings-focus);
|
|
51520
|
-
outline-offset: 1px;
|
|
51521
|
-
}
|
|
51522
|
-
|
|
51523
52077
|
.settings-extensions-detail-modal__gallery {
|
|
51524
52078
|
display: grid;
|
|
51525
|
-
grid-template-columns: repeat(auto-fill, minmax(
|
|
52079
|
+
grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
|
|
51526
52080
|
gap: 8px;
|
|
51527
52081
|
}
|
|
51528
52082
|
|
|
@@ -51534,15 +52088,16 @@ dialog.settings-account-dialog.settings-extensions-create-dialog::backdrop {
|
|
|
51534
52088
|
background: var(--settings-inset);
|
|
51535
52089
|
border: 1.5px solid var(--settings-border);
|
|
51536
52090
|
border-radius: 8px;
|
|
51537
|
-
cursor:
|
|
52091
|
+
cursor: zoom-in;
|
|
51538
52092
|
transition:
|
|
51539
|
-
border-color
|
|
51540
|
-
transform
|
|
51541
|
-
box-shadow
|
|
52093
|
+
border-color 140ms ease,
|
|
52094
|
+
transform 140ms ease,
|
|
52095
|
+
box-shadow 140ms ease;
|
|
51542
52096
|
}
|
|
51543
52097
|
|
|
51544
52098
|
.settings-extensions-detail-modal__thumb:hover {
|
|
51545
52099
|
border-color: var(--settings-focus);
|
|
52100
|
+
box-shadow: 0 4px 12px light-dark(rgb(15 23 42 / 10%), rgb(0 0 0 / 32%));
|
|
51546
52101
|
}
|
|
51547
52102
|
|
|
51548
52103
|
.settings-extensions-detail-modal__thumb[aria-pressed="true"] {
|
|
@@ -51562,6 +52117,131 @@ dialog.settings-account-dialog.settings-extensions-create-dialog::backdrop {
|
|
|
51562
52117
|
object-fit: cover;
|
|
51563
52118
|
}
|
|
51564
52119
|
|
|
52120
|
+
dialog.settings-extensions-lightbox {
|
|
52121
|
+
position: fixed;
|
|
52122
|
+
inset: 0;
|
|
52123
|
+
width: 100vw;
|
|
52124
|
+
height: 100vh;
|
|
52125
|
+
max-width: none;
|
|
52126
|
+
max-height: none;
|
|
52127
|
+
margin: 0;
|
|
52128
|
+
padding: 28px 72px 68px;
|
|
52129
|
+
box-sizing: border-box;
|
|
52130
|
+
overflow: hidden;
|
|
52131
|
+
background: transparent;
|
|
52132
|
+
border: 0;
|
|
52133
|
+
}
|
|
52134
|
+
|
|
52135
|
+
dialog.settings-extensions-lightbox[open] {
|
|
52136
|
+
display: grid;
|
|
52137
|
+
place-items: center;
|
|
52138
|
+
}
|
|
52139
|
+
|
|
52140
|
+
dialog.settings-extensions-lightbox:focus {
|
|
52141
|
+
outline: none;
|
|
52142
|
+
}
|
|
52143
|
+
|
|
52144
|
+
dialog.settings-extensions-lightbox::backdrop {
|
|
52145
|
+
background: rgb(10 13 20 / 78%);
|
|
52146
|
+
-webkit-backdrop-filter: blur(12px) saturate(130%);
|
|
52147
|
+
backdrop-filter: blur(12px) saturate(130%);
|
|
52148
|
+
animation: settings-extensions-backdrop-in 160ms ease-out;
|
|
52149
|
+
}
|
|
52150
|
+
|
|
52151
|
+
.settings-extensions-lightbox__img {
|
|
52152
|
+
display: block;
|
|
52153
|
+
max-width: min(calc(100vw - 144px), 1560px);
|
|
52154
|
+
max-height: calc(100vh - 96px);
|
|
52155
|
+
object-fit: contain;
|
|
52156
|
+
background: rgb(18 22 30 / 60%);
|
|
52157
|
+
border: 1px solid rgb(255 255 255 / 14%);
|
|
52158
|
+
border-radius: 12px;
|
|
52159
|
+
box-shadow: 0 24px 64px rgb(0 0 0 / 48%);
|
|
52160
|
+
animation: settings-extensions-dialog-in 180ms cubic-bezier(0.22, 1, 0.36, 1);
|
|
52161
|
+
}
|
|
52162
|
+
|
|
52163
|
+
.settings-extensions-lightbox__btn {
|
|
52164
|
+
position: fixed;
|
|
52165
|
+
display: inline-flex;
|
|
52166
|
+
align-items: center;
|
|
52167
|
+
justify-content: center;
|
|
52168
|
+
padding: 0;
|
|
52169
|
+
color: rgb(255 255 255 / 92%);
|
|
52170
|
+
background: rgb(24 28 36 / 74%);
|
|
52171
|
+
border: 1px solid rgb(255 255 255 / 16%);
|
|
52172
|
+
border-radius: 999px;
|
|
52173
|
+
-webkit-backdrop-filter: blur(16px) saturate(150%);
|
|
52174
|
+
backdrop-filter: blur(16px) saturate(150%);
|
|
52175
|
+
box-shadow: 0 8px 24px rgb(0 0 0 / 32%);
|
|
52176
|
+
cursor: pointer;
|
|
52177
|
+
transition:
|
|
52178
|
+
background-color 140ms ease,
|
|
52179
|
+
border-color 140ms ease,
|
|
52180
|
+
transform 100ms ease;
|
|
52181
|
+
}
|
|
52182
|
+
|
|
52183
|
+
.settings-extensions-lightbox__btn:hover {
|
|
52184
|
+
color: #fff;
|
|
52185
|
+
background: rgb(42 48 60 / 88%);
|
|
52186
|
+
border-color: rgb(255 255 255 / 28%);
|
|
52187
|
+
}
|
|
52188
|
+
|
|
52189
|
+
.settings-extensions-lightbox__btn:focus-visible {
|
|
52190
|
+
outline: 2px solid #fff;
|
|
52191
|
+
outline-offset: 2px;
|
|
52192
|
+
}
|
|
52193
|
+
|
|
52194
|
+
.settings-extensions-lightbox__close {
|
|
52195
|
+
top: 18px;
|
|
52196
|
+
right: 18px;
|
|
52197
|
+
width: 36px;
|
|
52198
|
+
height: 36px;
|
|
52199
|
+
}
|
|
52200
|
+
|
|
52201
|
+
.settings-extensions-lightbox__nav {
|
|
52202
|
+
top: 50%;
|
|
52203
|
+
width: 38px;
|
|
52204
|
+
height: 38px;
|
|
52205
|
+
transform: translateY(-50%);
|
|
52206
|
+
}
|
|
52207
|
+
|
|
52208
|
+
.settings-extensions-lightbox__nav--prev {
|
|
52209
|
+
left: 18px;
|
|
52210
|
+
}
|
|
52211
|
+
|
|
52212
|
+
.settings-extensions-lightbox__nav--next {
|
|
52213
|
+
right: 18px;
|
|
52214
|
+
}
|
|
52215
|
+
|
|
52216
|
+
.settings-extensions-lightbox__count {
|
|
52217
|
+
position: fixed;
|
|
52218
|
+
bottom: 18px;
|
|
52219
|
+
left: 50%;
|
|
52220
|
+
padding: 5px 12px;
|
|
52221
|
+
color: rgb(255 255 255 / 90%);
|
|
52222
|
+
font-size: 12px;
|
|
52223
|
+
font-weight: 500;
|
|
52224
|
+
line-height: 16px;
|
|
52225
|
+
font-variant-numeric: tabular-nums;
|
|
52226
|
+
background: rgb(24 28 36 / 74%);
|
|
52227
|
+
border: 1px solid rgb(255 255 255 / 16%);
|
|
52228
|
+
border-radius: 999px;
|
|
52229
|
+
-webkit-backdrop-filter: blur(16px) saturate(150%);
|
|
52230
|
+
backdrop-filter: blur(16px) saturate(150%);
|
|
52231
|
+
transform: translateX(-50%);
|
|
52232
|
+
}
|
|
52233
|
+
|
|
52234
|
+
@media (max-width: 640px) {
|
|
52235
|
+
dialog.settings-extensions-lightbox {
|
|
52236
|
+
padding: 56px 14px 64px;
|
|
52237
|
+
}
|
|
52238
|
+
|
|
52239
|
+
.settings-extensions-lightbox__img {
|
|
52240
|
+
max-width: calc(100vw - 28px);
|
|
52241
|
+
max-height: calc(100vh - 120px);
|
|
52242
|
+
}
|
|
52243
|
+
}
|
|
52244
|
+
|
|
51565
52245
|
.settings-extensions .settings-command-button--danger {
|
|
51566
52246
|
flex: none;
|
|
51567
52247
|
color: var(--settings-danger);
|
|
@@ -52046,7 +52726,9 @@ dialog.settings-account-dialog.settings-extensions-create-dialog::backdrop {
|
|
|
52046
52726
|
dialog.settings-account-dialog.settings-extensions-create-dialog[open],
|
|
52047
52727
|
dialog.settings-account-dialog.settings-extensions-detail-dialog::backdrop,
|
|
52048
52728
|
dialog.settings-account-dialog.settings-extensions-import-dialog::backdrop,
|
|
52049
|
-
dialog.settings-account-dialog.settings-extensions-create-dialog::backdrop
|
|
52729
|
+
dialog.settings-account-dialog.settings-extensions-create-dialog::backdrop,
|
|
52730
|
+
dialog.settings-extensions-lightbox::backdrop,
|
|
52731
|
+
.settings-extensions-lightbox__img {
|
|
52050
52732
|
animation: none;
|
|
52051
52733
|
}
|
|
52052
52734
|
}
|
|
@@ -55592,6 +56274,68 @@ ${selector}::after{content:attr(agent-mention-display-name);}`;
|
|
|
55592
56274
|
};
|
|
55593
56275
|
}
|
|
55594
56276
|
|
|
56277
|
+
// src/renderer-reference-trigger.ts
|
|
56278
|
+
var HASH_BOUNDARY = String.raw`[\s\p{sc=Han}\p{sc=Hira}\p{sc=Kana}\u30FC\u3000-\u303F\uFF01\uFF02\uFF04-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF40\uFF5B-\uFF65]`;
|
|
56279
|
+
var FENCE_PATTERN3 = /^ {0,3}(`{3,}|~{3,})(.*)$/u;
|
|
56280
|
+
function isFenceOpening(marker, rest) {
|
|
56281
|
+
return marker === "~" || !rest.includes("`");
|
|
56282
|
+
}
|
|
56283
|
+
function insideMarkdownCode(textBeforeCaret) {
|
|
56284
|
+
const lines = textBeforeCaret.split(/\r\n|\n|\r/u);
|
|
56285
|
+
const lastIndex = lines.length - 1;
|
|
56286
|
+
let fence = null;
|
|
56287
|
+
let inlineBackticks = 0;
|
|
56288
|
+
for (let lineIndex = 0; lineIndex <= lastIndex; lineIndex += 1) {
|
|
56289
|
+
const line = lines[lineIndex] ?? "";
|
|
56290
|
+
if (fence !== null) {
|
|
56291
|
+
if (lineIndex < lastIndex) {
|
|
56292
|
+
const match2 = FENCE_PATTERN3.exec(line);
|
|
56293
|
+
if (match2) {
|
|
56294
|
+
const run = match2[1] ?? "";
|
|
56295
|
+
if (run.charAt(0) === fence.marker && run.length >= fence.length && (match2[2] ?? "").trim() === "") {
|
|
56296
|
+
fence = null;
|
|
56297
|
+
}
|
|
56298
|
+
}
|
|
56299
|
+
}
|
|
56300
|
+
continue;
|
|
56301
|
+
}
|
|
56302
|
+
if (lineIndex < lastIndex && line.trim() === "") {
|
|
56303
|
+
inlineBackticks = 0;
|
|
56304
|
+
continue;
|
|
56305
|
+
}
|
|
56306
|
+
const match = FENCE_PATTERN3.exec(line);
|
|
56307
|
+
if (match) {
|
|
56308
|
+
const run = match[1] ?? "";
|
|
56309
|
+
const marker = run.charAt(0);
|
|
56310
|
+
const rest = match[2] ?? "";
|
|
56311
|
+
if (isFenceOpening(marker, rest)) {
|
|
56312
|
+
inlineBackticks = 0;
|
|
56313
|
+
if (lineIndex === lastIndex) return true;
|
|
56314
|
+
fence = { marker, length: run.length };
|
|
56315
|
+
continue;
|
|
56316
|
+
}
|
|
56317
|
+
}
|
|
56318
|
+
let i = 0;
|
|
56319
|
+
while (i < line.length) {
|
|
56320
|
+
if (inlineBackticks === 0 && line.charAt(i) === "\\") {
|
|
56321
|
+
i += 2;
|
|
56322
|
+
continue;
|
|
56323
|
+
}
|
|
56324
|
+
if (line.charAt(i) === "`") {
|
|
56325
|
+
let end = i + 1;
|
|
56326
|
+
while (end < line.length && line.charAt(end) === "`") end += 1;
|
|
56327
|
+
const runLength = end - i;
|
|
56328
|
+
if (inlineBackticks === 0) inlineBackticks = runLength;
|
|
56329
|
+
else if (runLength === inlineBackticks) inlineBackticks = 0;
|
|
56330
|
+
i = end;
|
|
56331
|
+
continue;
|
|
56332
|
+
}
|
|
56333
|
+
i += 1;
|
|
56334
|
+
}
|
|
56335
|
+
}
|
|
56336
|
+
return fence !== null || inlineBackticks > 0;
|
|
56337
|
+
}
|
|
56338
|
+
|
|
55595
56339
|
// src/renderer-delegation-mention.ts
|
|
55596
56340
|
var MENU_ATTRIBUTE = "data-codexhost-delegation-mention-menu";
|
|
55597
56341
|
var STYLE_ATTRIBUTE4 = "data-codexhost-delegation-mention-style";
|
|
@@ -55607,13 +56351,18 @@ ${selector}::after{content:attr(agent-mention-display-name);}`;
|
|
|
55607
56351
|
var VIEWPORT_MARGIN = 8;
|
|
55608
56352
|
var MENU_GAP2 = 4;
|
|
55609
56353
|
var MAX_QUERY_LENGTH = 32;
|
|
55610
|
-
var TRIGGER_PATTERN =
|
|
56354
|
+
var TRIGGER_PATTERN = new RegExp(
|
|
56355
|
+
String.raw`(?:^|${HASH_BOUNDARY})[#\uFF03]([^\s#\uFF03]*)$`,
|
|
56356
|
+
"u"
|
|
56357
|
+
);
|
|
55611
56358
|
function findDelegationTrigger(textBeforeCaret) {
|
|
55612
56359
|
const match = TRIGGER_PATTERN.exec(textBeforeCaret);
|
|
55613
56360
|
if (!match) return null;
|
|
55614
56361
|
const query = match[1] ?? "";
|
|
55615
56362
|
if (query.length > MAX_QUERY_LENGTH || /^\d/u.test(query)) return null;
|
|
55616
|
-
|
|
56363
|
+
const start = textBeforeCaret.length - query.length - 1;
|
|
56364
|
+
if (insideMarkdownCode(textBeforeCaret.slice(0, start))) return null;
|
|
56365
|
+
return { query, start };
|
|
55617
56366
|
}
|
|
55618
56367
|
function filterDelegationTargets(targets, query) {
|
|
55619
56368
|
const needle = query.trim().toLowerCase();
|
|
@@ -55916,6 +56665,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55916
56665
|
if (!node || node.nodeType !== node.TEXT_NODE) return null;
|
|
55917
56666
|
const editor = node.parentElement?.closest('[contenteditable="true"]');
|
|
55918
56667
|
if (!editor || !options.isComposerEditor(editor)) return null;
|
|
56668
|
+
if (node.parentElement?.closest("code, pre")) return null;
|
|
55919
56669
|
const text2 = node;
|
|
55920
56670
|
const found = findDelegationTrigger(text2.data.slice(0, selection2.anchorOffset));
|
|
55921
56671
|
if (!found) return null;
|
|
@@ -55924,7 +56674,8 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
55924
56674
|
node: text2,
|
|
55925
56675
|
start: found.start,
|
|
55926
56676
|
end: selection2.anchorOffset,
|
|
55927
|
-
query: found.query
|
|
56677
|
+
query: found.query,
|
|
56678
|
+
char: text2.data.charAt(found.start)
|
|
55928
56679
|
};
|
|
55929
56680
|
};
|
|
55930
56681
|
const refresh = () => {
|
|
@@ -56015,7 +56766,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
56015
56766
|
if (entry.kind === "librarySkill" && trigger && !options.readSkills?.(trigger.editor)) return;
|
|
56016
56767
|
close();
|
|
56017
56768
|
if (!trigger || !trigger.node.isConnected) return;
|
|
56018
|
-
const expected =
|
|
56769
|
+
const expected = `${trigger.char}${trigger.query}`;
|
|
56019
56770
|
if (trigger.node.data.slice(trigger.start, trigger.end) !== expected) return;
|
|
56020
56771
|
const range = { node: trigger.node, start: trigger.start, end: trigger.end, expected };
|
|
56021
56772
|
inserting = true;
|
|
@@ -57470,6 +58221,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
57470
58221
|
const mountedByComposer = /* @__PURE__ */ new Map();
|
|
57471
58222
|
const pendingDefaultPreferences = /* @__PURE__ */ new Map();
|
|
57472
58223
|
const catalogRequests = /* @__PURE__ */ new WeakMap();
|
|
58224
|
+
const harnessAvailabilityRechecks = /* @__PURE__ */ new Map();
|
|
57473
58225
|
const draftUsageRequests = /* @__PURE__ */ new WeakMap();
|
|
57474
58226
|
const pendingReplacements = /* @__PURE__ */ new Map();
|
|
57475
58227
|
let disposed = false;
|
|
@@ -57689,6 +58441,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
57689
58441
|
);
|
|
57690
58442
|
};
|
|
57691
58443
|
const showCodexUsageGateStatus = (mounted, status) => {
|
|
58444
|
+
mounted.codexUsageBanner.update(status === "bypassed");
|
|
57692
58445
|
const title = status === "unsupported" ? rendererHarnessMessages(settingsLifecycle.locale).codexUsageGateUnavailable : "";
|
|
57693
58446
|
if (mounted.control.root.title !== title) mounted.control.root.title = title;
|
|
57694
58447
|
};
|
|
@@ -57715,6 +58468,22 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
57715
58468
|
const needsRpcSteering = manager != null && "kind" in manager && manager.kind === "main-process-rpc";
|
|
57716
58469
|
return composerClient(mounted) && (!needsRpcSteering || window.__codexhostRpcSteeringV1) ? "ready" : "installing";
|
|
57717
58470
|
};
|
|
58471
|
+
const draftWorkspaces = /* @__PURE__ */ new Map();
|
|
58472
|
+
const nativeDraftWorkspaces = createRendererNativeDraftWorkspaceStore();
|
|
58473
|
+
const draftIdFromComposerModelTarget = (target2) => target2?.[0] === "default" && typeof target2[1] === "string" && target2[1].length > 0 ? target2[1] : null;
|
|
58474
|
+
const activeNativeDraftComposers = () => [...mountedByComposer.values()].map((mounted) => ({
|
|
58475
|
+
composer: mounted.composer,
|
|
58476
|
+
hostId: threadIdFromComposerModelTarget(mounted.modelTarget) ? null : activeModelHostId(mounted.composer),
|
|
58477
|
+
draftId: draftIdFromComposerModelTarget(mounted.modelTarget)
|
|
58478
|
+
}));
|
|
58479
|
+
{
|
|
58480
|
+
const published = Reflect.get(window, "__codexhostDraftWorkspacesV1");
|
|
58481
|
+
if (typeof published === "object" && published !== null) {
|
|
58482
|
+
for (const [hostId2, cwd] of Object.entries(published)) {
|
|
58483
|
+
if (typeof cwd === "string" && cwd.length > 0) draftWorkspaces.set(hostId2, cwd);
|
|
58484
|
+
}
|
|
58485
|
+
}
|
|
58486
|
+
}
|
|
57718
58487
|
const renderMounted = (mounted) => {
|
|
57719
58488
|
if (!isMountedComposer(mounted.composer)) return;
|
|
57720
58489
|
restorePendingDraftPreference(mounted);
|
|
@@ -57745,7 +58514,25 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
57745
58514
|
mounted.ownershipStatus === "error",
|
|
57746
58515
|
mounted.accountBalance
|
|
57747
58516
|
);
|
|
57748
|
-
|
|
58517
|
+
const nativeTargetResolved = mounted.modelTarget?.[0] === "default" || mounted.modelTarget?.[0] === "conversation";
|
|
58518
|
+
const nativeEligible = nativeTargetResolved && controller.get(mounted.composer).agent === "codex" && mounted.ownershipStatus !== "loading" && mounted.ownershipStatus !== "error" && !controller.isSwitching(mounted.composer);
|
|
58519
|
+
const nativeThreadId = threadIdFromComposerModelTarget(mounted.modelTarget);
|
|
58520
|
+
if (nativeThreadId) nativeDraftWorkspaces.delete(mounted.composer);
|
|
58521
|
+
const nativeDraftScope = nativeThreadId ? null : nativeDraftWorkspaces.resolve({
|
|
58522
|
+
composer: mounted.composer,
|
|
58523
|
+
hostId: activeModelHostId(mounted.composer),
|
|
58524
|
+
draftId: draftIdFromComposerModelTarget(mounted.modelTarget)
|
|
58525
|
+
});
|
|
58526
|
+
const nativeSubmissionReady = mounted.nativeInferenceRoute.update(
|
|
58527
|
+
composerClient(mounted),
|
|
58528
|
+
nativeThreadId,
|
|
58529
|
+
nativeEligible,
|
|
58530
|
+
nativeDraftScope
|
|
58531
|
+
);
|
|
58532
|
+
showCodexUsageGateStatus(
|
|
58533
|
+
mounted,
|
|
58534
|
+
mounted.codexUsageGate.update(externalSubmissionReady || nativeSubmissionReady)
|
|
58535
|
+
);
|
|
57749
58536
|
if (mounted.control.usage) {
|
|
57750
58537
|
mounted.control.usage.onOpen = () => {
|
|
57751
58538
|
void refreshThreadUsage(
|
|
@@ -57756,15 +58543,6 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
57756
58543
|
}
|
|
57757
58544
|
};
|
|
57758
58545
|
let delegationMention = null;
|
|
57759
|
-
const draftWorkspaces = /* @__PURE__ */ new Map();
|
|
57760
|
-
{
|
|
57761
|
-
const published = Reflect.get(window, "__codexhostDraftWorkspacesV1");
|
|
57762
|
-
if (typeof published === "object" && published !== null) {
|
|
57763
|
-
for (const [hostId2, cwd] of Object.entries(published)) {
|
|
57764
|
-
if (typeof cwd === "string" && cwd.length > 0) draftWorkspaces.set(hostId2, cwd);
|
|
57765
|
-
}
|
|
57766
|
-
}
|
|
57767
|
-
}
|
|
57768
58546
|
const skillContext = (editor) => {
|
|
57769
58547
|
const composer = composerForElement(editor);
|
|
57770
58548
|
const mounted = composer ? mountedByComposer.get(composer) : void 0;
|
|
@@ -58113,7 +58891,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
58113
58891
|
sidebarAgentIcons.refresh();
|
|
58114
58892
|
return true;
|
|
58115
58893
|
};
|
|
58116
|
-
const loadExternalCatalog = async (mounted, credentialAccess) => {
|
|
58894
|
+
const loadExternalCatalog = async (mounted, credentialAccess, refresh = false) => {
|
|
58117
58895
|
if (!isMountedComposer(mounted.composer)) return;
|
|
58118
58896
|
modelRecovery.delete(mounted);
|
|
58119
58897
|
void refreshCommands(mounted);
|
|
@@ -58170,6 +58948,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
58170
58948
|
catalogRequests.set(mounted, catalogRequest);
|
|
58171
58949
|
const inspection = await client.inspectHarness({
|
|
58172
58950
|
harnessId: harnessIdSchema.parse(agent),
|
|
58951
|
+
...refresh ? { refresh: true } : {},
|
|
58173
58952
|
...credentialAccess ? { credentialAccess } : {}
|
|
58174
58953
|
});
|
|
58175
58954
|
if (!isCurrentModelRequest(mounted, generation) || controller.get(mounted.composer).agent !== agent || mounted.hostId !== requestHostId || modelControl !== requestModelControl || modelClientForHostFrom(requestModelControl, requestHostId) !== client || activeModelHostId(mounted.composer) !== requestHostId) {
|
|
@@ -58353,6 +59132,61 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
58353
59132
|
finishModelRequest(mounted, generation);
|
|
58354
59133
|
}
|
|
58355
59134
|
};
|
|
59135
|
+
const recheckFailedHarnessCatalog = async (mounted, hostId2, agent) => {
|
|
59136
|
+
const client = composerClient(mounted);
|
|
59137
|
+
if (!client) return;
|
|
59138
|
+
const loadingView = {
|
|
59139
|
+
status: "loading",
|
|
59140
|
+
thinkingSelectionSupported: false
|
|
59141
|
+
};
|
|
59142
|
+
mounted.modelView = loadingView;
|
|
59143
|
+
renderMounted(mounted);
|
|
59144
|
+
const key2 = `${hostId2}\0${agent}`;
|
|
59145
|
+
const recheck = (harnessAvailabilityRechecks.get(key2) ?? 0) + 1;
|
|
59146
|
+
harnessAvailabilityRechecks.set(key2, recheck);
|
|
59147
|
+
const state = hostHarnessAvailabilityState(hostId2);
|
|
59148
|
+
let status = "error";
|
|
59149
|
+
let nextError;
|
|
59150
|
+
let webUiAvailable = false;
|
|
59151
|
+
try {
|
|
59152
|
+
const inspection = await client.inspectHarness({
|
|
59153
|
+
harnessId: harnessIdSchema.parse(agent),
|
|
59154
|
+
refresh: true,
|
|
59155
|
+
purpose: "availability",
|
|
59156
|
+
credentialAccess: "retry"
|
|
59157
|
+
});
|
|
59158
|
+
status = inspection.status === "ready" ? "ready" : inspection.status;
|
|
59159
|
+
webUiAvailable = hostId2 === "local" && inspection.status === "ready" && inspection.webUi?.open === true;
|
|
59160
|
+
if (inspection.status !== "ready") {
|
|
59161
|
+
const error51 = inspection.error;
|
|
59162
|
+
nextError = {
|
|
59163
|
+
code: error51.code,
|
|
59164
|
+
message: error51.message,
|
|
59165
|
+
retryable: error51.retryable,
|
|
59166
|
+
...error51.diagnostic ? { diagnostic: error51.diagnostic } : {},
|
|
59167
|
+
...error51.stage ? { stage: error51.stage } : {},
|
|
59168
|
+
...error51.durationMs !== void 0 ? { durationMs: error51.durationMs } : {},
|
|
59169
|
+
...error51.stderrTail ? { stderrTail: error51.stderrTail } : {}
|
|
59170
|
+
};
|
|
59171
|
+
}
|
|
59172
|
+
} catch (error51) {
|
|
59173
|
+
nextError = {
|
|
59174
|
+
code: error51 instanceof RendererMethodUnavailableError ? "unavailable" : "internalError",
|
|
59175
|
+
message: error51 instanceof Error ? error51.message : String(error51),
|
|
59176
|
+
retryable: !(error51 instanceof RendererMethodUnavailableError),
|
|
59177
|
+
stage: "request"
|
|
59178
|
+
};
|
|
59179
|
+
}
|
|
59180
|
+
const current = !disposed && harnessAvailabilityRechecks.get(key2) === recheck && modelClientForHost(hostId2) === client;
|
|
59181
|
+
if (current) {
|
|
59182
|
+
state.errors[agent] = nextError;
|
|
59183
|
+
state.availability = { ...state.availability, [agent]: status };
|
|
59184
|
+
state.webUi = { ...state.webUi, [agent]: webUiAvailable };
|
|
59185
|
+
publishConnectionStatus();
|
|
59186
|
+
}
|
|
59187
|
+
if (mounted.modelView !== loadingView || !isMountedComposer(mounted.composer)) return;
|
|
59188
|
+
void loadExternalCatalog(mounted, void 0, current && status === "ready");
|
|
59189
|
+
};
|
|
58356
59190
|
const refreshExternalModels = async (mounted) => {
|
|
58357
59191
|
const { agent } = controller.get(mounted.composer);
|
|
58358
59192
|
const hostId2 = mounted.hostId;
|
|
@@ -58360,6 +59194,15 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
58360
59194
|
const requestControl = modelControl;
|
|
58361
59195
|
if (agent === "codex" || !hostId2 || !client) return;
|
|
58362
59196
|
const matchesTarget = (candidate) => isMountedComposer(candidate.composer) && mountedByComposer.get(candidate.composer) === candidate && candidate.hostId === hostId2 && activeModelHostId(candidate.composer) === hostId2 && modelControl === requestControl && composerClient(candidate) === client && controller.get(candidate.composer).agent === agent && !controller.isSwitching(candidate.composer);
|
|
59197
|
+
if (matchesTarget(mounted) && mounted.modelView.status === "error" && mounted.modelView.catalog === void 0) {
|
|
59198
|
+
const availability = hostHarnessAvailabilityState(hostId2).availability[agent];
|
|
59199
|
+
if (availability === "ready" || availability === "checking") {
|
|
59200
|
+
void loadExternalCatalog(mounted, void 0, true);
|
|
59201
|
+
} else {
|
|
59202
|
+
void recheckFailedHarnessCatalog(mounted, hostId2, agent);
|
|
59203
|
+
}
|
|
59204
|
+
return;
|
|
59205
|
+
}
|
|
58363
59206
|
const canRefresh = (candidate) => matchesTarget(candidate) && candidate.modelView.catalog !== void 0 && (candidate.modelView.status === "ready" || candidate.modelView.status === "error");
|
|
58364
59207
|
const active2 = catalogRequests.get(mounted);
|
|
58365
59208
|
if (!canRefresh(mounted) || active2?.refreshing && isCurrentModelRequest(mounted, active2.generation))
|
|
@@ -58990,7 +59833,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
58990
59833
|
scheduleHarnessAvailabilityRetry(hostId2);
|
|
58991
59834
|
return Promise.resolve();
|
|
58992
59835
|
}
|
|
58993
|
-
if (state.request?.client === client && (!force || state.request.force)) {
|
|
59836
|
+
if (state.request?.client === client && (!force || state.request.force) && (!credentialAccess || state.request.credentialAccess === credentialAccess)) {
|
|
58994
59837
|
return state.request.promise;
|
|
58995
59838
|
}
|
|
58996
59839
|
if (state.directoryClient !== client) {
|
|
@@ -59061,6 +59904,8 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
59061
59904
|
await Promise.all(
|
|
59062
59905
|
agentsToInspect.map(async (agent) => {
|
|
59063
59906
|
const before = state.availability[agent];
|
|
59907
|
+
const recheckKey = `${hostId2}\0${agent}`;
|
|
59908
|
+
const recheck = harnessAvailabilityRechecks.get(recheckKey);
|
|
59064
59909
|
let status = "error";
|
|
59065
59910
|
let nextError;
|
|
59066
59911
|
let webUiAvailable = false;
|
|
@@ -59099,6 +59944,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
59099
59944
|
}
|
|
59100
59945
|
if (generation !== state.requestGeneration || disposed || modelClientForHost(hostId2) !== client)
|
|
59101
59946
|
return;
|
|
59947
|
+
if (harnessAvailabilityRechecks.get(recheckKey) !== recheck) return;
|
|
59102
59948
|
const previousStatus = state.availability[agent];
|
|
59103
59949
|
if (before !== "ready" && previousStatus === "ready" && nextError?.code === "credentialAccessRequired")
|
|
59104
59950
|
return;
|
|
@@ -59116,7 +59962,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
59116
59962
|
isExternalConfigurationStable(mounted.modelView, mounted.permissionModeView),
|
|
59117
59963
|
refresh && force
|
|
59118
59964
|
)) {
|
|
59119
|
-
void loadExternalCatalog(mounted);
|
|
59965
|
+
void loadExternalCatalog(mounted, void 0, refresh && force);
|
|
59120
59966
|
}
|
|
59121
59967
|
renderMounted(mounted);
|
|
59122
59968
|
}
|
|
@@ -59130,7 +59976,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
59130
59976
|
scheduleHarnessAvailabilityRetry(hostId2);
|
|
59131
59977
|
}
|
|
59132
59978
|
})();
|
|
59133
|
-
const request = { client, promise: promise2, force };
|
|
59979
|
+
const request = { client, promise: promise2, force, ...credentialAccess ? { credentialAccess } : {} };
|
|
59134
59980
|
state.request = request;
|
|
59135
59981
|
void promise2.then(
|
|
59136
59982
|
() => {
|
|
@@ -59429,6 +60275,12 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
59429
60275
|
composerId: state.composerId,
|
|
59430
60276
|
control,
|
|
59431
60277
|
codexUsageGate: createRendererCodexUsageGate(composer),
|
|
60278
|
+
codexUsageBanner: createRendererNativeProviderUsageBanner(composer),
|
|
60279
|
+
nativeInferenceRoute: createRendererNativeInferenceRoute(() => {
|
|
60280
|
+
if (!disposed && mountedByComposer.get(composer) === mounted && composer.isConnected) {
|
|
60281
|
+
renderMounted(mounted);
|
|
60282
|
+
}
|
|
60283
|
+
}),
|
|
59432
60284
|
modelTarget,
|
|
59433
60285
|
modelView: inherited?.modelView ?? { status: "idle" },
|
|
59434
60286
|
permissionModeView: inherited?.permissionModeView ?? { status: "idle" },
|
|
@@ -59505,6 +60357,9 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
59505
60357
|
usageRefreshTimers.delete(composer);
|
|
59506
60358
|
}
|
|
59507
60359
|
mounted.codexUsageGate.dispose();
|
|
60360
|
+
mounted.codexUsageBanner.dispose();
|
|
60361
|
+
mounted.nativeInferenceRoute.dispose();
|
|
60362
|
+
nativeDraftWorkspaces.delete(composer);
|
|
59508
60363
|
disposeComposerAgentControl(mounted.control);
|
|
59509
60364
|
ownershipRecovery.delete(mounted);
|
|
59510
60365
|
modelRecovery.delete(mounted);
|
|
@@ -59711,10 +60566,13 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
59711
60566
|
reconcileHarnessAvailabilityHost();
|
|
59712
60567
|
void loadCodexAccounts();
|
|
59713
60568
|
void refreshHarnessAvailability();
|
|
60569
|
+
nativeDraftWorkspaces.clear();
|
|
59714
60570
|
for (const mounted of mountedByComposer.values()) {
|
|
59715
60571
|
const state = controller.get(mounted.composer);
|
|
59716
60572
|
if (state.agent !== "codex" && !threadIdFromComposerModelTarget(mounted.modelTarget) && !isExternalConfigurationStable(mounted.modelView, mounted.permissionModeView)) {
|
|
59717
60573
|
void loadExternalCatalog(mounted);
|
|
60574
|
+
} else if (state.agent === "codex" && !threadIdFromComposerModelTarget(mounted.modelTarget)) {
|
|
60575
|
+
renderMounted(mounted);
|
|
59718
60576
|
}
|
|
59719
60577
|
}
|
|
59720
60578
|
};
|
|
@@ -59772,13 +60630,23 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
59772
60630
|
const onDraftWorkspace = (event) => {
|
|
59773
60631
|
const detail = event.detail;
|
|
59774
60632
|
if (typeof detail !== "object" || detail === null) return;
|
|
59775
|
-
const { hostId: hostId2, cwd } = detail;
|
|
59776
|
-
if (typeof hostId2 !== "string" || typeof cwd !== "string" || cwd.length === 0) return;
|
|
60633
|
+
const { hostId: hostId2, cwd, draftId } = detail;
|
|
60634
|
+
if (typeof hostId2 !== "string" || typeof cwd !== "string" || cwd.trim().length === 0) return;
|
|
59777
60635
|
draftWorkspaces.set(hostId2, cwd);
|
|
60636
|
+
nativeDraftWorkspaces.publish(
|
|
60637
|
+
{
|
|
60638
|
+
hostId: hostId2,
|
|
60639
|
+
cwd,
|
|
60640
|
+
...typeof draftId === "string" && draftId.length > 0 ? { draftId } : {}
|
|
60641
|
+
},
|
|
60642
|
+
activeNativeDraftComposers()
|
|
60643
|
+
);
|
|
59778
60644
|
delegationMention?.refresh();
|
|
59779
60645
|
for (const mounted of mountedByComposer.values()) {
|
|
59780
60646
|
if (!threadIdFromComposerModelTarget(mounted.modelTarget) && activeModelHostId(mounted.composer) === hostId2 && controller.get(mounted.composer).agent !== "codex") {
|
|
59781
60647
|
void refreshCommands(mounted, { keepCurrent: true });
|
|
60648
|
+
} else if (!threadIdFromComposerModelTarget(mounted.modelTarget) && activeModelHostId(mounted.composer) === hostId2) {
|
|
60649
|
+
renderMounted(mounted);
|
|
59782
60650
|
}
|
|
59783
60651
|
}
|
|
59784
60652
|
};
|
|
@@ -59981,6 +60849,7 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
59981
60849
|
if (state.retryTimer !== null) window.clearTimeout(state.retryTimer);
|
|
59982
60850
|
}
|
|
59983
60851
|
harnessAvailabilityByHost.clear();
|
|
60852
|
+
nativeDraftWorkspaces.clear();
|
|
59984
60853
|
activeAvailabilityHostId = "local";
|
|
59985
60854
|
sidebarAgentIcons.refresh();
|
|
59986
60855
|
void refreshHarnessAvailabilityForHost("local");
|
|
@@ -60052,8 +60921,11 @@ ${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
|
60052
60921
|
mounted.usageRequestGeneration += 1;
|
|
60053
60922
|
usageRefreshAttempts.delete(mounted.composer);
|
|
60054
60923
|
mounted.codexUsageGate.dispose();
|
|
60924
|
+
mounted.codexUsageBanner.dispose();
|
|
60925
|
+
mounted.nativeInferenceRoute.dispose();
|
|
60055
60926
|
disposeComposerAgentControl(mounted.control);
|
|
60056
60927
|
}
|
|
60928
|
+
nativeDraftWorkspaces.clear();
|
|
60057
60929
|
mountedByComposer.clear();
|
|
60058
60930
|
pendingReplacements.clear();
|
|
60059
60931
|
connectionListeners.clear();
|