@codexhost/cli-win32-arm64 0.26.1 → 0.28.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 +1010 -592
- package/app/console-web.js +1861 -1498
- package/app/desktop-controller.mjs +488 -245
- package/app/host-runtime.mjs +9177 -4006
- package/app/plugins/antigravity/plugin.mjs +9055 -548
- package/app/plugins/claude-code/plugin.mjs +1117 -423
- package/app/plugins/codebuddy/plugin.mjs +599 -261
- package/app/plugins/codex-usage/plugin.mjs +1808 -1357
- package/app/plugins/copilot/plugin.mjs +491 -235
- package/app/plugins/cursor-cli/plugin.mjs +487 -232
- package/app/plugins/deepseek-harness/plugin.mjs +493 -235
- package/app/plugins/devin/plugin.mjs +467 -232
- package/app/plugins/grok/plugin.mjs +547 -253
- package/app/plugins/hermes/plugin.mjs +468 -232
- package/app/plugins/kimi-code/plugin.mjs +762 -439
- package/app/plugins/kiro-cli/plugin.mjs +466 -232
- package/app/plugins/omp/plugin.mjs +1705 -1356
- package/app/plugins/opencode/manifest.json +1 -1
- package/app/plugins/opencode/plugin.mjs +544 -250
- package/app/plugins/pi/plugin.mjs +761 -364
- package/app/plugins/qoder/plugin.mjs +540 -246
- package/app/plugins/qoder-cn/plugin.mjs +540 -246
- package/app/plugins/qwen-code/plugin.mjs +466 -232
- package/app/plugins/workbuddy/plugin.mjs +594 -273
- package/app/plugins/zcode/plugin.mjs +468 -232
- package/app/renderer-extension.js +2653 -657
- package/app/web/assets/index-DBPgg32z.css +1 -0
- package/app/web/assets/index-DWxiVzuS.js +204 -0
- package/app/web/codexhost-settings.js +101 -66
- package/app/web/index.html +2 -2
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +65 -65
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +69 -69
- package/app/web/plugins/deepseek-ai__dsh-client-shortcuts/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-approval/client.js +4 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +75 -75
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +73 -73
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +19 -19
- 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 +5 -5
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-shortcuts/client.js +1 -1
- 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.pdf.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-right/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +4 -4
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +71 -71
- package/app/web/plugins.json +2 -1
- package/app/web-modules/server.mjs +5065 -1964
- 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-CR4Y8Ndj.css +0 -1
- package/app/web/assets/index-Dw-yHAxN.js +0 -196
package/app/console-web.js
CHANGED
|
@@ -19967,6 +19967,38 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19967
19967
|
// ../shared-contracts/dist/harness-route-limit.js
|
|
19968
19968
|
var HARNESS_TRANSPORT_MODEL_ID_MAX_LENGTH = 8192;
|
|
19969
19969
|
|
|
19970
|
+
// ../shared-contracts/dist/thread-handoff.js
|
|
19971
|
+
var nonBlankTextSchema2 = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
19972
|
+
message: "Value must not be empty or whitespace"
|
|
19973
|
+
});
|
|
19974
|
+
var THREAD_HANDOFF_METHOD = "codexhost/thread/handoff";
|
|
19975
|
+
var threadHandoffParamsSchema = external_exports.object({
|
|
19976
|
+
sourceThreadId: hostThreadIdSchema,
|
|
19977
|
+
lastTurnId: hostTurnIdSchema.optional(),
|
|
19978
|
+
targetHarnessId: harnessIdSchema,
|
|
19979
|
+
targetModel: nonBlankTextSchema2.max(1024).optional(),
|
|
19980
|
+
targetThinkingOptionId: nonBlankTextSchema2.max(128).regex(/^[A-Za-z0-9._~-]+$/u, "Thinking option ID must use transport-safe characters").optional()
|
|
19981
|
+
}).strict();
|
|
19982
|
+
var threadHandoffMetadataSchema = external_exports.object({
|
|
19983
|
+
sourceThreadId: hostThreadIdSchema,
|
|
19984
|
+
sourceHarnessId: harnessIdSchema,
|
|
19985
|
+
sourceHarnessLabel: nonBlankTextSchema2.max(256).optional(),
|
|
19986
|
+
sourceModel: nonBlankTextSchema2.max(1024).optional(),
|
|
19987
|
+
targetHarnessId: harnessIdSchema,
|
|
19988
|
+
targetHarnessLabel: nonBlankTextSchema2.max(256).optional(),
|
|
19989
|
+
targetModel: nonBlankTextSchema2.max(1024).optional(),
|
|
19990
|
+
totalTurns: external_exports.number().int().min(1),
|
|
19991
|
+
boundaryTurnNumber: external_exports.number().int().min(1),
|
|
19992
|
+
includedTurnNumbers: external_exports.array(external_exports.number().int().min(1)),
|
|
19993
|
+
omittedTurns: external_exports.number().int().min(0),
|
|
19994
|
+
preview: external_exports.string().max(32e3),
|
|
19995
|
+
createdAtMs: external_exports.number().int().nonnegative()
|
|
19996
|
+
}).strict();
|
|
19997
|
+
var threadHandoffResultSchema = external_exports.object({
|
|
19998
|
+
threadId: hostThreadIdSchema,
|
|
19999
|
+
handoff: threadHandoffMetadataSchema
|
|
20000
|
+
}).strict();
|
|
20001
|
+
|
|
19970
20002
|
// ../shared-contracts/dist/thread-usage.js
|
|
19971
20003
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
19972
20004
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
@@ -20150,7 +20182,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20150
20182
|
var HARNESS_MODEL_LABEL_MAX_LENGTH = 256;
|
|
20151
20183
|
var HARNESS_THINKING_OPTION_ID_MAX_LENGTH = 128;
|
|
20152
20184
|
var THREAD_OWNERSHIP_LIST_MAX_LENGTH = 100;
|
|
20153
|
-
var
|
|
20185
|
+
var nonBlankTextSchema3 = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
20154
20186
|
message: "Value must not be empty or whitespace"
|
|
20155
20187
|
});
|
|
20156
20188
|
var harnessModelRefIdSchema = external_exports.string().min(1).max(HARNESS_MODEL_REF_MAX_LENGTH).refine((id2) => !/\p{Cc}/u.test(id2), "Model Ref must not contain control characters").brand();
|
|
@@ -20169,15 +20201,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20169
20201
|
const separator = key2.indexOf("");
|
|
20170
20202
|
return harnessModelRefSchema.parse(separator === -1 ? { id: key2 } : { id: key2.slice(0, separator), serviceTier: key2.slice(separator + 1) });
|
|
20171
20203
|
}
|
|
20172
|
-
var harnessThinkingOptionIdSchema =
|
|
20173
|
-
var harnessResolvedModelLabelSchema =
|
|
20204
|
+
var harnessThinkingOptionIdSchema = nonBlankTextSchema3.max(HARNESS_THINKING_OPTION_ID_MAX_LENGTH).regex(/^[A-Za-z0-9._~-]+$/u, "Thinking option ID must use transport-safe characters").brand();
|
|
20205
|
+
var harnessResolvedModelLabelSchema = nonBlankTextSchema3.max(HARNESS_MODEL_LABEL_MAX_LENGTH);
|
|
20174
20206
|
var harnessThinkingOptionSchema = external_exports.object({
|
|
20175
20207
|
id: harnessThinkingOptionIdSchema,
|
|
20176
|
-
label:
|
|
20208
|
+
label: nonBlankTextSchema3.max(HARNESS_MODEL_LABEL_MAX_LENGTH)
|
|
20177
20209
|
}).strict();
|
|
20178
20210
|
var harnessModelSchema = external_exports.object({
|
|
20179
20211
|
ref: harnessModelRefSchema,
|
|
20180
|
-
label:
|
|
20212
|
+
label: nonBlankTextSchema3.max(HARNESS_MODEL_LABEL_MAX_LENGTH),
|
|
20181
20213
|
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
20182
20214
|
/** Optional opaque selection for this same Model with priority processing enabled. */
|
|
20183
20215
|
fastModel: harnessModelRefSchema.optional(),
|
|
@@ -20204,11 +20236,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20204
20236
|
ids.add(option.id);
|
|
20205
20237
|
}
|
|
20206
20238
|
});
|
|
20239
|
+
var harnessThinkingOptionsScopeSchema = external_exports.enum(["catalog", "activeModel"]);
|
|
20207
20240
|
var harnessModelCatalogSchema = external_exports.object({
|
|
20208
20241
|
models: external_exports.array(harnessModelSchema),
|
|
20209
20242
|
defaultModel: harnessModelRefSchema.optional(),
|
|
20210
20243
|
thinkingOptions: harnessThinkingOptionsSchema,
|
|
20211
|
-
defaultThinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
20244
|
+
defaultThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
20245
|
+
/**
|
|
20246
|
+
* Scope of per-Model `supportedThinkingOptionIds` in this catalog.
|
|
20247
|
+
* Omitted or `"catalog"` means each Model's `supportedThinkingOptionIds`
|
|
20248
|
+
* reflects its own options (omitted or `[]` means none).
|
|
20249
|
+
* `"activeModel"` means only the active Model's Thinking options were
|
|
20250
|
+
* observed; other Models omit `supportedThinkingOptionIds` and must be
|
|
20251
|
+
* validated by the Adapter after selecting the Model.
|
|
20252
|
+
*/
|
|
20253
|
+
thinkingOptionsScope: harnessThinkingOptionsScopeSchema.optional()
|
|
20212
20254
|
}).strict().superRefine((catalog, context) => {
|
|
20213
20255
|
const refs = [];
|
|
20214
20256
|
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id: id2 }) => id2));
|
|
@@ -20342,7 +20384,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20342
20384
|
]);
|
|
20343
20385
|
var harnessInspectParamsSchema = external_exports.object({
|
|
20344
20386
|
harnessId: harnessIdSchema,
|
|
20345
|
-
cwd:
|
|
20387
|
+
cwd: nonBlankTextSchema3.max(16384).optional(),
|
|
20346
20388
|
refresh: external_exports.boolean().optional(),
|
|
20347
20389
|
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
20348
20390
|
purpose: external_exports.literal("availability").optional(),
|
|
@@ -20372,12 +20414,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20372
20414
|
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
20373
20415
|
effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
20374
20416
|
history: harnessHistoryCapabilitiesSchema.optional(),
|
|
20375
|
-
supportsThreadReferences: external_exports.literal(true).optional()
|
|
20417
|
+
supportsThreadReferences: external_exports.literal(true).optional(),
|
|
20418
|
+
handoff: threadHandoffMetadataSchema.optional()
|
|
20376
20419
|
}).strict();
|
|
20377
20420
|
var externalThreadInspectionSchema = external_exports.object({
|
|
20378
20421
|
owner: external_exports.literal("external"),
|
|
20379
|
-
harnessId:
|
|
20380
|
-
transportModelId:
|
|
20422
|
+
harnessId: nonBlankTextSchema3.max(256),
|
|
20423
|
+
transportModelId: nonBlankTextSchema3.max(HARNESS_TRANSPORT_MODEL_ID_MAX_LENGTH),
|
|
20381
20424
|
effectiveModel: harnessModelRefSchema.optional(),
|
|
20382
20425
|
resolvedModelLabel: harnessResolvedModelLabelSchema.optional(),
|
|
20383
20426
|
effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
@@ -20387,6 +20430,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
20387
20430
|
catalog: harnessModelCatalogSchema.optional(),
|
|
20388
20431
|
history: harnessHistoryCapabilitiesSchema,
|
|
20389
20432
|
usage: threadUsageSnapshotSchema.optional(),
|
|
20433
|
+
handoff: threadHandoffMetadataSchema.optional(),
|
|
20390
20434
|
locked: external_exports.literal(true)
|
|
20391
20435
|
}).strict();
|
|
20392
20436
|
var threadInspectionSchema = external_exports.discriminatedUnion("owner", [
|
|
@@ -21099,6 +21143,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21099
21143
|
"codexhost/harness/preferences/get",
|
|
21100
21144
|
"codexhost/harness/preferences/patch",
|
|
21101
21145
|
"thread/list",
|
|
21146
|
+
"thread/metadata/update",
|
|
21102
21147
|
"codexhost/thread/catalog/read",
|
|
21103
21148
|
"thread/read",
|
|
21104
21149
|
"thread/resume",
|
|
@@ -21123,6 +21168,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21123
21168
|
"thread/queue/start",
|
|
21124
21169
|
"codexhost/thread/queue/send-now",
|
|
21125
21170
|
"codexhost/workspace/read",
|
|
21171
|
+
"project/create",
|
|
21172
|
+
"project/update",
|
|
21173
|
+
"project/delete",
|
|
21174
|
+
"project/move",
|
|
21126
21175
|
"codexhost/thread/tree/read",
|
|
21127
21176
|
"codexhost/thread/pins/list",
|
|
21128
21177
|
"codexhost/thread/sections/list",
|
|
@@ -21140,6 +21189,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21140
21189
|
"codexhost/harness/commands/inspect",
|
|
21141
21190
|
"codexhost/thread/command/execute",
|
|
21142
21191
|
"codexhost/thread/fork",
|
|
21192
|
+
THREAD_HANDOFF_METHOD,
|
|
21143
21193
|
"codexhost/harness/session-import/sources",
|
|
21144
21194
|
"codexhost/harness/session-import/list",
|
|
21145
21195
|
"codexhost/harness/session-import/import",
|
|
@@ -21190,7 +21240,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21190
21240
|
prompt: external_exports.string().max(16384).optional()
|
|
21191
21241
|
}).strict();
|
|
21192
21242
|
var clientWorkspaceSnapshotSchema = external_exports.object({
|
|
21193
|
-
projects: external_exports.array(external_exports.object({
|
|
21243
|
+
projects: external_exports.array(external_exports.object({
|
|
21244
|
+
id: external_exports.string(),
|
|
21245
|
+
name: external_exports.string(),
|
|
21246
|
+
rootPaths: external_exports.array(external_exports.string()),
|
|
21247
|
+
createdAt: external_exports.number().int().optional()
|
|
21248
|
+
})),
|
|
21249
|
+
nativeProjects: external_exports.literal(true).optional(),
|
|
21194
21250
|
assignments: external_exports.record(external_exports.string(), external_exports.string()),
|
|
21195
21251
|
projectless: external_exports.array(external_exports.string()),
|
|
21196
21252
|
/** Canonical external pin membership; pins/list provides the native merged order. */
|
|
@@ -21205,6 +21261,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21205
21261
|
sequence: external_exports.number().int().nonnegative()
|
|
21206
21262
|
});
|
|
21207
21263
|
var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
21264
|
+
external_exports.object({ type: external_exports.literal("projects-changed"), cursor: clientChannelCursorSchema }),
|
|
21208
21265
|
external_exports.object({
|
|
21209
21266
|
type: external_exports.literal("skills-changed"),
|
|
21210
21267
|
cursor: clientChannelCursorSchema,
|
|
@@ -21368,7 +21425,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21368
21425
|
items: external_exports.array(clientQueuedSubmissionSchema),
|
|
21369
21426
|
pausedReason: external_exports.enum(["interrupted", "outcome-unknown", "failed"]).nullable()
|
|
21370
21427
|
}).optional(),
|
|
21371
|
-
interactions: external_exports.array(clientInteractionSchema)
|
|
21428
|
+
interactions: external_exports.array(clientInteractionSchema),
|
|
21429
|
+
handoff: threadHandoffMetadataSchema.optional()
|
|
21372
21430
|
});
|
|
21373
21431
|
var clientChannelDescriptorSchema = external_exports.object({
|
|
21374
21432
|
version: external_exports.literal(CLIENT_CHANNEL_VERSION),
|
|
@@ -21377,7 +21435,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21377
21435
|
port: external_exports.number().int().min(1).max(65535),
|
|
21378
21436
|
token: external_exports.string().regex(/^[0-9a-f]{64}$/u),
|
|
21379
21437
|
startedAt: external_exports.number(),
|
|
21380
|
-
epoch: external_exports.string().uuid()
|
|
21438
|
+
epoch: external_exports.string().uuid(),
|
|
21439
|
+
capabilities: external_exports.object({
|
|
21440
|
+
peerDelegation: external_exports.literal(1).optional()
|
|
21441
|
+
}).optional()
|
|
21381
21442
|
});
|
|
21382
21443
|
var clientChannelResponseSchema = external_exports.object({
|
|
21383
21444
|
epoch: external_exports.string().uuid(),
|
|
@@ -21396,10 +21457,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21396
21457
|
* `excludeCwds` folder, the branch ends, or a page bound is reached. Every row read is
|
|
21397
21458
|
* returned, so the native cursors stay contiguous.
|
|
21398
21459
|
*/
|
|
21399
|
-
scope: external_exports.
|
|
21400
|
-
|
|
21401
|
-
|
|
21402
|
-
|
|
21460
|
+
scope: external_exports.union([
|
|
21461
|
+
external_exports.object({
|
|
21462
|
+
cwd: external_exports.string().min(1).max(4096),
|
|
21463
|
+
excludeCwds: external_exports.array(external_exports.string().min(1).max(4096)).max(1024)
|
|
21464
|
+
}).strict(),
|
|
21465
|
+
external_exports.object({
|
|
21466
|
+
projectId: external_exports.string().min(1).max(1024),
|
|
21467
|
+
legacyThreadIds: external_exports.array(external_exports.string().min(1).max(1024)).max(1024),
|
|
21468
|
+
/** Roots whose Threads without a project ID belong to this project, as on Desktop. */
|
|
21469
|
+
rootPaths: external_exports.array(external_exports.string().min(1).max(4096)).max(1024).optional()
|
|
21470
|
+
}).strict()
|
|
21471
|
+
]).optional()
|
|
21403
21472
|
}).strict();
|
|
21404
21473
|
var threadCatalogReadResultSchema = external_exports.object({
|
|
21405
21474
|
threads: external_exports.array(jsonObjectSchema),
|
|
@@ -21592,1456 +21661,1621 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
21592
21661
|
to: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional()
|
|
21593
21662
|
});
|
|
21594
21663
|
|
|
21595
|
-
// ../shared-contracts/dist/
|
|
21596
|
-
var
|
|
21597
|
-
|
|
21598
|
-
|
|
21599
|
-
|
|
21600
|
-
|
|
21601
|
-
|
|
21602
|
-
|
|
21603
|
-
|
|
21604
|
-
|
|
21605
|
-
|
|
21606
|
-
|
|
21607
|
-
|
|
21608
|
-
|
|
21609
|
-
external_exports.object({ action: external_exports.literal("list") }).strict(),
|
|
21610
|
-
external_exports.object({
|
|
21611
|
-
action: external_exports.literal("import"),
|
|
21612
|
-
sourceId: external_exports.string().min(1).max(256),
|
|
21613
|
-
name: credentialImportNameSchema,
|
|
21614
|
-
confirmed: external_exports.literal(true)
|
|
21615
|
-
}).strict(),
|
|
21616
|
-
external_exports.object({
|
|
21617
|
-
action: external_exports.literal("reimport"),
|
|
21618
|
-
sourceId: external_exports.string().min(1).max(256),
|
|
21619
|
-
name: credentialImportNameSchema,
|
|
21620
|
-
confirmed: external_exports.literal(true)
|
|
21621
|
-
}).strict(),
|
|
21622
|
-
external_exports.object({
|
|
21623
|
-
action: external_exports.literal("remove"),
|
|
21624
|
-
name: credentialImportNameSchema,
|
|
21625
|
-
confirmed: external_exports.literal(true)
|
|
21626
|
-
}).strict()
|
|
21627
|
-
]);
|
|
21628
|
-
var credentialOtherLoginSchema = external_exports.object({
|
|
21629
|
-
provider: external_exports.string().min(1).max(128),
|
|
21630
|
-
type: external_exports.enum(["oauth", "api_key", "unknown"]),
|
|
21631
|
-
/** Best-effort account label (e.g. the email in a Codex token), derived locally when present. */
|
|
21632
|
-
label: external_exports.string().min(1).max(512).optional(),
|
|
21633
|
-
/** Recognized credential vendor, derived from the OAuth token issuer. Absent when unknown. */
|
|
21634
|
-
vendor: external_exports.enum(["openai-codex", "xai"]).optional()
|
|
21635
|
-
}).strict();
|
|
21636
|
-
var credentialImportsResultSchema = external_exports.object({
|
|
21637
|
-
sources: external_exports.array(credentialSourceSchema),
|
|
21638
|
-
targets: external_exports.array(external_exports.object({
|
|
21639
|
-
harnessId: external_exports.string(),
|
|
21640
|
-
providers: external_exports.array(external_exports.enum(["openai-codex", "xai"])),
|
|
21641
|
-
imports: external_exports.array(credentialImportRecordSchema),
|
|
21642
|
-
others: external_exports.array(credentialOtherLoginSchema).default([])
|
|
21643
|
-
}).strict())
|
|
21644
|
-
}).strict();
|
|
21645
|
-
var credentialImportsParamsSchema = external_exports.object({
|
|
21646
|
-
targetHarnessId: external_exports.string().min(1).max(128).optional(),
|
|
21647
|
-
request: credentialImportsRequestSchema
|
|
21648
|
-
}).strict();
|
|
21649
|
-
var CREDENTIAL_IMPORTS_METHOD = "codexhost/harness/credential-imports";
|
|
21650
|
-
|
|
21651
|
-
// ../shared-contracts/dist/harness-display-settings.js
|
|
21652
|
-
var HARNESS_DISPLAY_GET_METHOD = "codexhost/harness/display-settings/get";
|
|
21653
|
-
var HARNESS_DISPLAY_CHANGED_METHOD = "codexhost/harness/display-settings/changed";
|
|
21654
|
-
var HARNESS_DISPLAY_CAPABILITIES_METHOD = "codexhost/harness/display-settings/capabilities";
|
|
21655
|
-
var harnessDisplayCapabilitiesSchema = external_exports.object({ events: external_exports.boolean() });
|
|
21656
|
-
var HARNESS_DISPLAY_SET_METHOD = "codexhost/harness/display-settings/set";
|
|
21657
|
-
var harnessDisplayEntriesSchema = external_exports.array(external_exports.strictObject({
|
|
21658
|
-
agent: external_exports.string().min(1).max(128),
|
|
21659
|
-
section: external_exports.enum(["main", "more", "auto"])
|
|
21660
|
-
})).max(256).refine((entries) => new Set(entries.map((entry) => entry.agent)).size === entries.length, "Duplicate Harness IDs");
|
|
21661
|
-
var harnessDisplaySettingsSchema = external_exports.strictObject({
|
|
21662
|
-
entries: harnessDisplayEntriesSchema.nullable()
|
|
21663
|
-
});
|
|
21664
|
-
var harnessDisplayGetSchema = external_exports.strictObject({});
|
|
21665
|
-
var harnessDisplaySetSchema = external_exports.strictObject({
|
|
21666
|
-
entries: harnessDisplayEntriesSchema,
|
|
21667
|
-
/** Import legacy Desktop preferences only if no shared settings exist yet. */
|
|
21668
|
-
initializeOnly: external_exports.boolean().optional()
|
|
21669
|
-
});
|
|
21670
|
-
var DEFAULT_HARNESS_DISPLAY_ORDER = [
|
|
21671
|
-
"pi",
|
|
21672
|
-
"claude-code",
|
|
21673
|
-
"deepseek-harness",
|
|
21674
|
-
"opencode",
|
|
21675
|
-
"grok",
|
|
21676
|
-
"omp",
|
|
21677
|
-
"antigravity",
|
|
21678
|
-
"kiro-cli",
|
|
21679
|
-
"codebuddy",
|
|
21680
|
-
"workbuddy",
|
|
21681
|
-
"cursor-cli",
|
|
21682
|
-
"hermes",
|
|
21683
|
-
"qoder",
|
|
21684
|
-
"qoder-cn",
|
|
21685
|
-
"kimi-code",
|
|
21686
|
-
"zcode"
|
|
21664
|
+
// ../shared-contracts/dist/remote-peers.js
|
|
21665
|
+
var REMOTE_PEER_ID_PATTERN = /^[a-zA-Z0-9_-]{1,64}$/u;
|
|
21666
|
+
var remotePeerIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
21667
|
+
var remotePeerNodeIdSchema = external_exports.string().regex(REMOTE_PEER_ID_PATTERN);
|
|
21668
|
+
var remotePeerHostIdSchema = external_exports.string().regex(/^remote-peer:[a-zA-Z0-9_-]{1,64}$/u);
|
|
21669
|
+
var remotePeerTransportKindSchema = external_exports.enum(["relay", "tailscale", "lan", "custom"]);
|
|
21670
|
+
var REMOTE_PEER_COLORS = [
|
|
21671
|
+
"blue",
|
|
21672
|
+
"purple",
|
|
21673
|
+
"cyan",
|
|
21674
|
+
"green",
|
|
21675
|
+
"amber",
|
|
21676
|
+
"rose",
|
|
21677
|
+
"slate"
|
|
21687
21678
|
];
|
|
21688
|
-
|
|
21689
|
-
|
|
21690
|
-
var
|
|
21691
|
-
|
|
21692
|
-
|
|
21693
|
-
|
|
21679
|
+
var remotePeerColorSchema = external_exports.enum(REMOTE_PEER_COLORS);
|
|
21680
|
+
var REMOTE_PEER_COLOR_SET = new Set(REMOTE_PEER_COLORS);
|
|
21681
|
+
var remotePeerStateSchema = external_exports.enum([
|
|
21682
|
+
"connected",
|
|
21683
|
+
"connecting",
|
|
21684
|
+
"auth-error",
|
|
21685
|
+
"offline",
|
|
21686
|
+
"disabled"
|
|
21687
|
+
]);
|
|
21688
|
+
var remotePeerSummarySchema = external_exports.object({
|
|
21689
|
+
peerId: remotePeerIdSchema,
|
|
21690
|
+
hostId: remotePeerHostIdSchema,
|
|
21691
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
21692
|
+
name: external_exports.string().min(1).max(120),
|
|
21693
|
+
color: remotePeerColorSchema.optional(),
|
|
21694
|
+
origin: external_exports.string().min(1).max(2048),
|
|
21695
|
+
transportKind: remotePeerTransportKindSchema,
|
|
21696
|
+
encrypted: external_exports.boolean(),
|
|
21694
21697
|
enabled: external_exports.boolean(),
|
|
21695
|
-
|
|
21698
|
+
state: remotePeerStateSchema,
|
|
21699
|
+
supportsPeerPairing: external_exports.boolean().optional(),
|
|
21700
|
+
/** Omitted when either side's node mapping is unknown. */
|
|
21701
|
+
pairedBack: external_exports.boolean().optional(),
|
|
21702
|
+
/** Other configured remote peerIds on this Hub present in this peer's `manifest.peerNodes`. */
|
|
21703
|
+
linkedPeerIds: external_exports.array(remotePeerIdSchema).max(128).optional(),
|
|
21704
|
+
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
21705
|
+
version: external_exports.string().max(128).optional(),
|
|
21706
|
+
platform: external_exports.string().max(64).optional(),
|
|
21707
|
+
hostname: external_exports.string().max(255).optional(),
|
|
21708
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
21709
|
+
lastError: external_exports.string().max(1e3).optional(),
|
|
21710
|
+
projectCount: external_exports.number().int().nonnegative(),
|
|
21711
|
+
createdAt: external_exports.string(),
|
|
21712
|
+
updatedAt: external_exports.string()
|
|
21696
21713
|
});
|
|
21697
|
-
var
|
|
21698
|
-
|
|
21699
|
-
timeoutMinutes: 10
|
|
21714
|
+
var remotePeerListResultSchema = external_exports.object({
|
|
21715
|
+
peers: external_exports.array(remotePeerSummarySchema)
|
|
21700
21716
|
});
|
|
21701
|
-
|
|
21702
|
-
|
|
21703
|
-
|
|
21704
|
-
|
|
21705
|
-
|
|
21706
|
-
|
|
21707
|
-
|
|
21708
|
-
|
|
21709
|
-
|
|
21710
|
-
|
|
21711
|
-
|
|
21712
|
-
|
|
21713
|
-
|
|
21714
|
-
|
|
21715
|
-
|
|
21717
|
+
var remotePeerAddParamsSchema = external_exports.object({
|
|
21718
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
21719
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
21720
|
+
token: external_exports.string().min(1).max(2048).optional(),
|
|
21721
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
21722
|
+
color: remotePeerColorSchema.optional(),
|
|
21723
|
+
pairBack: external_exports.boolean().optional(),
|
|
21724
|
+
meshPeerIds: external_exports.array(remotePeerIdSchema).max(64).optional(),
|
|
21725
|
+
selfOrigin: external_exports.string().min(1).max(2048).optional()
|
|
21726
|
+
}).refine((input3) => Boolean(input3.connectionUrl) || Boolean(input3.origin) && Boolean(input3.token), "Provide either connectionUrl or both origin and token");
|
|
21727
|
+
var remotePeerIntroduceParamsSchema = external_exports.strictObject({
|
|
21728
|
+
origin: external_exports.string().min(1).max(2048),
|
|
21729
|
+
token: external_exports.string().min(1).max(2048),
|
|
21730
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
21731
|
+
color: remotePeerColorSchema.optional(),
|
|
21732
|
+
expectedNodeId: remotePeerNodeIdSchema.optional()
|
|
21716
21733
|
});
|
|
21717
|
-
var
|
|
21718
|
-
|
|
21719
|
-
|
|
21720
|
-
|
|
21721
|
-
|
|
21722
|
-
byHarness: external_exports.record(preferenceHarnessKey, harnessDelegationDefaultSchema)
|
|
21734
|
+
var remotePeerIntroduceResultSchema = external_exports.object({
|
|
21735
|
+
status: external_exports.enum(["added", "updated", "existing"]),
|
|
21736
|
+
peerId: remotePeerIdSchema,
|
|
21737
|
+
hostId: remotePeerHostIdSchema,
|
|
21738
|
+
nodeId: remotePeerNodeIdSchema.optional()
|
|
21723
21739
|
});
|
|
21724
|
-
var
|
|
21725
|
-
|
|
21726
|
-
|
|
21727
|
-
|
|
21728
|
-
|
|
21729
|
-
|
|
21740
|
+
var remotePeerPairingStatusSchema = external_exports.enum([
|
|
21741
|
+
"added",
|
|
21742
|
+
"updated",
|
|
21743
|
+
"existing",
|
|
21744
|
+
"failed",
|
|
21745
|
+
"skipped"
|
|
21746
|
+
]);
|
|
21747
|
+
var remotePeerPairingStepSchema = external_exports.object({
|
|
21748
|
+
targetPeerId: remotePeerIdSchema,
|
|
21749
|
+
targetName: external_exports.string().min(1).max(120),
|
|
21750
|
+
introducedHost: external_exports.union([external_exports.literal("local"), remotePeerIdSchema]),
|
|
21751
|
+
introducedName: external_exports.string().min(1).max(120),
|
|
21752
|
+
status: remotePeerPairingStatusSchema,
|
|
21753
|
+
error: external_exports.string().max(1e3).optional()
|
|
21730
21754
|
});
|
|
21731
|
-
var
|
|
21732
|
-
|
|
21733
|
-
revision: external_exports.number().int().nonnegative(),
|
|
21734
|
-
values: harnessPreferenceValuesSchema
|
|
21755
|
+
var remotePeerPairingReportSchema = external_exports.object({
|
|
21756
|
+
results: external_exports.array(remotePeerPairingStepSchema)
|
|
21735
21757
|
});
|
|
21736
|
-
var
|
|
21737
|
-
|
|
21758
|
+
var remotePeerSyncMeshParamsSchema = external_exports.object({
|
|
21759
|
+
peerIds: external_exports.array(remotePeerIdSchema).max(64).optional(),
|
|
21760
|
+
includeSelf: external_exports.boolean().optional(),
|
|
21761
|
+
includeMesh: external_exports.boolean().optional(),
|
|
21762
|
+
selfOrigin: external_exports.string().min(1).max(2048).optional()
|
|
21738
21763
|
});
|
|
21739
|
-
var
|
|
21740
|
-
|
|
21741
|
-
external_exports.
|
|
21742
|
-
|
|
21743
|
-
|
|
21744
|
-
|
|
21745
|
-
|
|
21746
|
-
|
|
21747
|
-
external_exports.strictObject({
|
|
21748
|
-
kind: external_exports.literal("favorites"),
|
|
21749
|
-
harnessId: harnessIdSchema,
|
|
21750
|
-
modelIds: external_exports.array(modelId).max(2048)
|
|
21751
|
-
}),
|
|
21752
|
-
external_exports.strictObject({
|
|
21753
|
-
kind: external_exports.literal("newThread"),
|
|
21754
|
-
lastHarness: harnessIdSchema.optional(),
|
|
21755
|
-
harnessId: harnessIdSchema.optional(),
|
|
21756
|
-
configuration: harnessDefaultConfigurationSchema.optional()
|
|
21757
|
-
}),
|
|
21758
|
-
external_exports.strictObject({
|
|
21759
|
-
kind: external_exports.literal("delegation"),
|
|
21760
|
-
harnessId: harnessIdSchema,
|
|
21761
|
-
configuration: harnessDelegationDefaultSchema.nullable()
|
|
21762
|
-
})
|
|
21763
|
-
]);
|
|
21764
|
-
var harnessPreferencePatchSchema = external_exports.strictObject({
|
|
21765
|
-
scope: harnessPreferenceScopeSchema.default("external"),
|
|
21766
|
-
operations: external_exports.array(harnessPreferenceOperationSchema).min(1).max(256),
|
|
21767
|
-
initializeOnly: external_exports.boolean().optional(),
|
|
21768
|
-
expectedRevision: external_exports.number().int().nonnegative().optional()
|
|
21769
|
-
}).superRefine((input3, ctx) => {
|
|
21770
|
-
for (const operation of input3.operations) {
|
|
21771
|
-
if (operation.kind === "newThread" && (!operation.lastHarness && !operation.configuration || Boolean(operation.harnessId) !== Boolean(operation.configuration)))
|
|
21772
|
-
ctx.addIssue({
|
|
21773
|
-
code: "custom",
|
|
21774
|
-
message: "A default Harness or complete configuration is required"
|
|
21775
|
-
});
|
|
21776
|
-
}
|
|
21764
|
+
var remotePeerUpdateParamsSchema = external_exports.object({
|
|
21765
|
+
peerId: remotePeerIdSchema,
|
|
21766
|
+
name: external_exports.string().trim().min(1).max(120).optional(),
|
|
21767
|
+
color: remotePeerColorSchema.nullable().optional(),
|
|
21768
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
21769
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
21770
|
+
token: external_exports.string().min(1).max(2048).optional(),
|
|
21771
|
+
enabled: external_exports.boolean().optional()
|
|
21777
21772
|
});
|
|
21778
|
-
var
|
|
21779
|
-
|
|
21780
|
-
revision: external_exports.number().int().nonnegative(),
|
|
21781
|
-
scopes: external_exports.record(harnessPreferenceScopeSchema, harnessPreferenceValuesSchema)
|
|
21782
|
-
});
|
|
21783
|
-
|
|
21784
|
-
// ../shared-contracts/dist/account-credits-presentation.js
|
|
21785
|
-
function accountCreditsWindowLabel(window2, locale, periodLabel) {
|
|
21786
|
-
if (window2.periodType && window2.periodType !== "unknown" && (window2.scope || !window2.label)) {
|
|
21787
|
-
const period = periodLabel(window2.periodType);
|
|
21788
|
-
return window2.scope ? `${localizeHarnessPresentation(window2.scope, locale).label} \xB7 ${period}` : period;
|
|
21789
|
-
}
|
|
21790
|
-
return localizeHarnessPresentation({
|
|
21791
|
-
label: window2.label ?? window2.product ?? periodLabel("unknown"),
|
|
21792
|
-
...window2.localizations ? { localizations: window2.localizations } : {}
|
|
21793
|
-
}, locale).label;
|
|
21794
|
-
}
|
|
21795
|
-
|
|
21796
|
-
// ../shared-contracts/dist/model-price-overrides.js
|
|
21797
|
-
var MODEL_PRICE_OVERRIDES_GET_METHOD = "codexhost/usage/model-prices/get";
|
|
21798
|
-
var MODEL_PRICE_OVERRIDES_SET_METHOD = "codexhost/usage/model-prices/set";
|
|
21799
|
-
var MODEL_PRICE_DEFAULT_METHOD = "codexhost/usage/model-prices/default";
|
|
21800
|
-
var usdPerMillionTokens = external_exports.number().finite().nonnegative();
|
|
21801
|
-
var modelPriceOverrideSchema = external_exports.strictObject({
|
|
21802
|
-
input: usdPerMillionTokens,
|
|
21803
|
-
output: usdPerMillionTokens,
|
|
21804
|
-
cacheRead: usdPerMillionTokens.optional(),
|
|
21805
|
-
cacheWrite: usdPerMillionTokens.optional(),
|
|
21806
|
-
cacheWrite1h: usdPerMillionTokens.optional()
|
|
21773
|
+
var remotePeerIdParamsSchema = external_exports.object({
|
|
21774
|
+
peerId: remotePeerIdSchema
|
|
21807
21775
|
});
|
|
21808
|
-
var
|
|
21809
|
-
|
|
21810
|
-
/** Absolute path of the Host's `pricing.json`. */
|
|
21811
|
-
path: external_exports.string(),
|
|
21812
|
-
entries: external_exports.array(external_exports.strictObject({ key: external_exports.string(), price: modelPriceOverrideSchema })),
|
|
21813
|
-
/** Why the existing file is unusable; the Host then ignores it and refuses to overwrite it. */
|
|
21814
|
-
error: external_exports.string().nullable()
|
|
21776
|
+
var remotePeerRemoveResultSchema = external_exports.object({
|
|
21777
|
+
removed: external_exports.boolean()
|
|
21815
21778
|
});
|
|
21816
|
-
var
|
|
21817
|
-
|
|
21818
|
-
|
|
21819
|
-
|
|
21820
|
-
|
|
21779
|
+
var remotePeerTestParamsSchema = external_exports.object({
|
|
21780
|
+
peerId: remotePeerIdSchema.optional(),
|
|
21781
|
+
connectionUrl: external_exports.string().min(1).max(4096).optional(),
|
|
21782
|
+
origin: external_exports.string().min(1).max(2048).optional(),
|
|
21783
|
+
token: external_exports.string().min(1).max(2048).optional()
|
|
21784
|
+
}).refine((input3) => Boolean(input3.peerId) || Boolean(input3.connectionUrl) || Boolean(input3.origin) && Boolean(input3.token), "Provide peerId, connectionUrl, or both origin and token");
|
|
21785
|
+
var remotePeerTestProjectSchema = external_exports.object({
|
|
21786
|
+
id: external_exports.string().min(1).max(1024),
|
|
21787
|
+
name: external_exports.string().min(1).max(512),
|
|
21788
|
+
path: external_exports.string().min(1).max(8192)
|
|
21821
21789
|
});
|
|
21822
|
-
var
|
|
21823
|
-
|
|
21790
|
+
var remotePeerTestResultSchema = external_exports.object({
|
|
21791
|
+
ok: external_exports.boolean(),
|
|
21792
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
21793
|
+
supportsPeerPairing: external_exports.boolean().optional(),
|
|
21794
|
+
pairedBack: external_exports.boolean().optional(),
|
|
21795
|
+
latencyMs: external_exports.number().int().nonnegative().optional(),
|
|
21796
|
+
origin: external_exports.string().max(2048).optional(),
|
|
21797
|
+
transportKind: remotePeerTransportKindSchema.optional(),
|
|
21798
|
+
encrypted: external_exports.boolean().optional(),
|
|
21799
|
+
version: external_exports.string().max(128).optional(),
|
|
21800
|
+
platform: external_exports.string().max(64).optional(),
|
|
21801
|
+
hostname: external_exports.string().max(255).optional(),
|
|
21802
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
21803
|
+
projectCount: external_exports.number().int().nonnegative().optional(),
|
|
21804
|
+
projects: external_exports.array(remotePeerTestProjectSchema).optional(),
|
|
21805
|
+
error: external_exports.string().max(1e3).optional()
|
|
21824
21806
|
});
|
|
21825
|
-
var
|
|
21826
|
-
|
|
21827
|
-
|
|
21828
|
-
|
|
21829
|
-
|
|
21830
|
-
model: external_exports.string().min(1).max(512),
|
|
21831
|
-
price: modelPriceOverrideSchema
|
|
21807
|
+
var remotePeerManifestProjectSchema = external_exports.object({
|
|
21808
|
+
id: external_exports.string().min(1).max(1024),
|
|
21809
|
+
name: external_exports.string().min(1).max(512),
|
|
21810
|
+
path: external_exports.string().min(1).max(8192),
|
|
21811
|
+
threadIds: external_exports.array(external_exports.string().min(1).max(1024))
|
|
21832
21812
|
});
|
|
21833
|
-
var
|
|
21834
|
-
|
|
21835
|
-
|
|
21836
|
-
|
|
21813
|
+
var remotePeerCapabilitiesSchema = external_exports.object({
|
|
21814
|
+
/** /api/peer/v1/uploads, /api/peer/v1/prompt, and /api/peer/v1/file are all available. */
|
|
21815
|
+
attachments: external_exports.literal(1).optional(),
|
|
21816
|
+
/** /api/peer/v1/workspace-files/rpc and /api/peer/v1/workspace-files/download are available. */
|
|
21817
|
+
workspaceFiles: external_exports.literal(1).optional(),
|
|
21818
|
+
/** Peer supports officeToPdf/render over /api/peer/v1/workspace-files/rpc. */
|
|
21819
|
+
officePreview: external_exports.literal(1).optional(),
|
|
21820
|
+
/** /api/peer/v1/delegation is available for fixed-whitelist cross-host delegation. */
|
|
21821
|
+
delegation: external_exports.literal(1).optional(),
|
|
21822
|
+
/** POST /api/peer/v1/peers is available. */
|
|
21823
|
+
peerPairing: external_exports.literal(1).optional()
|
|
21837
21824
|
});
|
|
21838
|
-
|
|
21839
|
-
|
|
21840
|
-
|
|
21841
|
-
|
|
21842
|
-
|
|
21843
|
-
|
|
21844
|
-
|
|
21845
|
-
|
|
21846
|
-
|
|
21847
|
-
|
|
21848
|
-
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
21849
|
-
/** Display timezone for ranges, dates and hourly buckets; omitted means the Host's local zone. */
|
|
21850
|
-
timeZone: external_exports.string().min(1).max(128).refine((value) => {
|
|
21851
|
-
try {
|
|
21852
|
-
new Intl.DateTimeFormat("en", { timeZone: value });
|
|
21853
|
-
return true;
|
|
21854
|
-
} catch {
|
|
21855
|
-
return false;
|
|
21856
|
-
}
|
|
21857
|
-
}, "Unsupported usage statistics timezone").optional(),
|
|
21858
|
-
harness: harness.optional(),
|
|
21859
|
-
model: model.nullable().optional(),
|
|
21860
|
-
project: project.nullable().optional(),
|
|
21861
|
-
/** One date in the query timezone inside the range. */
|
|
21862
|
-
date: localDate.optional()
|
|
21825
|
+
var remotePeerManifestSchema = external_exports.object({
|
|
21826
|
+
version: external_exports.string().max(128),
|
|
21827
|
+
platform: external_exports.string().max(64),
|
|
21828
|
+
hostname: external_exports.string().max(255),
|
|
21829
|
+
homeDir: external_exports.string().max(4096).optional(),
|
|
21830
|
+
epoch: external_exports.string().min(1).max(256),
|
|
21831
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
21832
|
+
peerNodes: external_exports.record(remotePeerHostIdSchema, remotePeerNodeIdSchema).refine((v) => Object.keys(v).length <= 128).optional(),
|
|
21833
|
+
projects: external_exports.array(remotePeerManifestProjectSchema),
|
|
21834
|
+
capabilities: remotePeerCapabilitiesSchema.optional()
|
|
21863
21835
|
});
|
|
21864
|
-
var
|
|
21865
|
-
|
|
21866
|
-
|
|
21867
|
-
|
|
21868
|
-
|
|
21869
|
-
|
|
21870
|
-
|
|
21871
|
-
|
|
21872
|
-
|
|
21873
|
-
|
|
21874
|
-
|
|
21875
|
-
costUsd: external_exports.number().finite().min(0),
|
|
21876
|
-
/** Requests without a price (or the cache data the price needs); not in `costUsd`. */
|
|
21877
|
-
unpricedRequests: count,
|
|
21878
|
-
/**
|
|
21879
|
-
* Requests whose storage gave no token counts: counted as requests, with neither tokens nor
|
|
21880
|
-
* cost, and not as unpriced.
|
|
21881
|
-
*/
|
|
21882
|
-
unmeteredRequests: count
|
|
21836
|
+
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;
|
|
21837
|
+
var remotePeerPromptParamsSchema = external_exports.strictObject({
|
|
21838
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
21839
|
+
scope: external_exports.string().regex(REMOTE_PEER_UPLOAD_SCOPE_PATTERN).optional(),
|
|
21840
|
+
requestId: external_exports.string().min(1).max(256).optional(),
|
|
21841
|
+
mode: external_exports.enum(["queue", "steer"]).optional(),
|
|
21842
|
+
expectedTurnId: external_exports.string().min(1).max(1024).nullable().optional(),
|
|
21843
|
+
content: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
21844
|
+
external_exports.strictObject({ type: external_exports.literal("text"), text: external_exports.string() }),
|
|
21845
|
+
external_exports.strictObject({ type: external_exports.literal("file"), receiptId: external_exports.string().min(1).max(128) })
|
|
21846
|
+
])).min(1).max(64)
|
|
21883
21847
|
});
|
|
21884
|
-
var
|
|
21885
|
-
|
|
21886
|
-
|
|
21887
|
-
|
|
21888
|
-
|
|
21889
|
-
|
|
21890
|
-
|
|
21891
|
-
/** Models the session used, most requests first. */
|
|
21892
|
-
models: external_exports.array(model).max(16),
|
|
21893
|
-
firstAtMs: count,
|
|
21894
|
-
lastAtMs: count,
|
|
21895
|
-
...totals
|
|
21848
|
+
var remotePeerErrorEnvelopeSchema = external_exports.object({
|
|
21849
|
+
ok: external_exports.literal(false),
|
|
21850
|
+
error: external_exports.object({
|
|
21851
|
+
code: external_exports.string(),
|
|
21852
|
+
message: external_exports.string(),
|
|
21853
|
+
details: external_exports.record(external_exports.string(), external_exports.unknown()).optional()
|
|
21854
|
+
})
|
|
21896
21855
|
});
|
|
21897
|
-
var
|
|
21898
|
-
|
|
21899
|
-
|
|
21900
|
-
|
|
21901
|
-
|
|
21902
|
-
|
|
21903
|
-
|
|
21904
|
-
|
|
21905
|
-
|
|
21906
|
-
|
|
21907
|
-
|
|
21908
|
-
unknownProject: external_exports.boolean(),
|
|
21909
|
-
date: localDate.nullable()
|
|
21856
|
+
var remotePeerUploadResultSchema = external_exports.union([
|
|
21857
|
+
external_exports.object({
|
|
21858
|
+
ok: external_exports.literal(true),
|
|
21859
|
+
value: external_exports.object({
|
|
21860
|
+
receiptId: external_exports.string().min(1),
|
|
21861
|
+
file: external_exports.object({
|
|
21862
|
+
attachmentId: external_exports.string(),
|
|
21863
|
+
name: external_exports.string(),
|
|
21864
|
+
bytes: external_exports.number().int().nonnegative()
|
|
21865
|
+
})
|
|
21866
|
+
})
|
|
21910
21867
|
}),
|
|
21911
|
-
|
|
21912
|
-
|
|
21913
|
-
|
|
21914
|
-
|
|
21915
|
-
|
|
21916
|
-
|
|
21917
|
-
harnesses: external_exports.array(harness).max(256),
|
|
21918
|
-
models: external_exports.array(model.nullable()).max(4096),
|
|
21919
|
-
projects: external_exports.array(project.nullable()).max(4096)
|
|
21868
|
+
remotePeerErrorEnvelopeSchema
|
|
21869
|
+
]);
|
|
21870
|
+
var remotePeerPromptResultSchema = external_exports.union([
|
|
21871
|
+
external_exports.object({
|
|
21872
|
+
ok: external_exports.literal(true),
|
|
21873
|
+
value: external_exports.object({ accepted: external_exports.literal(true) })
|
|
21920
21874
|
}),
|
|
21921
|
-
|
|
21922
|
-
* Optional for older Hosts; missing/conflicting labels fall back to the native model ID.
|
|
21923
|
-
*/
|
|
21924
|
-
modelLabels: external_exports.array(external_exports.strictObject({ harness, model, label: model })).max(4096).optional(),
|
|
21925
|
-
/** Native credits, all filters applied, never combined across Harnesses or treated as USD.
|
|
21926
|
-
* Only groups with at least one reported value appear; reportedRequests exposes partial data.
|
|
21927
|
-
*/
|
|
21928
|
-
credits: external_exports.array(external_exports.strictObject({
|
|
21929
|
-
harness,
|
|
21930
|
-
model: model.nullable(),
|
|
21931
|
-
credits: external_exports.number().finite().min(0),
|
|
21932
|
-
reportedRequests: count,
|
|
21933
|
-
requests: count
|
|
21934
|
-
})).max(4096).optional(),
|
|
21935
|
-
/** All filters applied. */
|
|
21936
|
-
totals: usageStatisticsTotalsSchema,
|
|
21937
|
-
/** Each date and Harness of the range: every filter except the day. */
|
|
21938
|
-
daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
|
|
21939
|
-
/** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
|
|
21940
|
-
hourly: external_exports.array(external_exports.strictObject({
|
|
21941
|
-
weekday: external_exports.number().int().min(0).max(6),
|
|
21942
|
-
hour: external_exports.number().int().min(0).max(23),
|
|
21943
|
-
...totals
|
|
21944
|
-
})).max(168),
|
|
21945
|
-
byHarness: external_exports.array(external_exports.strictObject({ harness, ...totals })).max(256),
|
|
21946
|
-
byModel: external_exports.array(external_exports.strictObject({
|
|
21947
|
-
model: model.nullable(),
|
|
21948
|
-
...totals,
|
|
21949
|
-
/** Requests priced by what the Harness recorded they cost, not by a price list. */
|
|
21950
|
-
harnessPricedRequests: count
|
|
21951
|
-
})).max(4096),
|
|
21952
|
-
byProject: external_exports.array(external_exports.strictObject({ project: project.nullable(), ...totals })).max(4096),
|
|
21953
|
-
/**
|
|
21954
|
-
* The sessions that spent the most, by cost and by tokens without cache, all filters applied;
|
|
21955
|
-
* requests without a native session are not listed here but count everywhere else.
|
|
21956
|
-
*/
|
|
21957
|
-
sessions: external_exports.array(usageStatisticsSessionSchema).max(100),
|
|
21958
|
-
/**
|
|
21959
|
-
* The sessions last active in the range, newest first, all filters applied. Optional for older
|
|
21960
|
-
* Hosts; missing is treated as no list rather than no sessions.
|
|
21961
|
-
*/
|
|
21962
|
-
recentSessions: external_exports.array(usageStatisticsSessionSchema).max(100).optional()
|
|
21963
|
-
});
|
|
21964
|
-
|
|
21965
|
-
// ../shared-contracts/dist/thread-prewarm.js
|
|
21966
|
-
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
21967
|
-
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
21968
|
-
|
|
21969
|
-
// ../shared-contracts/dist/thread-questions.js
|
|
21970
|
-
var field = external_exports.discriminatedUnion("type", [
|
|
21971
|
-
external_exports.object({
|
|
21972
|
-
id: external_exports.string().min(1),
|
|
21973
|
-
type: external_exports.literal("choice"),
|
|
21974
|
-
prompt: external_exports.string(),
|
|
21975
|
-
options: external_exports.array(external_exports.object({
|
|
21976
|
-
value: external_exports.string().min(1),
|
|
21977
|
-
label: external_exports.string(),
|
|
21978
|
-
description: external_exports.string().optional()
|
|
21979
|
-
})).min(1),
|
|
21980
|
-
multiple: external_exports.boolean(),
|
|
21981
|
-
allowOther: external_exports.boolean(),
|
|
21982
|
-
optional: external_exports.boolean()
|
|
21983
|
-
}),
|
|
21984
|
-
external_exports.object({
|
|
21985
|
-
id: external_exports.string().min(1),
|
|
21986
|
-
type: external_exports.literal("text"),
|
|
21987
|
-
prompt: external_exports.string(),
|
|
21988
|
-
multiline: external_exports.boolean(),
|
|
21989
|
-
secret: external_exports.literal(false),
|
|
21990
|
-
optional: external_exports.boolean(),
|
|
21991
|
-
placeholder: external_exports.string().optional(),
|
|
21992
|
-
prefill: external_exports.string().optional()
|
|
21993
|
-
})
|
|
21875
|
+
remotePeerErrorEnvelopeSchema
|
|
21994
21876
|
]);
|
|
21995
|
-
var
|
|
21996
|
-
|
|
21997
|
-
|
|
21998
|
-
|
|
21999
|
-
questions: external_exports.array(field).min(1)
|
|
22000
|
-
}).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
|
|
22001
|
-
message: "Shared cards require at least one multi-select question"
|
|
21877
|
+
var remotePeerDirectoryEntrySchema = external_exports.object({
|
|
21878
|
+
name: external_exports.string().min(1).max(512),
|
|
21879
|
+
path: external_exports.string().min(1).max(8192),
|
|
21880
|
+
kind: external_exports.literal("directory")
|
|
22002
21881
|
});
|
|
22003
|
-
var
|
|
22004
|
-
|
|
22005
|
-
|
|
22006
|
-
threadId: external_exports.string().min(1),
|
|
22007
|
-
turnId: external_exports.string().min(1),
|
|
22008
|
-
interactionId: external_exports.string().min(1),
|
|
22009
|
-
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
22010
|
-
cancelled: external_exports.boolean().default(false)
|
|
21882
|
+
var remotePeerListDirsParamsSchema = external_exports.object({
|
|
21883
|
+
peerId: remotePeerIdSchema,
|
|
21884
|
+
path: external_exports.string().min(1).max(8192).optional()
|
|
22011
21885
|
});
|
|
22012
|
-
var
|
|
22013
|
-
|
|
22014
|
-
|
|
22015
|
-
|
|
22016
|
-
|
|
22017
|
-
oldText: external_exports.string().nullable(),
|
|
22018
|
-
newText: external_exports.string()
|
|
21886
|
+
var remotePeerListDirsResultSchema = external_exports.object({
|
|
21887
|
+
path: external_exports.string().min(1).max(8192),
|
|
21888
|
+
parentPath: external_exports.string().min(1).max(8192).nullable(),
|
|
21889
|
+
homeDir: external_exports.string().min(1).max(8192).optional(),
|
|
21890
|
+
entries: external_exports.array(remotePeerDirectoryEntrySchema)
|
|
22019
21891
|
});
|
|
22020
|
-
var
|
|
22021
|
-
|
|
22022
|
-
|
|
22023
|
-
|
|
21892
|
+
var remotePeerCreateDirParamsSchema = external_exports.object({
|
|
21893
|
+
peerId: remotePeerIdSchema,
|
|
21894
|
+
parentPath: external_exports.string().min(1).max(8192),
|
|
21895
|
+
name: external_exports.string().min(1).max(255).refine((value) => value.trim().length > 0, "Directory name cannot be blank")
|
|
22024
21896
|
});
|
|
22025
|
-
var
|
|
22026
|
-
|
|
22027
|
-
|
|
22028
|
-
var webOpenResultSchema = external_exports.strictObject({});
|
|
22029
|
-
|
|
22030
|
-
// ../shared-contracts/dist/web-tool-output.js
|
|
22031
|
-
var webToolOutputReferenceSchema = external_exports.object({
|
|
22032
|
-
sessionId: external_exports.string().min(1),
|
|
22033
|
-
epoch: external_exports.string().min(1),
|
|
22034
|
-
turn: external_exports.number().int().nonnegative(),
|
|
22035
|
-
seq: external_exports.number().int().nonnegative(),
|
|
22036
|
-
callId: external_exports.string().min(1),
|
|
22037
|
-
part: external_exports.number().int().nonnegative(),
|
|
22038
|
-
version: external_exports.string().min(1)
|
|
21897
|
+
var remotePeerCreateDirResultSchema = external_exports.object({
|
|
21898
|
+
path: external_exports.string().min(1).max(8192),
|
|
21899
|
+
name: external_exports.string().min(1).max(255)
|
|
22039
21900
|
});
|
|
22040
|
-
var
|
|
22041
|
-
|
|
22042
|
-
|
|
22043
|
-
|
|
21901
|
+
var remotePeerCreateWorkspaceParamsSchema = external_exports.object({
|
|
21902
|
+
peerId: remotePeerIdSchema,
|
|
21903
|
+
path: external_exports.string().min(1).max(8192),
|
|
21904
|
+
title: external_exports.string().trim().min(1).max(255).optional()
|
|
22044
21905
|
});
|
|
22045
|
-
|
|
22046
|
-
|
|
22047
|
-
|
|
22048
|
-
title: external_exports.string().trim().min(1).max(
|
|
22049
|
-
type: external_exports.enum(["info", "warning", "danger"]),
|
|
22050
|
-
body: external_exports.string().trim().min(1).max(16 * 1024)
|
|
21906
|
+
var remotePeerRenameWorkspaceParamsSchema = external_exports.object({
|
|
21907
|
+
peerId: remotePeerIdSchema,
|
|
21908
|
+
workspaceId: external_exports.string().min(1).max(1024),
|
|
21909
|
+
title: external_exports.string().trim().min(1).max(255)
|
|
22051
21910
|
});
|
|
22052
|
-
var
|
|
22053
|
-
|
|
22054
|
-
|
|
22055
|
-
|
|
22056
|
-
|
|
21911
|
+
var remotePeerDeleteWorkspaceParamsSchema = external_exports.object({
|
|
21912
|
+
peerId: remotePeerIdSchema,
|
|
21913
|
+
workspaceId: external_exports.string().min(1).max(1024)
|
|
21914
|
+
});
|
|
21915
|
+
var remotePeerWorkspaceMutationResultSchema = external_exports.object({
|
|
21916
|
+
workspaceId: external_exports.string().min(1).max(1024).optional(),
|
|
21917
|
+
manifest: remotePeerManifestSchema
|
|
21918
|
+
});
|
|
21919
|
+
var delegationRemoteHostsParamsSchema = external_exports.object({
|
|
21920
|
+
sessionHostId: external_exports.string().min(1).max(128).optional()
|
|
21921
|
+
});
|
|
21922
|
+
var delegationRemoteHostOptionSchema = external_exports.object({
|
|
21923
|
+
hostId: external_exports.union([external_exports.literal("local"), remotePeerHostIdSchema]),
|
|
21924
|
+
name: external_exports.string().min(1).max(120),
|
|
21925
|
+
isLocal: external_exports.boolean().optional(),
|
|
21926
|
+
color: remotePeerColorSchema.optional(),
|
|
21927
|
+
hostname: external_exports.string().max(255).optional()
|
|
21928
|
+
});
|
|
21929
|
+
var delegationRemoteHostsResultSchema = external_exports.object({
|
|
21930
|
+
hosts: external_exports.array(delegationRemoteHostOptionSchema)
|
|
21931
|
+
});
|
|
21932
|
+
var delegationHostHarnessesParamsSchema = external_exports.object({
|
|
21933
|
+
hostId: external_exports.union([external_exports.literal("local"), remotePeerHostIdSchema])
|
|
21934
|
+
});
|
|
21935
|
+
var delegationHostHarnessOptionSchema = external_exports.object({
|
|
21936
|
+
id: external_exports.string().regex(/^[a-z0-9][a-z0-9-]*$/u),
|
|
21937
|
+
name: external_exports.string().min(1).max(120)
|
|
21938
|
+
});
|
|
21939
|
+
var delegationHostHarnessesResultSchema = external_exports.object({
|
|
21940
|
+
harnesses: external_exports.array(delegationHostHarnessOptionSchema)
|
|
22057
21941
|
});
|
|
22058
|
-
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
22059
|
-
"codexhost/console/remote-connections",
|
|
22060
|
-
"codexhost/runtime/status",
|
|
22061
|
-
"codexhost/remote/ssh-setup",
|
|
22062
|
-
"codexhost/harness/plugins/list",
|
|
22063
|
-
"codexhost/harness/display-settings/capabilities",
|
|
22064
|
-
"codexhost/harness/display-settings/get",
|
|
22065
|
-
"codexhost/harness/display-settings/set",
|
|
22066
|
-
"codexhost/harness/inspect",
|
|
22067
|
-
"codexhost/harness/installation",
|
|
22068
|
-
"codexhost/harness/installation/start",
|
|
22069
|
-
"codexhost/harness/installation/status",
|
|
22070
|
-
"codexhost/harness/launch-settings/get",
|
|
22071
|
-
"codexhost/harness/launch-settings/set",
|
|
22072
|
-
"codexhost/harness/web-ui/open",
|
|
22073
|
-
"codexhost/harness/accounts/sources",
|
|
22074
|
-
"codexhost/harness/accounts/list",
|
|
22075
|
-
"codexhost/harness/accounts/inspect",
|
|
22076
|
-
"codexhost/harness/credential-imports",
|
|
22077
|
-
"codexhost/harness/session-import/sources",
|
|
22078
|
-
"codexhost/harness/session-import/list",
|
|
22079
|
-
"codexhost/harness/session-import/import",
|
|
22080
|
-
"codexhost/account/list",
|
|
22081
|
-
"codexhost/account/refresh",
|
|
22082
|
-
"codexhost/account/usage/inspect",
|
|
22083
|
-
"codexhost/usage/model-prices/get",
|
|
22084
|
-
"codexhost/usage/model-prices/set",
|
|
22085
|
-
"codexhost/usage/model-prices/default",
|
|
22086
|
-
"codexhost/usage/statistics/get",
|
|
22087
|
-
"codexhost/update/check",
|
|
22088
|
-
"codexhost/update/start",
|
|
22089
|
-
"codexhost/update/status"
|
|
22090
|
-
]);
|
|
22091
|
-
|
|
22092
|
-
// ../shared-contracts/dist/version.js
|
|
22093
|
-
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
22094
21942
|
|
|
22095
|
-
// ../shared-contracts/dist/
|
|
22096
|
-
var
|
|
22097
|
-
var
|
|
22098
|
-
"
|
|
22099
|
-
"
|
|
22100
|
-
"
|
|
22101
|
-
"
|
|
22102
|
-
"
|
|
22103
|
-
"
|
|
22104
|
-
|
|
22105
|
-
|
|
22106
|
-
|
|
22107
|
-
|
|
22108
|
-
|
|
22109
|
-
|
|
22110
|
-
|
|
22111
|
-
|
|
22112
|
-
|
|
22113
|
-
|
|
21943
|
+
// ../shared-contracts/dist/peer-delegation.js
|
|
21944
|
+
var PEER_DELEGATION_BRIDGE_VERSION = 1;
|
|
21945
|
+
var PEER_DELEGATION_OPERATIONS = [
|
|
21946
|
+
"listHarnesses",
|
|
21947
|
+
"inspect",
|
|
21948
|
+
"start",
|
|
21949
|
+
"send",
|
|
21950
|
+
"cancel",
|
|
21951
|
+
"read",
|
|
21952
|
+
"answer",
|
|
21953
|
+
"list"
|
|
21954
|
+
];
|
|
21955
|
+
var peerDelegationOperationSchema = external_exports.enum(PEER_DELEGATION_OPERATIONS);
|
|
21956
|
+
var peerDelegationRequestSchema = external_exports.strictObject({
|
|
21957
|
+
operation: peerDelegationOperationSchema,
|
|
21958
|
+
hopCount: external_exports.number().int().min(0).max(16),
|
|
21959
|
+
/** Opaque A-side peer pairing identifier used by B to scope implicit deduplication per Peer. */
|
|
21960
|
+
sourceId: remotePeerIdSchema.optional(),
|
|
21961
|
+
input: jsonObjectSchema
|
|
21962
|
+
});
|
|
21963
|
+
var peerDelegationErrorSchema = external_exports.strictObject({
|
|
21964
|
+
code: external_exports.string().min(1).max(128),
|
|
21965
|
+
message: external_exports.string().max(4096),
|
|
21966
|
+
details: jsonObjectSchema.optional()
|
|
21967
|
+
});
|
|
21968
|
+
var peerDelegationResponseSchema = external_exports.union([
|
|
21969
|
+
external_exports.strictObject({
|
|
21970
|
+
ok: external_exports.literal(true),
|
|
21971
|
+
value: jsonValueSchema
|
|
21972
|
+
}),
|
|
21973
|
+
external_exports.strictObject({
|
|
21974
|
+
ok: external_exports.literal(false),
|
|
21975
|
+
error: peerDelegationErrorSchema
|
|
21976
|
+
})
|
|
22114
21977
|
]);
|
|
22115
|
-
var
|
|
22116
|
-
|
|
22117
|
-
|
|
22118
|
-
|
|
22119
|
-
|
|
22120
|
-
|
|
22121
|
-
|
|
22122
|
-
|
|
22123
|
-
|
|
22124
|
-
|
|
22125
|
-
|
|
22126
|
-
|
|
22127
|
-
|
|
21978
|
+
var peerDelegationHostProjectSchema = external_exports.strictObject({
|
|
21979
|
+
id: external_exports.string().min(1).max(1024),
|
|
21980
|
+
name: external_exports.string().min(1).max(512),
|
|
21981
|
+
path: external_exports.string().min(1).max(8192)
|
|
21982
|
+
});
|
|
21983
|
+
var peerDelegationHostSummarySchema = external_exports.strictObject({
|
|
21984
|
+
hostId: remotePeerHostIdSchema,
|
|
21985
|
+
nodeId: remotePeerNodeIdSchema.optional(),
|
|
21986
|
+
displayName: external_exports.string().min(1).max(120),
|
|
21987
|
+
online: external_exports.boolean(),
|
|
21988
|
+
state: remotePeerStateSchema,
|
|
21989
|
+
delegation: external_exports.boolean(),
|
|
21990
|
+
projects: external_exports.array(peerDelegationHostProjectSchema),
|
|
21991
|
+
platform: external_exports.string().max(64).optional(),
|
|
21992
|
+
hostname: external_exports.string().max(255).optional(),
|
|
21993
|
+
homeDir: external_exports.string().max(4096).optional()
|
|
21994
|
+
});
|
|
21995
|
+
var peerDelegationHostsResultSchema = external_exports.strictObject({
|
|
21996
|
+
hosts: external_exports.array(peerDelegationHostSummarySchema)
|
|
22128
21997
|
});
|
|
21998
|
+
var peerDelegationBridgeDescriptorSchema = external_exports.strictObject({
|
|
21999
|
+
version: external_exports.literal(PEER_DELEGATION_BRIDGE_VERSION),
|
|
22000
|
+
instanceId: external_exports.string().min(1).max(128),
|
|
22001
|
+
pid: external_exports.number().int().positive(),
|
|
22002
|
+
endpoint: external_exports.string().min(1).max(256),
|
|
22003
|
+
token: external_exports.string().regex(/^[0-9a-f]{64}$/u),
|
|
22004
|
+
startedAt: external_exports.number().int().nonnegative()
|
|
22005
|
+
});
|
|
22006
|
+
var peerDelegationBridgeRequestSchema = external_exports.union([
|
|
22007
|
+
external_exports.strictObject({
|
|
22008
|
+
operation: external_exports.literal("hosts")
|
|
22009
|
+
}),
|
|
22010
|
+
external_exports.strictObject({
|
|
22011
|
+
operation: peerDelegationOperationSchema,
|
|
22012
|
+
hostId: remotePeerHostIdSchema,
|
|
22013
|
+
hopCount: external_exports.number().int().min(0).max(16),
|
|
22014
|
+
timeoutMs: external_exports.number().int().min(1).max(12e4).optional(),
|
|
22015
|
+
input: jsonObjectSchema
|
|
22016
|
+
})
|
|
22017
|
+
]);
|
|
22129
22018
|
|
|
22130
|
-
// ../shared-contracts/dist/
|
|
22131
|
-
var
|
|
22132
|
-
|
|
22133
|
-
|
|
22134
|
-
|
|
22135
|
-
|
|
22136
|
-
balance: accountBalanceSnapshotSchema.optional()
|
|
22019
|
+
// ../shared-contracts/dist/credential-imports.js
|
|
22020
|
+
var credentialSourceSchema = external_exports.object({
|
|
22021
|
+
id: external_exports.string().min(1).max(256),
|
|
22022
|
+
harnessId: external_exports.string().min(1),
|
|
22023
|
+
label: external_exports.string().min(1).max(512),
|
|
22024
|
+
provider: external_exports.enum(["openai-codex", "xai"])
|
|
22137
22025
|
}).strict();
|
|
22138
|
-
|
|
22139
|
-
|
|
22140
|
-
|
|
22141
|
-
|
|
22142
|
-
|
|
22143
|
-
}
|
|
22144
|
-
var harnessAccountSnapshotSchema = requireReportedQuota(harnessAccountSnapshotObject);
|
|
22145
|
-
var harnessAccountIdentityShape = {
|
|
22146
|
-
harnessId: harnessIdSchema,
|
|
22147
|
-
harnessName: external_exports.string().trim().min(1).max(128)
|
|
22148
|
-
};
|
|
22149
|
-
var harnessAccountSourceSchema = external_exports.object(harnessAccountIdentityShape).strict();
|
|
22150
|
-
var harnessAccountSourceListParamsSchema = external_exports.object({}).strict();
|
|
22151
|
-
var harnessAccountSourceListResultSchema = external_exports.object({ sources: external_exports.array(harnessAccountSourceSchema).max(128) }).strict();
|
|
22152
|
-
var harnessAccountInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
22153
|
-
var harnessAccountInspectResultSchema = external_exports.object({
|
|
22154
|
-
...harnessAccountIdentityShape,
|
|
22155
|
-
account: harnessAccountSnapshotSchema.nullable(),
|
|
22156
|
-
/** Every Billing Source from one Harness; `account` remains the first for older clients. */
|
|
22157
|
-
accounts: external_exports.array(harnessAccountSnapshotSchema).max(8).optional()
|
|
22026
|
+
var credentialImportNameSchema = external_exports.string().regex(/^[a-z][a-z0-9-]{0,47}$/);
|
|
22027
|
+
var credentialImportRecordSchema = external_exports.object({
|
|
22028
|
+
name: credentialImportNameSchema,
|
|
22029
|
+
source: credentialSourceSchema,
|
|
22030
|
+
importedAt: external_exports.string()
|
|
22158
22031
|
}).strict();
|
|
22159
|
-
var
|
|
22160
|
-
|
|
22161
|
-
accounts: external_exports.array(requireReportedQuota(harnessAccountSnapshotObject.extend(harnessAccountIdentityShape))).max(128)
|
|
22162
|
-
}).strict();
|
|
22163
|
-
|
|
22164
|
-
// ../shared-contracts/dist/harness-route.js
|
|
22165
|
-
var harnessPluginRouteSchema = external_exports.object({
|
|
22166
|
-
harnessId: harnessPluginIdSchema,
|
|
22167
|
-
model: harnessModelRefSchema.optional(),
|
|
22168
|
-
thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
22169
|
-
permissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
22170
|
-
/** A draft prewarm create: stays unsubmitted until the user's first Turn.
|
|
22171
|
-
* Desktop forwards only the Model of a main-process prewarm to thread/start. */
|
|
22172
|
-
prewarm: external_exports.literal(true).optional()
|
|
22173
|
-
}).strict();
|
|
22174
|
-
|
|
22175
|
-
// ../shared-contracts/dist/harness-launch-settings.js
|
|
22176
|
-
var HARNESS_LAUNCH_SETTINGS_GET_METHOD = "codexhost/harness/launch-settings/get";
|
|
22177
|
-
var HARNESS_LAUNCH_SETTINGS_SET_METHOD = "codexhost/harness/launch-settings/set";
|
|
22178
|
-
var harnessLaunchPathSchema = external_exports.string().trim().min(1).max(4096).refine((value) => !/[\u0000\r\n]/u.test(value), "Invalid entrypoint path");
|
|
22179
|
-
var harnessLaunchSettingsGetSchema = external_exports.object({
|
|
22180
|
-
harnessId: harnessPluginIdSchema
|
|
22181
|
-
}).strict();
|
|
22182
|
-
var harnessLaunchSettingsSetSchema = harnessLaunchSettingsGetSchema.extend({
|
|
22183
|
-
path: harnessLaunchPathSchema.nullable()
|
|
22184
|
-
});
|
|
22185
|
-
var harnessLaunchSettingsSchema = external_exports.object({
|
|
22186
|
-
path: harnessLaunchPathSchema.nullable(),
|
|
22187
|
-
restartRequired: external_exports.boolean()
|
|
22188
|
-
}).strict();
|
|
22189
|
-
|
|
22190
|
-
// ../shared-contracts/dist/harness-installation.js
|
|
22191
|
-
var HARNESS_INSTALLATION_START_METHOD = "codexhost/harness/installation/start";
|
|
22192
|
-
var HARNESS_INSTALLATION_STATUS_METHOD = "codexhost/harness/installation/status";
|
|
22193
|
-
var harnessInstallationParamsSchema = external_exports.object({
|
|
22194
|
-
harnessId: harnessIdSchema,
|
|
22195
|
-
action: external_exports.enum(["check", "update", "install"]),
|
|
22196
|
-
confirmedVersion: external_exports.string().min(1).max(128).optional()
|
|
22197
|
-
}).strict().refine(({ action, confirmedVersion }) => action === "update" || confirmedVersion === void 0);
|
|
22198
|
-
var harnessInstallationStateSchema = external_exports.object({
|
|
22199
|
-
currentVersion: external_exports.string().min(1).max(128),
|
|
22200
|
-
latestVersion: external_exports.string().min(1).max(128),
|
|
22201
|
-
updateAvailable: external_exports.boolean(),
|
|
22202
|
-
canUpdate: external_exports.boolean(),
|
|
22203
|
-
/** Present when the Adapter has a verified list and the available target is outside it. */
|
|
22204
|
-
latestVerifiedVersion: external_exports.string().min(1).max(128).optional(),
|
|
22205
|
-
/** Update preflight stopped before running the installer; latestVersion needs confirmation. */
|
|
22206
|
-
confirmationRequired: external_exports.literal(true).optional(),
|
|
22207
|
-
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
22208
|
-
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
22209
|
-
/** Official download opened by the user; does not imply an automatic installation. */
|
|
22210
|
-
manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
|
|
22211
|
-
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
22212
|
-
message: external_exports.string().max(2048).optional(),
|
|
22213
|
-
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
22214
|
-
/** Safe plugin-owned explanation, distinct from raw diagnostic message. */
|
|
22215
|
-
notice: harnessLocalizedTextSchema.optional(),
|
|
22216
|
-
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
22217
|
-
}).strict();
|
|
22218
|
-
var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
|
|
22219
|
-
var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
|
|
22220
|
-
external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
|
|
22032
|
+
var credentialImportsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
22033
|
+
external_exports.object({ action: external_exports.literal("list") }).strict(),
|
|
22221
22034
|
external_exports.object({
|
|
22222
|
-
|
|
22223
|
-
|
|
22224
|
-
|
|
22035
|
+
action: external_exports.literal("import"),
|
|
22036
|
+
sourceId: external_exports.string().min(1).max(256),
|
|
22037
|
+
name: credentialImportNameSchema,
|
|
22038
|
+
confirmed: external_exports.literal(true)
|
|
22225
22039
|
}).strict(),
|
|
22226
22040
|
external_exports.object({
|
|
22227
|
-
|
|
22228
|
-
|
|
22229
|
-
|
|
22041
|
+
action: external_exports.literal("reimport"),
|
|
22042
|
+
sourceId: external_exports.string().min(1).max(256),
|
|
22043
|
+
name: credentialImportNameSchema,
|
|
22044
|
+
confirmed: external_exports.literal(true)
|
|
22045
|
+
}).strict(),
|
|
22046
|
+
external_exports.object({
|
|
22047
|
+
action: external_exports.literal("remove"),
|
|
22048
|
+
name: credentialImportNameSchema,
|
|
22049
|
+
confirmed: external_exports.literal(true)
|
|
22230
22050
|
}).strict()
|
|
22231
22051
|
]);
|
|
22232
|
-
|
|
22233
|
-
|
|
22234
|
-
|
|
22235
|
-
|
|
22236
|
-
|
|
22237
|
-
|
|
22238
|
-
"
|
|
22239
|
-
"plus",
|
|
22240
|
-
"pro",
|
|
22241
|
-
"prolite",
|
|
22242
|
-
"team",
|
|
22243
|
-
"self_serve_business_prolite",
|
|
22244
|
-
"self_serve_business_usage_based",
|
|
22245
|
-
"business",
|
|
22246
|
-
"ent26",
|
|
22247
|
-
"enterprise_cbp_automation",
|
|
22248
|
-
"enterprise_cbp_usage_based",
|
|
22249
|
-
"enterprise",
|
|
22250
|
-
"edu",
|
|
22251
|
-
"edu_plus",
|
|
22252
|
-
"edu_pro",
|
|
22253
|
-
"unknown"
|
|
22254
|
-
]);
|
|
22255
|
-
var codexAccountSchema = external_exports.object({
|
|
22256
|
-
accountId: accountIdSchema,
|
|
22257
|
-
label: nonBlankTextSchema3.max(256),
|
|
22258
|
-
email: external_exports.string().email().max(320).optional(),
|
|
22259
|
-
planType: codexAccountPlanTypeSchema.optional()
|
|
22260
|
-
}).strict();
|
|
22261
|
-
var codexAccountPhaseSchema = external_exports.enum(["ready", "unavailable"]);
|
|
22262
|
-
var codexAccountListResultSchema = external_exports.object({
|
|
22263
|
-
version: external_exports.literal(2),
|
|
22264
|
-
currentAccountId: accountIdSchema.nullable(),
|
|
22265
|
-
phase: codexAccountPhaseSchema,
|
|
22266
|
-
revision: external_exports.number().int().nonnegative(),
|
|
22267
|
-
instanceId: nonBlankTextSchema3.max(1024).optional(),
|
|
22268
|
-
accounts: external_exports.array(codexAccountSchema).max(1)
|
|
22269
|
-
}).strict();
|
|
22270
|
-
var codexAccountChangedSchema = codexAccountListResultSchema;
|
|
22271
|
-
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
22272
|
-
var codexAccountUsageResultSchema = external_exports.object({
|
|
22273
|
-
accountId: accountIdSchema,
|
|
22274
|
-
usage: threadUsageSnapshotSchema.nullable(),
|
|
22275
|
-
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
22276
|
-
freshness: external_exports.enum(["live", "cached"]),
|
|
22277
|
-
observedAt: external_exports.string().datetime().nullable()
|
|
22278
|
-
}).strict();
|
|
22279
|
-
|
|
22280
|
-
// ../shared-contracts/dist/harness-session-import.js
|
|
22281
|
-
var HARNESS_SESSION_IMPORT_ID_MAX_LENGTH = 1024;
|
|
22282
|
-
var HARNESS_SESSION_IMPORT_CWD_MAX_LENGTH = 16384;
|
|
22283
|
-
var HARNESS_SESSION_IMPORT_TITLE_MAX_LENGTH = 4096;
|
|
22284
|
-
var HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH = 1e3;
|
|
22285
|
-
var HARNESS_SESSION_IMPORT_DEFAULT_PAGE_SIZE = 20;
|
|
22286
|
-
var HARNESS_SESSION_IMPORT_UPDATED_AT_MAX = 864e13;
|
|
22287
|
-
var nonBlankTextSchema4 = external_exports.string().refine((value) => value.trim().length > 0, "Value must not be empty or whitespace").refine((value) => !value.includes("\0"), "Value must not contain NUL");
|
|
22288
|
-
var harnessSessionImportIdSchema = nonBlankTextSchema4.max(HARNESS_SESSION_IMPORT_ID_MAX_LENGTH);
|
|
22289
|
-
var harnessSessionImportCandidateSchema = external_exports.object({
|
|
22290
|
-
nativeSessionId: harnessSessionImportIdSchema,
|
|
22291
|
-
title: nonBlankTextSchema4.max(HARNESS_SESSION_IMPORT_TITLE_MAX_LENGTH).nullable(),
|
|
22292
|
-
updatedAt: external_exports.number().int().nonnegative().max(HARNESS_SESSION_IMPORT_UPDATED_AT_MAX),
|
|
22293
|
-
cwd: nonBlankTextSchema4.max(HARNESS_SESSION_IMPORT_CWD_MAX_LENGTH),
|
|
22294
|
-
// Native file discovery cannot reliably observe another process's activity.
|
|
22295
|
-
running: external_exports.boolean().nullable()
|
|
22296
|
-
}).strict();
|
|
22297
|
-
var harnessSessionImportSourcesParamsSchema = external_exports.object({}).strict();
|
|
22298
|
-
var harnessSessionImportSourcesResultSchema = external_exports.object({
|
|
22299
|
-
harnesses: external_exports.array(external_exports.object({
|
|
22300
|
-
harnessId: harnessPluginIdSchema,
|
|
22301
|
-
name: nonBlankTextSchema4.max(128)
|
|
22302
|
-
}).strict()).max(128)
|
|
22303
|
-
}).strict();
|
|
22304
|
-
var harnessSessionListParamsSchema = external_exports.object({
|
|
22305
|
-
harnessId: harnessPluginIdSchema,
|
|
22306
|
-
query: external_exports.string().trim().max(4096).refine((value) => !value.includes("\0")).optional(),
|
|
22307
|
-
offset: external_exports.number().int().nonnegative().safe().optional(),
|
|
22308
|
-
limit: external_exports.number().int().min(1).max(HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH).optional()
|
|
22309
|
-
}).strict();
|
|
22310
|
-
var harnessSessionListResultSchema = external_exports.object({
|
|
22311
|
-
candidates: external_exports.array(harnessSessionImportCandidateSchema).max(HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH),
|
|
22312
|
-
total: external_exports.number().int().nonnegative().safe()
|
|
22052
|
+
var credentialOtherLoginSchema = external_exports.object({
|
|
22053
|
+
provider: external_exports.string().min(1).max(128),
|
|
22054
|
+
type: external_exports.enum(["oauth", "api_key", "unknown"]),
|
|
22055
|
+
/** Best-effort account label (e.g. the email in a Codex token), derived locally when present. */
|
|
22056
|
+
label: external_exports.string().min(1).max(512).optional(),
|
|
22057
|
+
/** Recognized credential vendor, derived from the OAuth token issuer. Absent when unknown. */
|
|
22058
|
+
vendor: external_exports.enum(["openai-codex", "xai"]).optional()
|
|
22313
22059
|
}).strict();
|
|
22314
|
-
var
|
|
22315
|
-
|
|
22316
|
-
|
|
22060
|
+
var credentialImportsResultSchema = external_exports.object({
|
|
22061
|
+
sources: external_exports.array(credentialSourceSchema),
|
|
22062
|
+
targets: external_exports.array(external_exports.object({
|
|
22063
|
+
harnessId: external_exports.string(),
|
|
22064
|
+
providers: external_exports.array(external_exports.enum(["openai-codex", "xai"])),
|
|
22065
|
+
imports: external_exports.array(credentialImportRecordSchema),
|
|
22066
|
+
others: external_exports.array(credentialOtherLoginSchema).default([])
|
|
22067
|
+
}).strict())
|
|
22317
22068
|
}).strict();
|
|
22318
|
-
var
|
|
22319
|
-
|
|
22069
|
+
var credentialImportsParamsSchema = external_exports.object({
|
|
22070
|
+
targetHarnessId: external_exports.string().min(1).max(128).optional(),
|
|
22071
|
+
request: credentialImportsRequestSchema
|
|
22320
22072
|
}).strict();
|
|
22073
|
+
var CREDENTIAL_IMPORTS_METHOD = "codexhost/harness/credential-imports";
|
|
22321
22074
|
|
|
22322
|
-
// ../shared-contracts/dist/
|
|
22323
|
-
var
|
|
22324
|
-
var
|
|
22325
|
-
var
|
|
22326
|
-
var
|
|
22327
|
-
var
|
|
22328
|
-
var
|
|
22329
|
-
|
|
22330
|
-
|
|
22331
|
-
}).
|
|
22332
|
-
var
|
|
22333
|
-
|
|
22334
|
-
})
|
|
22335
|
-
var
|
|
22336
|
-
|
|
22337
|
-
|
|
22075
|
+
// ../shared-contracts/dist/harness-display-settings.js
|
|
22076
|
+
var HARNESS_DISPLAY_GET_METHOD = "codexhost/harness/display-settings/get";
|
|
22077
|
+
var HARNESS_DISPLAY_CHANGED_METHOD = "codexhost/harness/display-settings/changed";
|
|
22078
|
+
var HARNESS_DISPLAY_CAPABILITIES_METHOD = "codexhost/harness/display-settings/capabilities";
|
|
22079
|
+
var harnessDisplayCapabilitiesSchema = external_exports.object({ events: external_exports.boolean() });
|
|
22080
|
+
var HARNESS_DISPLAY_SET_METHOD = "codexhost/harness/display-settings/set";
|
|
22081
|
+
var harnessDisplayEntriesSchema = external_exports.array(external_exports.strictObject({
|
|
22082
|
+
agent: external_exports.string().min(1).max(128),
|
|
22083
|
+
section: external_exports.enum(["main", "more", "auto"])
|
|
22084
|
+
})).max(256).refine((entries) => new Set(entries.map((entry) => entry.agent)).size === entries.length, "Duplicate Harness IDs");
|
|
22085
|
+
var harnessDisplaySettingsSchema = external_exports.strictObject({
|
|
22086
|
+
entries: harnessDisplayEntriesSchema.nullable()
|
|
22087
|
+
});
|
|
22088
|
+
var harnessDisplayGetSchema = external_exports.strictObject({});
|
|
22089
|
+
var harnessDisplaySetSchema = external_exports.strictObject({
|
|
22090
|
+
entries: harnessDisplayEntriesSchema,
|
|
22091
|
+
/** Import legacy Desktop preferences only if no shared settings exist yet. */
|
|
22092
|
+
initializeOnly: external_exports.boolean().optional()
|
|
22093
|
+
});
|
|
22094
|
+
var DEFAULT_HARNESS_DISPLAY_ORDER = [
|
|
22095
|
+
"pi",
|
|
22096
|
+
"claude-code",
|
|
22097
|
+
"deepseek-harness",
|
|
22098
|
+
"opencode",
|
|
22099
|
+
"grok",
|
|
22100
|
+
"omp",
|
|
22101
|
+
"antigravity",
|
|
22102
|
+
"kiro-cli",
|
|
22103
|
+
"codebuddy",
|
|
22104
|
+
"workbuddy",
|
|
22105
|
+
"cursor-cli",
|
|
22106
|
+
"hermes",
|
|
22107
|
+
"qoder",
|
|
22108
|
+
"qoder-cn",
|
|
22109
|
+
"kimi-code",
|
|
22110
|
+
"zcode"
|
|
22111
|
+
];
|
|
22338
22112
|
|
|
22339
|
-
// ../shared-contracts/dist/
|
|
22340
|
-
var
|
|
22341
|
-
|
|
22342
|
-
|
|
22343
|
-
|
|
22344
|
-
|
|
22345
|
-
|
|
22346
|
-
})
|
|
22113
|
+
// ../shared-contracts/dist/idle-release.js
|
|
22114
|
+
var IDLE_RELEASE_SETTINGS_METHOD = "codexhost/settings/idle-release/set";
|
|
22115
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
22116
|
+
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
22117
|
+
var idleReleaseSettingsSchema = external_exports.strictObject({
|
|
22118
|
+
enabled: external_exports.boolean(),
|
|
22119
|
+
timeoutMinutes: external_exports.number().int().min(IDLE_RELEASE_TIMEOUT_MINUTES_MIN).max(IDLE_RELEASE_TIMEOUT_MINUTES_MAX)
|
|
22120
|
+
});
|
|
22121
|
+
var DEFAULT_IDLE_RELEASE_SETTINGS = Object.freeze({
|
|
22122
|
+
enabled: true,
|
|
22123
|
+
timeoutMinutes: 10
|
|
22124
|
+
});
|
|
22347
22125
|
|
|
22348
|
-
// ../shared-contracts/dist/harness-
|
|
22349
|
-
var
|
|
22350
|
-
var
|
|
22351
|
-
var
|
|
22352
|
-
var
|
|
22353
|
-
var
|
|
22354
|
-
|
|
22355
|
-
|
|
22356
|
-
|
|
22357
|
-
|
|
22358
|
-
|
|
22359
|
-
|
|
22360
|
-
|
|
22361
|
-
|
|
22362
|
-
|
|
22363
|
-
|
|
22364
|
-
|
|
22365
|
-
|
|
22366
|
-
|
|
22367
|
-
|
|
22368
|
-
|
|
22369
|
-
|
|
22370
|
-
|
|
22371
|
-
|
|
22372
|
-
|
|
22373
|
-
|
|
22374
|
-
|
|
22375
|
-
|
|
22376
|
-
})
|
|
22377
|
-
|
|
22378
|
-
|
|
22379
|
-
|
|
22380
|
-
|
|
22126
|
+
// ../shared-contracts/dist/harness-preferences.js
|
|
22127
|
+
var HARNESS_PREFERENCES_GET_METHOD = "codexhost/harness/preferences/get";
|
|
22128
|
+
var HARNESS_PREFERENCES_PATCH_METHOD = "codexhost/harness/preferences/patch";
|
|
22129
|
+
var HARNESS_PREFERENCES_CHANGED_METHOD = "codexhost/harness/preferences/changed";
|
|
22130
|
+
var harnessPreferenceScopeSchema = external_exports.string().regex(/^external$/u);
|
|
22131
|
+
var preferenceHarnessKey = harnessIdSchema.transform((id2) => String(id2));
|
|
22132
|
+
var harnessDefaultConfigurationSchema = external_exports.strictObject({
|
|
22133
|
+
model: harnessModelRefSchema.optional(),
|
|
22134
|
+
thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
22135
|
+
permissionModeId: harnessPermissionModeIdSchema.optional()
|
|
22136
|
+
}).refine((value) => Boolean(value.model || value.thinkingOptionId || value.permissionModeId), "A default configuration must contain a preference");
|
|
22137
|
+
var newThreadDefaultsSchema = external_exports.strictObject({
|
|
22138
|
+
lastHarness: harnessIdSchema.optional(),
|
|
22139
|
+
byHarness: external_exports.record(preferenceHarnessKey, harnessDefaultConfigurationSchema)
|
|
22140
|
+
});
|
|
22141
|
+
var harnessDelegationDefaultSchema = external_exports.strictObject({
|
|
22142
|
+
model: harnessModelRefSchema.optional(),
|
|
22143
|
+
thinkingOptionId: harnessThinkingOptionIdSchema.optional()
|
|
22144
|
+
}).refine((value) => Boolean(value.model || value.thinkingOptionId), "A delegation default must contain a Model or Thinking option");
|
|
22145
|
+
var delegationDefaultsSchema = external_exports.strictObject({
|
|
22146
|
+
byHarness: external_exports.record(preferenceHarnessKey, harnessDelegationDefaultSchema)
|
|
22147
|
+
});
|
|
22148
|
+
var modelId = external_exports.string().min(1).max(1024);
|
|
22149
|
+
var harnessPreferenceValuesSchema = external_exports.strictObject({
|
|
22150
|
+
idleRelease: idleReleaseSettingsSchema.optional(),
|
|
22151
|
+
favorites: external_exports.record(preferenceHarnessKey, external_exports.array(modelId).max(2048)).default({}),
|
|
22152
|
+
newThread: newThreadDefaultsSchema.optional(),
|
|
22153
|
+
delegation: delegationDefaultsSchema.optional()
|
|
22154
|
+
});
|
|
22155
|
+
var harnessPreferenceSnapshotSchema = external_exports.strictObject({
|
|
22156
|
+
scope: harnessPreferenceScopeSchema,
|
|
22157
|
+
revision: external_exports.number().int().nonnegative(),
|
|
22158
|
+
values: harnessPreferenceValuesSchema
|
|
22159
|
+
});
|
|
22160
|
+
var harnessPreferenceGetSchema = external_exports.strictObject({
|
|
22161
|
+
scope: harnessPreferenceScopeSchema.default("external")
|
|
22162
|
+
});
|
|
22163
|
+
var harnessPreferenceOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
22164
|
+
external_exports.strictObject({ kind: external_exports.literal("idleRelease"), value: idleReleaseSettingsSchema }),
|
|
22165
|
+
external_exports.strictObject({
|
|
22166
|
+
kind: external_exports.literal("favorite"),
|
|
22167
|
+
harnessId: harnessIdSchema,
|
|
22168
|
+
modelId,
|
|
22169
|
+
enabled: external_exports.boolean()
|
|
22170
|
+
}),
|
|
22171
|
+
external_exports.strictObject({
|
|
22172
|
+
kind: external_exports.literal("favorites"),
|
|
22173
|
+
harnessId: harnessIdSchema,
|
|
22174
|
+
modelIds: external_exports.array(modelId).max(2048)
|
|
22175
|
+
}),
|
|
22176
|
+
external_exports.strictObject({
|
|
22177
|
+
kind: external_exports.literal("newThread"),
|
|
22178
|
+
lastHarness: harnessIdSchema.optional(),
|
|
22179
|
+
harnessId: harnessIdSchema.optional(),
|
|
22180
|
+
configuration: harnessDefaultConfigurationSchema.optional()
|
|
22181
|
+
}),
|
|
22182
|
+
external_exports.strictObject({
|
|
22183
|
+
kind: external_exports.literal("delegation"),
|
|
22184
|
+
harnessId: harnessIdSchema,
|
|
22185
|
+
configuration: harnessDelegationDefaultSchema.nullable()
|
|
22186
|
+
})
|
|
22187
|
+
]);
|
|
22188
|
+
var harnessPreferencePatchSchema = external_exports.strictObject({
|
|
22189
|
+
scope: harnessPreferenceScopeSchema.default("external"),
|
|
22190
|
+
operations: external_exports.array(harnessPreferenceOperationSchema).min(1).max(256),
|
|
22191
|
+
initializeOnly: external_exports.boolean().optional(),
|
|
22192
|
+
expectedRevision: external_exports.number().int().nonnegative().optional()
|
|
22193
|
+
}).superRefine((input3, ctx) => {
|
|
22194
|
+
for (const operation of input3.operations) {
|
|
22195
|
+
if (operation.kind === "newThread" && (!operation.lastHarness && !operation.configuration || Boolean(operation.harnessId) !== Boolean(operation.configuration)))
|
|
22196
|
+
ctx.addIssue({
|
|
22381
22197
|
code: "custom",
|
|
22382
|
-
message: "Harness
|
|
22383
|
-
path: ["commands", index, "id"]
|
|
22198
|
+
message: "A default Harness or complete configuration is required"
|
|
22384
22199
|
});
|
|
22385
|
-
}
|
|
22386
|
-
ids.add(command.id);
|
|
22387
22200
|
}
|
|
22388
22201
|
});
|
|
22389
|
-
var
|
|
22390
|
-
|
|
22391
|
-
|
|
22392
|
-
|
|
22393
|
-
})
|
|
22394
|
-
var threadCommandsInspectParamsSchema = external_exports.object({
|
|
22395
|
-
threadId: hostThreadIdSchema
|
|
22396
|
-
}).strict();
|
|
22397
|
-
var threadCommandExecuteParamsSchema = external_exports.object({
|
|
22398
|
-
threadId: hostThreadIdSchema,
|
|
22399
|
-
commandId: commandIdSchema,
|
|
22400
|
-
turnId: hostTurnIdSchema.optional(),
|
|
22401
|
-
arguments: jsonObjectSchema.optional()
|
|
22402
|
-
}).strict();
|
|
22403
|
-
var threadCommandExecuteResultSchema = external_exports.object({
|
|
22404
|
-
accepted: external_exports.literal(true),
|
|
22405
|
-
turnId: hostTurnIdSchema.optional()
|
|
22406
|
-
}).strict();
|
|
22202
|
+
var harnessPreferencesDocumentSchema = external_exports.strictObject({
|
|
22203
|
+
version: external_exports.literal(1),
|
|
22204
|
+
revision: external_exports.number().int().nonnegative(),
|
|
22205
|
+
scopes: external_exports.record(harnessPreferenceScopeSchema, harnessPreferenceValuesSchema)
|
|
22206
|
+
});
|
|
22407
22207
|
|
|
22408
|
-
// ../shared-contracts/dist/
|
|
22409
|
-
|
|
22410
|
-
|
|
22411
|
-
|
|
22412
|
-
|
|
22413
|
-
|
|
22414
|
-
|
|
22415
|
-
|
|
22416
|
-
|
|
22417
|
-
|
|
22418
|
-
|
|
22419
|
-
jsonrpc: jsonRpcVersionSchema,
|
|
22420
|
-
id: jsonRpcIdSchema,
|
|
22421
|
-
method: methodSchema,
|
|
22422
|
-
params: jsonValueSchema.optional(),
|
|
22423
|
-
result: absentSchema,
|
|
22424
|
-
error: absentSchema
|
|
22425
|
-
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "params", "result", "error"]));
|
|
22426
|
-
var jsonRpcNotificationSchema = external_exports.object({
|
|
22427
|
-
jsonrpc: jsonRpcVersionSchema,
|
|
22428
|
-
id: absentSchema,
|
|
22429
|
-
method: methodSchema,
|
|
22430
|
-
params: jsonValueSchema.optional(),
|
|
22431
|
-
result: absentSchema,
|
|
22432
|
-
error: absentSchema
|
|
22433
|
-
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "id", "params", "result", "error"]));
|
|
22434
|
-
var jsonRpcSuccessResponseSchema = external_exports.object({
|
|
22435
|
-
jsonrpc: jsonRpcVersionSchema,
|
|
22436
|
-
id: jsonRpcIdSchema,
|
|
22437
|
-
method: absentSchema,
|
|
22438
|
-
params: absentSchema,
|
|
22439
|
-
result: jsonValueSchema,
|
|
22440
|
-
error: absentSchema
|
|
22441
|
-
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "method", "params", "error"]));
|
|
22442
|
-
var jsonRpcErrorResponseSchema = external_exports.object({
|
|
22443
|
-
jsonrpc: jsonRpcVersionSchema,
|
|
22444
|
-
id: jsonRpcIdSchema,
|
|
22445
|
-
method: absentSchema,
|
|
22446
|
-
params: absentSchema,
|
|
22447
|
-
result: absentSchema,
|
|
22448
|
-
error: jsonRpcErrorSchema
|
|
22449
|
-
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "method", "params", "result"]));
|
|
22450
|
-
var jsonRpcEnvelopeSchema = external_exports.union([
|
|
22451
|
-
jsonRpcRequestSchema,
|
|
22452
|
-
jsonRpcNotificationSchema,
|
|
22453
|
-
jsonRpcSuccessResponseSchema,
|
|
22454
|
-
jsonRpcErrorResponseSchema
|
|
22455
|
-
]);
|
|
22208
|
+
// ../shared-contracts/dist/account-credits-presentation.js
|
|
22209
|
+
function accountCreditsWindowLabel(window2, locale, periodLabel) {
|
|
22210
|
+
if (window2.periodType && window2.periodType !== "unknown" && (window2.scope || !window2.label)) {
|
|
22211
|
+
const period = periodLabel(window2.periodType);
|
|
22212
|
+
return window2.scope ? `${localizeHarnessPresentation(window2.scope, locale).label} \xB7 ${period}` : period;
|
|
22213
|
+
}
|
|
22214
|
+
return localizeHarnessPresentation({
|
|
22215
|
+
label: window2.label ?? window2.product ?? periodLabel("unknown"),
|
|
22216
|
+
...window2.localizations ? { localizations: window2.localizations } : {}
|
|
22217
|
+
}, locale).label;
|
|
22218
|
+
}
|
|
22456
22219
|
|
|
22457
|
-
// ../shared-contracts/dist/
|
|
22458
|
-
var
|
|
22459
|
-
|
|
22220
|
+
// ../shared-contracts/dist/model-price-overrides.js
|
|
22221
|
+
var MODEL_PRICE_OVERRIDES_GET_METHOD = "codexhost/usage/model-prices/get";
|
|
22222
|
+
var MODEL_PRICE_OVERRIDES_SET_METHOD = "codexhost/usage/model-prices/set";
|
|
22223
|
+
var MODEL_PRICE_DEFAULT_METHOD = "codexhost/usage/model-prices/default";
|
|
22224
|
+
var usdPerMillionTokens = external_exports.number().finite().nonnegative();
|
|
22225
|
+
var modelPriceOverrideSchema = external_exports.strictObject({
|
|
22226
|
+
input: usdPerMillionTokens,
|
|
22227
|
+
output: usdPerMillionTokens,
|
|
22228
|
+
cacheRead: usdPerMillionTokens.optional(),
|
|
22229
|
+
cacheWrite: usdPerMillionTokens.optional(),
|
|
22230
|
+
cacheWrite1h: usdPerMillionTokens.optional()
|
|
22460
22231
|
});
|
|
22461
|
-
var
|
|
22462
|
-
|
|
22463
|
-
|
|
22464
|
-
|
|
22465
|
-
|
|
22466
|
-
|
|
22467
|
-
|
|
22468
|
-
|
|
22469
|
-
|
|
22470
|
-
|
|
22471
|
-
|
|
22232
|
+
var modelPriceKeySchema = external_exports.string().max(512).refine((key2) => key2.trim() === key2 && key2.length > 0, "Model ID is required");
|
|
22233
|
+
var modelPriceOverridesSchema = external_exports.strictObject({
|
|
22234
|
+
/** Absolute path of the Host's `pricing.json`. */
|
|
22235
|
+
path: external_exports.string(),
|
|
22236
|
+
entries: external_exports.array(external_exports.strictObject({ key: external_exports.string(), price: modelPriceOverrideSchema })),
|
|
22237
|
+
/** Why the existing file is unusable; the Host then ignores it and refuses to overwrite it. */
|
|
22238
|
+
error: external_exports.string().nullable()
|
|
22239
|
+
});
|
|
22240
|
+
var modelPriceOverridesGetSchema = external_exports.strictObject({});
|
|
22241
|
+
var modelPriceOverridesSetSchema = external_exports.strictObject({
|
|
22242
|
+
key: modelPriceKeySchema,
|
|
22243
|
+
price: modelPriceOverrideSchema.nullable(),
|
|
22244
|
+
previousKey: modelPriceKeySchema.optional()
|
|
22245
|
+
});
|
|
22246
|
+
var modelPriceDefaultParamsSchema = external_exports.strictObject({
|
|
22247
|
+
model: modelPriceKeySchema
|
|
22248
|
+
});
|
|
22249
|
+
var modelPriceSuggestionSchema = external_exports.strictObject({
|
|
22250
|
+
/** Verified from catalog canonical links, not inferred from names or equal prices. */
|
|
22251
|
+
official: external_exports.boolean().optional(),
|
|
22252
|
+
canonicalModelId: external_exports.string().min(1).optional(),
|
|
22253
|
+
provider: external_exports.string().min(1).max(512),
|
|
22254
|
+
model: external_exports.string().min(1).max(512),
|
|
22255
|
+
price: modelPriceOverrideSchema
|
|
22256
|
+
});
|
|
22257
|
+
var modelPriceDefaultResultSchema = external_exports.strictObject({
|
|
22258
|
+
price: modelPriceOverrideSchema.nullable(),
|
|
22259
|
+
/** Local catalog suggestions only; never used automatically for pricing. */
|
|
22260
|
+
suggestions: external_exports.array(modelPriceSuggestionSchema).max(6).optional()
|
|
22472
22261
|
});
|
|
22473
|
-
var nativeCheckpointRefV1RuntimeSchema = external_exports.strictObject({
|
|
22474
|
-
harnessId: harnessIdSchema,
|
|
22475
|
-
nativeSessionId: nativeIdSchema,
|
|
22476
|
-
checkpointId: nativeIdSchema,
|
|
22477
|
-
locator: jsonValueSchema.optional(),
|
|
22478
|
-
formatVersion: external_exports.literal(1)
|
|
22479
|
-
}).superRefine(rejectExplicitUndefined(["locator"]));
|
|
22480
22262
|
|
|
22481
|
-
// ../shared-contracts/dist/
|
|
22482
|
-
var
|
|
22483
|
-
var
|
|
22484
|
-
var
|
|
22485
|
-
var
|
|
22486
|
-
|
|
22487
|
-
|
|
22488
|
-
|
|
22489
|
-
|
|
22490
|
-
|
|
22491
|
-
|
|
22492
|
-
|
|
22493
|
-
|
|
22494
|
-
|
|
22495
|
-
|
|
22496
|
-
|
|
22497
|
-
|
|
22498
|
-
|
|
22499
|
-
|
|
22500
|
-
|
|
22501
|
-
|
|
22502
|
-
|
|
22503
|
-
|
|
22504
|
-
|
|
22505
|
-
downloadedBytes: external_exports.number().int().nonnegative().optional(),
|
|
22506
|
-
totalBytes: external_exports.number().int().positive().optional(),
|
|
22507
|
-
error: external_exports.string().min(1).max(UPDATE_ERROR_MAX_LENGTH).nullable(),
|
|
22508
|
-
serviceStopOutput: external_exports.string().optional()
|
|
22509
|
-
}).superRefine((status, context) => {
|
|
22510
|
-
if (status.downloadedBytes !== void 0 && status.totalBytes !== void 0 && status.downloadedBytes > status.totalBytes) {
|
|
22511
|
-
context.addIssue({
|
|
22512
|
-
code: "custom",
|
|
22513
|
-
path: ["downloadedBytes"],
|
|
22514
|
-
message: "downloadedBytes must not exceed totalBytes"
|
|
22515
|
-
});
|
|
22516
|
-
}
|
|
22263
|
+
// ../shared-contracts/dist/usage-statistics.js
|
|
22264
|
+
var USAGE_STATISTICS_METHOD = "codexhost/usage/statistics/get";
|
|
22265
|
+
var USAGE_STATISTICS_RANGES = ["today", "7d", "30d", "90d", "all"];
|
|
22266
|
+
var count = external_exports.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
22267
|
+
var localDate = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/u);
|
|
22268
|
+
var harness = external_exports.string().min(1).max(128);
|
|
22269
|
+
var model = external_exports.string().min(1).max(512);
|
|
22270
|
+
var project = external_exports.string().min(1).max(4096);
|
|
22271
|
+
var usageStatisticsParamsSchema = external_exports.strictObject({
|
|
22272
|
+
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
22273
|
+
/** Display timezone for ranges, dates and hourly buckets; omitted means the Host's local zone. */
|
|
22274
|
+
timeZone: external_exports.string().min(1).max(128).refine((value) => {
|
|
22275
|
+
try {
|
|
22276
|
+
new Intl.DateTimeFormat("en", { timeZone: value });
|
|
22277
|
+
return true;
|
|
22278
|
+
} catch {
|
|
22279
|
+
return false;
|
|
22280
|
+
}
|
|
22281
|
+
}, "Unsupported usage statistics timezone").optional(),
|
|
22282
|
+
harness: harness.optional(),
|
|
22283
|
+
model: model.nullable().optional(),
|
|
22284
|
+
project: project.nullable().optional(),
|
|
22285
|
+
/** One date in the query timezone inside the range. */
|
|
22286
|
+
date: localDate.optional()
|
|
22517
22287
|
});
|
|
22518
|
-
var
|
|
22519
|
-
|
|
22520
|
-
|
|
22521
|
-
|
|
22522
|
-
|
|
22523
|
-
|
|
22524
|
-
|
|
22525
|
-
|
|
22526
|
-
|
|
22527
|
-
|
|
22528
|
-
|
|
22529
|
-
|
|
22288
|
+
var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
22289
|
+
requests: count,
|
|
22290
|
+
inputTokens: count,
|
|
22291
|
+
cachedInputTokens: count,
|
|
22292
|
+
cacheWriteInputTokens: count,
|
|
22293
|
+
cacheKnownInputTokens: count,
|
|
22294
|
+
cacheHitCachedInputTokens: count,
|
|
22295
|
+
cacheHitInputTokens: count,
|
|
22296
|
+
outputTokens: count,
|
|
22297
|
+
reasoningOutputTokens: count,
|
|
22298
|
+
/** USD at the public price, summed over the priced requests only. */
|
|
22299
|
+
costUsd: external_exports.number().finite().min(0),
|
|
22300
|
+
/** Requests without a price (or the cache data the price needs); not in `costUsd`. */
|
|
22301
|
+
unpricedRequests: count,
|
|
22302
|
+
/**
|
|
22303
|
+
* Requests whose storage gave no token counts: counted as requests, with neither tokens nor
|
|
22304
|
+
* cost, and not as unpriced.
|
|
22305
|
+
*/
|
|
22306
|
+
unmeteredRequests: count
|
|
22530
22307
|
});
|
|
22531
|
-
var
|
|
22532
|
-
|
|
22308
|
+
var totals = usageStatisticsTotalsSchema.shape;
|
|
22309
|
+
var usageStatisticsSessionSchema = external_exports.strictObject({
|
|
22310
|
+
harness,
|
|
22311
|
+
sessionId: external_exports.string().min(1).max(512),
|
|
22312
|
+
project: project.nullable(),
|
|
22313
|
+
/** Persisted Desktop title for a mapped Session, otherwise its native name; may be absent. */
|
|
22314
|
+
title: external_exports.string().min(1).max(200).optional(),
|
|
22315
|
+
/** Models the session used, most requests first. */
|
|
22316
|
+
models: external_exports.array(model).max(16),
|
|
22317
|
+
firstAtMs: count,
|
|
22318
|
+
lastAtMs: count,
|
|
22319
|
+
...totals
|
|
22533
22320
|
});
|
|
22534
|
-
var
|
|
22535
|
-
|
|
22321
|
+
var usageStatisticsResultSchema = external_exports.strictObject({
|
|
22322
|
+
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
22323
|
+
/** First date in the query timezone (Host local when omitted); null for all time. */
|
|
22324
|
+
from: localDate.nullable(),
|
|
22325
|
+
to: localDate,
|
|
22326
|
+
/** The filters these figures apply, echoed so a late answer to older filters is recognised. */
|
|
22327
|
+
filters: external_exports.strictObject({
|
|
22328
|
+
harness: harness.nullable(),
|
|
22329
|
+
model: model.nullable(),
|
|
22330
|
+
unknownModel: external_exports.boolean(),
|
|
22331
|
+
project: project.nullable(),
|
|
22332
|
+
unknownProject: external_exports.boolean(),
|
|
22333
|
+
date: localDate.nullable()
|
|
22334
|
+
}),
|
|
22335
|
+
/** Reading of native storage: incomplete while the first read, or a refresh, is under way. */
|
|
22336
|
+
reading: external_exports.strictObject({ complete: external_exports.boolean(), sources: count, read: count }),
|
|
22337
|
+
/** Harnesses whose storage could not be read; their part is missing, the rest is complete. */
|
|
22338
|
+
failures: external_exports.array(external_exports.strictObject({ harness, message: external_exports.string().max(2048) })).max(256),
|
|
22339
|
+
/** Every value seen in the range, ignoring the filters, to choose filters from. */
|
|
22340
|
+
options: external_exports.strictObject({
|
|
22341
|
+
harnesses: external_exports.array(harness).max(256),
|
|
22342
|
+
models: external_exports.array(model.nullable()).max(4096),
|
|
22343
|
+
projects: external_exports.array(project.nullable()).max(4096)
|
|
22344
|
+
}),
|
|
22345
|
+
/** Current display metadata, scoped by Harness. Never a pricing or filter identity.
|
|
22346
|
+
* Optional for older Hosts; missing/conflicting labels fall back to the native model ID.
|
|
22347
|
+
*/
|
|
22348
|
+
modelLabels: external_exports.array(external_exports.strictObject({ harness, model, label: model })).max(4096).optional(),
|
|
22349
|
+
/** Native credits, all filters applied, never combined across Harnesses or treated as USD.
|
|
22350
|
+
* Only groups with at least one reported value appear; reportedRequests exposes partial data.
|
|
22351
|
+
*/
|
|
22352
|
+
credits: external_exports.array(external_exports.strictObject({
|
|
22353
|
+
harness,
|
|
22354
|
+
model: model.nullable(),
|
|
22355
|
+
credits: external_exports.number().finite().min(0),
|
|
22356
|
+
reportedRequests: count,
|
|
22357
|
+
requests: count
|
|
22358
|
+
})).max(4096).optional(),
|
|
22359
|
+
/** All filters applied. */
|
|
22360
|
+
totals: usageStatisticsTotalsSchema,
|
|
22361
|
+
/** Each date and Harness of the range: every filter except the day. */
|
|
22362
|
+
daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
|
|
22363
|
+
/** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
|
|
22364
|
+
hourly: external_exports.array(external_exports.strictObject({
|
|
22365
|
+
weekday: external_exports.number().int().min(0).max(6),
|
|
22366
|
+
hour: external_exports.number().int().min(0).max(23),
|
|
22367
|
+
...totals
|
|
22368
|
+
})).max(168),
|
|
22369
|
+
byHarness: external_exports.array(external_exports.strictObject({ harness, ...totals })).max(256),
|
|
22370
|
+
byModel: external_exports.array(external_exports.strictObject({
|
|
22371
|
+
model: model.nullable(),
|
|
22372
|
+
...totals,
|
|
22373
|
+
/** Requests priced by what the Harness recorded they cost, not by a price list. */
|
|
22374
|
+
harnessPricedRequests: count
|
|
22375
|
+
})).max(4096),
|
|
22376
|
+
byProject: external_exports.array(external_exports.strictObject({ project: project.nullable(), ...totals })).max(4096),
|
|
22377
|
+
/**
|
|
22378
|
+
* The sessions that spent the most, by cost and by tokens without cache, all filters applied;
|
|
22379
|
+
* requests without a native session are not listed here but count everywhere else.
|
|
22380
|
+
*/
|
|
22381
|
+
sessions: external_exports.array(usageStatisticsSessionSchema).max(100),
|
|
22382
|
+
/**
|
|
22383
|
+
* The sessions last active in the range, newest first, all filters applied. Optional for older
|
|
22384
|
+
* Hosts; missing is treated as no list rather than no sessions.
|
|
22385
|
+
*/
|
|
22386
|
+
recentSessions: external_exports.array(usageStatisticsSessionSchema).max(100).optional()
|
|
22536
22387
|
});
|
|
22537
22388
|
|
|
22538
|
-
// ../shared-contracts/dist/
|
|
22539
|
-
var
|
|
22540
|
-
var
|
|
22541
|
-
|
|
22542
|
-
|
|
22543
|
-
|
|
22544
|
-
|
|
22545
|
-
|
|
22546
|
-
|
|
22547
|
-
|
|
22548
|
-
|
|
22549
|
-
|
|
22550
|
-
|
|
22551
|
-
|
|
22552
|
-
|
|
22553
|
-
|
|
22554
|
-
|
|
22555
|
-
|
|
22556
|
-
|
|
22557
|
-
|
|
22558
|
-
|
|
22559
|
-
|
|
22389
|
+
// ../shared-contracts/dist/thread-prewarm.js
|
|
22390
|
+
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
22391
|
+
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
22392
|
+
|
|
22393
|
+
// ../shared-contracts/dist/thread-questions.js
|
|
22394
|
+
var field = external_exports.discriminatedUnion("type", [
|
|
22395
|
+
external_exports.object({
|
|
22396
|
+
id: external_exports.string().min(1),
|
|
22397
|
+
type: external_exports.literal("choice"),
|
|
22398
|
+
prompt: external_exports.string(),
|
|
22399
|
+
options: external_exports.array(external_exports.object({
|
|
22400
|
+
value: external_exports.string().min(1),
|
|
22401
|
+
label: external_exports.string(),
|
|
22402
|
+
description: external_exports.string().optional()
|
|
22403
|
+
})).min(1),
|
|
22404
|
+
multiple: external_exports.boolean(),
|
|
22405
|
+
allowOther: external_exports.boolean(),
|
|
22406
|
+
optional: external_exports.boolean()
|
|
22407
|
+
}),
|
|
22408
|
+
external_exports.object({
|
|
22409
|
+
id: external_exports.string().min(1),
|
|
22410
|
+
type: external_exports.literal("text"),
|
|
22411
|
+
prompt: external_exports.string(),
|
|
22412
|
+
multiline: external_exports.boolean(),
|
|
22413
|
+
secret: external_exports.literal(false),
|
|
22414
|
+
optional: external_exports.boolean(),
|
|
22415
|
+
placeholder: external_exports.string().optional(),
|
|
22416
|
+
prefill: external_exports.string().optional()
|
|
22417
|
+
})
|
|
22418
|
+
]);
|
|
22419
|
+
var threadQuestionSchema = external_exports.object({
|
|
22420
|
+
interactionId: external_exports.string().min(1),
|
|
22421
|
+
turnId: external_exports.string().min(1),
|
|
22422
|
+
title: external_exports.string().optional(),
|
|
22423
|
+
questions: external_exports.array(field).min(1)
|
|
22424
|
+
}).refine(({ questions }) => questions.some((q) => q.type === "choice" && q.multiple), {
|
|
22425
|
+
message: "Shared cards require at least one multi-select question"
|
|
22560
22426
|
});
|
|
22561
|
-
var
|
|
22562
|
-
|
|
22427
|
+
var threadQuestionsListParamsSchema = external_exports.strictObject({ threadId: external_exports.string().min(1) });
|
|
22428
|
+
var threadQuestionsResultSchema = external_exports.object({ questions: external_exports.array(threadQuestionSchema) });
|
|
22429
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
22430
|
+
threadId: external_exports.string().min(1),
|
|
22431
|
+
turnId: external_exports.string().min(1),
|
|
22432
|
+
interactionId: external_exports.string().min(1),
|
|
22433
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
22434
|
+
cancelled: external_exports.boolean().default(false)
|
|
22563
22435
|
});
|
|
22564
|
-
var
|
|
22565
|
-
|
|
22566
|
-
|
|
22436
|
+
var threadQuestionRespondResultSchema = external_exports.object({ accepted: external_exports.literal(true) });
|
|
22437
|
+
|
|
22438
|
+
// ../shared-contracts/dist/web.js
|
|
22439
|
+
var webFileDiffSchema = external_exports.object({
|
|
22440
|
+
path: external_exports.string(),
|
|
22441
|
+
oldText: external_exports.string().nullable(),
|
|
22442
|
+
newText: external_exports.string()
|
|
22567
22443
|
});
|
|
22568
|
-
var
|
|
22569
|
-
|
|
22444
|
+
var webTurnDiffsRequestSchema = external_exports.object({
|
|
22445
|
+
sessionId: external_exports.string().min(1),
|
|
22446
|
+
turn: external_exports.number().int().nonnegative(),
|
|
22447
|
+
path: external_exports.string().min(1).optional()
|
|
22570
22448
|
});
|
|
22449
|
+
var webTurnDiffsResultSchema = external_exports.object({ diffs: external_exports.array(webFileDiffSchema) });
|
|
22450
|
+
var WEB_OPEN_METHOD = "codexhost/web/open";
|
|
22451
|
+
var webOpenParamsSchema = external_exports.strictObject({});
|
|
22452
|
+
var webOpenResultSchema = external_exports.strictObject({});
|
|
22571
22453
|
|
|
22572
|
-
// ../shared-contracts/dist/
|
|
22573
|
-
var
|
|
22574
|
-
|
|
22575
|
-
|
|
22576
|
-
|
|
22577
|
-
|
|
22578
|
-
|
|
22579
|
-
|
|
22580
|
-
|
|
22581
|
-
|
|
22582
|
-
var
|
|
22454
|
+
// ../shared-contracts/dist/web-tool-output.js
|
|
22455
|
+
var webToolOutputReferenceSchema = external_exports.object({
|
|
22456
|
+
sessionId: external_exports.string().min(1),
|
|
22457
|
+
epoch: external_exports.string().min(1),
|
|
22458
|
+
turn: external_exports.number().int().nonnegative(),
|
|
22459
|
+
seq: external_exports.number().int().nonnegative(),
|
|
22460
|
+
callId: external_exports.string().min(1),
|
|
22461
|
+
part: external_exports.number().int().nonnegative(),
|
|
22462
|
+
version: external_exports.string().min(1)
|
|
22463
|
+
});
|
|
22464
|
+
var webToolOutputPreviewSchema = external_exports.object({
|
|
22465
|
+
reference: webToolOutputReferenceSchema,
|
|
22466
|
+
length: external_exports.number().int().nonnegative(),
|
|
22467
|
+
bytes: external_exports.number().int().nonnegative()
|
|
22468
|
+
});
|
|
22583
22469
|
|
|
22584
|
-
// ../shared-contracts/dist/
|
|
22585
|
-
var
|
|
22586
|
-
|
|
22587
|
-
|
|
22470
|
+
// ../shared-contracts/dist/console.js
|
|
22471
|
+
var consoleAnnouncementSchema = external_exports.strictObject({
|
|
22472
|
+
title: external_exports.string().trim().min(1).max(200),
|
|
22473
|
+
type: external_exports.enum(["info", "warning", "danger"]),
|
|
22474
|
+
body: external_exports.string().trim().min(1).max(16 * 1024)
|
|
22475
|
+
});
|
|
22476
|
+
var CONSOLE_OPEN_METHOD = "codexhost/console/open";
|
|
22477
|
+
var consoleOpenParamsSchema = external_exports.strictObject({});
|
|
22478
|
+
var consoleOpenResultSchema = external_exports.strictObject({
|
|
22479
|
+
/** The console address. */
|
|
22480
|
+
url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
|
|
22481
|
+
});
|
|
22482
|
+
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
22483
|
+
"codexhost/console/remote-connections",
|
|
22484
|
+
"codexhost/runtime/status",
|
|
22485
|
+
"codexhost/remote/ssh-setup",
|
|
22486
|
+
"codexhost/harness/plugins/list",
|
|
22487
|
+
"codexhost/harness/display-settings/capabilities",
|
|
22488
|
+
"codexhost/harness/display-settings/get",
|
|
22489
|
+
"codexhost/harness/display-settings/set",
|
|
22490
|
+
"codexhost/harness/inspect",
|
|
22491
|
+
"codexhost/harness/installation",
|
|
22492
|
+
"codexhost/harness/installation/start",
|
|
22493
|
+
"codexhost/harness/installation/status",
|
|
22494
|
+
"codexhost/harness/launch-settings/get",
|
|
22495
|
+
"codexhost/harness/launch-settings/set",
|
|
22496
|
+
"codexhost/harness/web-ui/open",
|
|
22497
|
+
"codexhost/harness/accounts/sources",
|
|
22498
|
+
"codexhost/harness/accounts/list",
|
|
22499
|
+
"codexhost/harness/accounts/inspect",
|
|
22500
|
+
"codexhost/harness/credential-imports",
|
|
22501
|
+
"codexhost/harness/session-import/sources",
|
|
22502
|
+
"codexhost/harness/session-import/list",
|
|
22503
|
+
"codexhost/harness/session-import/import",
|
|
22504
|
+
"codexhost/account/list",
|
|
22505
|
+
"codexhost/account/refresh",
|
|
22506
|
+
"codexhost/account/usage/inspect",
|
|
22507
|
+
"codexhost/usage/model-prices/get",
|
|
22508
|
+
"codexhost/usage/model-prices/set",
|
|
22509
|
+
"codexhost/usage/model-prices/default",
|
|
22510
|
+
"codexhost/usage/statistics/get",
|
|
22511
|
+
"codexhost/update/check",
|
|
22512
|
+
"codexhost/update/start",
|
|
22513
|
+
"codexhost/update/status"
|
|
22514
|
+
]);
|
|
22515
|
+
|
|
22516
|
+
// ../shared-contracts/dist/version.js
|
|
22517
|
+
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
22518
|
+
|
|
22519
|
+
// ../shared-contracts/dist/loaded-sessions.js
|
|
22520
|
+
var LOADED_SESSIONS_METHOD = "codexhost/sessions/loaded/list";
|
|
22521
|
+
var loadedSessionStateSchema = external_exports.enum([
|
|
22588
22522
|
"idle",
|
|
22589
|
-
"
|
|
22590
|
-
"
|
|
22591
|
-
"
|
|
22592
|
-
"failed"
|
|
22523
|
+
"running",
|
|
22524
|
+
"busy",
|
|
22525
|
+
"closing",
|
|
22526
|
+
"failed",
|
|
22527
|
+
"blocked"
|
|
22593
22528
|
]);
|
|
22594
|
-
var
|
|
22595
|
-
|
|
22596
|
-
|
|
22597
|
-
|
|
22598
|
-
|
|
22599
|
-
|
|
22600
|
-
|
|
22601
|
-
|
|
22602
|
-
|
|
22603
|
-
|
|
22604
|
-
|
|
22529
|
+
var loadedSessionReasonSchema = external_exports.enum([
|
|
22530
|
+
"none",
|
|
22531
|
+
"disabled",
|
|
22532
|
+
"timeout",
|
|
22533
|
+
"operation",
|
|
22534
|
+
"background",
|
|
22535
|
+
"identity",
|
|
22536
|
+
"persistence",
|
|
22537
|
+
"closeFailed"
|
|
22538
|
+
]);
|
|
22539
|
+
var loadedSessionsSchema = external_exports.array(external_exports.strictObject({
|
|
22540
|
+
threadId: external_exports.string(),
|
|
22541
|
+
title: external_exports.string(),
|
|
22542
|
+
harnessId: external_exports.string(),
|
|
22543
|
+
state: loadedSessionStateSchema,
|
|
22544
|
+
reason: loadedSessionReasonSchema,
|
|
22545
|
+
inactiveMs: external_exports.number().nonnegative()
|
|
22546
|
+
}));
|
|
22547
|
+
|
|
22548
|
+
// ../shared-contracts/dist/manual-compaction.js
|
|
22549
|
+
var threadManualCompactionStartedSchema = external_exports.strictObject({
|
|
22550
|
+
threadId: hostThreadIdSchema,
|
|
22551
|
+
turnId: hostTurnIdSchema
|
|
22605
22552
|
});
|
|
22606
|
-
|
|
22607
|
-
|
|
22553
|
+
|
|
22554
|
+
// ../shared-contracts/dist/harness-accounts.js
|
|
22555
|
+
var harnessAccountSnapshotObject = external_exports.object({
|
|
22556
|
+
email: external_exports.string().trim().min(1).max(320).optional(),
|
|
22557
|
+
label: external_exports.string().trim().min(1).max(256).optional(),
|
|
22558
|
+
plan: external_exports.string().trim().min(1).max(128).optional(),
|
|
22559
|
+
credits: accountCreditsSnapshotSchema.optional(),
|
|
22560
|
+
balance: accountBalanceSnapshotSchema.optional()
|
|
22608
22561
|
}).strict();
|
|
22609
|
-
|
|
22610
|
-
|
|
22611
|
-
|
|
22612
|
-
|
|
22613
|
-
|
|
22614
|
-
|
|
22615
|
-
|
|
22616
|
-
|
|
22562
|
+
function requireReportedQuota(schema) {
|
|
22563
|
+
return schema.refine((value) => {
|
|
22564
|
+
const reported = value;
|
|
22565
|
+
return reported.credits !== void 0 || reported.balance !== void 0;
|
|
22566
|
+
}, { message: "Account must report either credits or a balance" });
|
|
22567
|
+
}
|
|
22568
|
+
var harnessAccountSnapshotSchema = requireReportedQuota(harnessAccountSnapshotObject);
|
|
22569
|
+
var harnessAccountIdentityShape = {
|
|
22570
|
+
harnessId: harnessIdSchema,
|
|
22571
|
+
harnessName: external_exports.string().trim().min(1).max(128)
|
|
22572
|
+
};
|
|
22573
|
+
var harnessAccountSourceSchema = external_exports.object(harnessAccountIdentityShape).strict();
|
|
22574
|
+
var harnessAccountSourceListParamsSchema = external_exports.object({}).strict();
|
|
22575
|
+
var harnessAccountSourceListResultSchema = external_exports.object({ sources: external_exports.array(harnessAccountSourceSchema).max(128) }).strict();
|
|
22576
|
+
var harnessAccountInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
22577
|
+
var harnessAccountInspectResultSchema = external_exports.object({
|
|
22578
|
+
...harnessAccountIdentityShape,
|
|
22579
|
+
account: harnessAccountSnapshotSchema.nullable(),
|
|
22580
|
+
/** Every Billing Source from one Harness; `account` remains the first for older clients. */
|
|
22581
|
+
accounts: external_exports.array(harnessAccountSnapshotSchema).max(8).optional()
|
|
22582
|
+
}).strict();
|
|
22583
|
+
var harnessAccountListParamsSchema = external_exports.object({ refresh: external_exports.boolean().optional() }).strict();
|
|
22584
|
+
var harnessAccountListResultSchema = external_exports.object({
|
|
22585
|
+
accounts: external_exports.array(requireReportedQuota(harnessAccountSnapshotObject.extend(harnessAccountIdentityShape))).max(128)
|
|
22617
22586
|
}).strict();
|
|
22618
|
-
var remoteSshSetupResultSchema = external_exports.object({ state: external_exports.enum(["installed", "not-installed"]) }).strict();
|
|
22619
22587
|
|
|
22620
|
-
// ../shared-contracts/dist/
|
|
22621
|
-
var
|
|
22622
|
-
|
|
22623
|
-
|
|
22624
|
-
|
|
22625
|
-
|
|
22626
|
-
|
|
22627
|
-
|
|
22628
|
-
|
|
22629
|
-
|
|
22630
|
-
|
|
22631
|
-
|
|
22588
|
+
// ../shared-contracts/dist/harness-route.js
|
|
22589
|
+
var harnessPluginRouteSchema = external_exports.object({
|
|
22590
|
+
harnessId: harnessPluginIdSchema,
|
|
22591
|
+
model: harnessModelRefSchema.optional(),
|
|
22592
|
+
thinkingOptionId: harnessThinkingOptionIdSchema.optional(),
|
|
22593
|
+
permissionModeId: harnessPermissionModeIdSchema.optional(),
|
|
22594
|
+
/** A draft prewarm create: stays unsubmitted until the user's first Turn.
|
|
22595
|
+
* Desktop forwards only the Model of a main-process prewarm to thread/start. */
|
|
22596
|
+
prewarm: external_exports.literal(true).optional()
|
|
22597
|
+
}).strict();
|
|
22598
|
+
|
|
22599
|
+
// ../shared-contracts/dist/harness-launch-settings.js
|
|
22600
|
+
var HARNESS_LAUNCH_SETTINGS_GET_METHOD = "codexhost/harness/launch-settings/get";
|
|
22601
|
+
var HARNESS_LAUNCH_SETTINGS_SET_METHOD = "codexhost/harness/launch-settings/set";
|
|
22602
|
+
var harnessLaunchPathSchema = external_exports.string().trim().min(1).max(4096).refine((value) => !/[\u0000\r\n]/u.test(value), "Invalid entrypoint path");
|
|
22603
|
+
var harnessLaunchSettingsGetSchema = external_exports.object({
|
|
22604
|
+
harnessId: harnessPluginIdSchema
|
|
22605
|
+
}).strict();
|
|
22606
|
+
var harnessLaunchSettingsSetSchema = harnessLaunchSettingsGetSchema.extend({
|
|
22607
|
+
path: harnessLaunchPathSchema.nullable()
|
|
22608
|
+
});
|
|
22609
|
+
var harnessLaunchSettingsSchema = external_exports.object({
|
|
22610
|
+
path: harnessLaunchPathSchema.nullable(),
|
|
22611
|
+
restartRequired: external_exports.boolean()
|
|
22612
|
+
}).strict();
|
|
22613
|
+
|
|
22614
|
+
// ../shared-contracts/dist/harness-installation.js
|
|
22615
|
+
var HARNESS_INSTALLATION_START_METHOD = "codexhost/harness/installation/start";
|
|
22616
|
+
var HARNESS_INSTALLATION_STATUS_METHOD = "codexhost/harness/installation/status";
|
|
22617
|
+
var harnessInstallationParamsSchema = external_exports.object({
|
|
22618
|
+
harnessId: harnessIdSchema,
|
|
22619
|
+
action: external_exports.enum(["check", "update", "install"]),
|
|
22620
|
+
confirmedVersion: external_exports.string().min(1).max(128).optional()
|
|
22621
|
+
}).strict().refine(({ action, confirmedVersion }) => action === "update" || confirmedVersion === void 0);
|
|
22622
|
+
var harnessInstallationStateSchema = external_exports.object({
|
|
22623
|
+
currentVersion: external_exports.string().min(1).max(128),
|
|
22624
|
+
latestVersion: external_exports.string().min(1).max(128),
|
|
22625
|
+
updateAvailable: external_exports.boolean(),
|
|
22626
|
+
canUpdate: external_exports.boolean(),
|
|
22627
|
+
/** Present when the Adapter has a verified list and the available target is outside it. */
|
|
22628
|
+
latestVerifiedVersion: external_exports.string().min(1).max(128).optional(),
|
|
22629
|
+
/** Update preflight stopped before running the installer; latestVersion needs confirmation. */
|
|
22630
|
+
confirmationRequired: external_exports.literal(true).optional(),
|
|
22631
|
+
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
22632
|
+
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
22633
|
+
/** Official download opened by the user; does not imply an automatic installation. */
|
|
22634
|
+
manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
|
|
22635
|
+
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
22636
|
+
message: external_exports.string().max(2048).optional(),
|
|
22637
|
+
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
22638
|
+
/** Safe plugin-owned explanation, distinct from raw diagnostic message. */
|
|
22639
|
+
notice: harnessLocalizedTextSchema.optional(),
|
|
22640
|
+
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
22641
|
+
}).strict();
|
|
22642
|
+
var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
|
|
22643
|
+
var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
|
|
22644
|
+
external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
|
|
22632
22645
|
external_exports.object({
|
|
22633
|
-
|
|
22634
|
-
|
|
22635
|
-
|
|
22636
|
-
|
|
22637
|
-
"remote/turn-changed",
|
|
22638
|
-
"remote/send-rejected",
|
|
22639
|
-
"session/queue-item-not-found",
|
|
22640
|
-
"session/queue-item-starting"
|
|
22641
|
-
]),
|
|
22642
|
-
message: external_exports.string()
|
|
22643
|
-
})
|
|
22644
|
-
]);
|
|
22645
|
-
var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
|
|
22646
|
-
external_exports.object({ available: external_exports.literal(false) }),
|
|
22646
|
+
taskId: external_exports.string().uuid(),
|
|
22647
|
+
status: external_exports.literal("succeeded"),
|
|
22648
|
+
result: harnessInstallationStateSchema
|
|
22649
|
+
}).strict(),
|
|
22647
22650
|
external_exports.object({
|
|
22648
|
-
|
|
22649
|
-
|
|
22650
|
-
|
|
22651
|
-
|
|
22652
|
-
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
22653
|
-
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
22654
|
-
external_exports.strictObject({
|
|
22655
|
-
kind: external_exports.literal("create"),
|
|
22656
|
-
...target,
|
|
22657
|
-
cwd: external_exports.string().min(1).max(8192),
|
|
22658
|
-
epoch: identity
|
|
22659
|
-
}),
|
|
22660
|
-
external_exports.strictObject({ kind: external_exports.literal("projectHarnesses"), ...target, epoch: identity }),
|
|
22661
|
-
external_exports.strictObject({
|
|
22662
|
-
kind: external_exports.literal("inspectHarness"),
|
|
22663
|
-
...target,
|
|
22664
|
-
epoch: identity,
|
|
22665
|
-
cwd: external_exports.string().min(1).max(8192),
|
|
22666
|
-
harnessId: identity
|
|
22667
|
-
}),
|
|
22668
|
-
external_exports.strictObject({
|
|
22669
|
-
kind: external_exports.literal("startSelected"),
|
|
22670
|
-
...target,
|
|
22671
|
-
epoch: identity,
|
|
22672
|
-
cwd: external_exports.string().min(1).max(8192),
|
|
22673
|
-
harnessId: identity,
|
|
22674
|
-
model: external_exports.string().min(1).max(4096),
|
|
22675
|
-
serviceTier: external_exports.enum(["priority", "ultrafast"]).optional(),
|
|
22676
|
-
reasoningEffort: identity.optional()
|
|
22677
|
-
}),
|
|
22678
|
-
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
22679
|
-
external_exports.strictObject({
|
|
22680
|
-
kind: external_exports.literal("list"),
|
|
22681
|
-
...target,
|
|
22682
|
-
cursor: external_exports.string().nullable(),
|
|
22683
|
-
archived: external_exports.boolean(),
|
|
22684
|
-
includeLoaded: external_exports.literal(true).optional()
|
|
22685
|
-
}),
|
|
22686
|
-
external_exports.strictObject({
|
|
22687
|
-
kind: external_exports.literal("read"),
|
|
22688
|
-
...thread,
|
|
22689
|
-
page: external_exports.strictObject({
|
|
22690
|
-
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
22691
|
-
epoch: identity.optional(),
|
|
22692
|
-
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
22693
|
-
limit: external_exports.number().int().min(1).max(20).optional()
|
|
22694
|
-
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
22695
|
-
message: "A history continuation requires its connection epoch"
|
|
22696
|
-
}).optional()
|
|
22697
|
-
}),
|
|
22698
|
-
external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
|
|
22699
|
-
external_exports.strictObject({
|
|
22700
|
-
kind: external_exports.literal("configure"),
|
|
22701
|
-
...thread,
|
|
22702
|
-
epoch: identity,
|
|
22703
|
-
modelId: identity.optional(),
|
|
22704
|
-
serviceTier: harnessModelServiceTierSchema.optional(),
|
|
22705
|
-
thinkingOptionId: identity.optional(),
|
|
22706
|
-
permissionModeId: identity.optional()
|
|
22707
|
-
}).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting").refine((value) => value.serviceTier === void 0 || value.modelId !== void 0, {
|
|
22708
|
-
message: "A service tier requires a Model ID"
|
|
22709
|
-
}),
|
|
22710
|
-
external_exports.strictObject({
|
|
22711
|
-
kind: external_exports.literal("prompt"),
|
|
22712
|
-
...thread,
|
|
22713
|
-
epoch: identity,
|
|
22714
|
-
text,
|
|
22715
|
-
requestId: identity.optional()
|
|
22716
|
-
}),
|
|
22717
|
-
external_exports.strictObject({ kind: external_exports.literal("queue"), ...thread, epoch: identity }),
|
|
22718
|
-
external_exports.strictObject({
|
|
22719
|
-
kind: external_exports.literal("delivery"),
|
|
22720
|
-
...thread,
|
|
22721
|
-
epoch: identity,
|
|
22722
|
-
action: external_exports.discriminatedUnion("kind", [
|
|
22723
|
-
external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input2 }),
|
|
22724
|
-
external_exports.strictObject({ kind: external_exports.literal("steer"), ...input2, turnId: identity }),
|
|
22725
|
-
external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
|
|
22726
|
-
external_exports.strictObject({
|
|
22727
|
-
kind: external_exports.literal("start"),
|
|
22728
|
-
itemId: identity,
|
|
22729
|
-
onlyIfHead: external_exports.literal(true).optional()
|
|
22730
|
-
})
|
|
22731
|
-
])
|
|
22732
|
-
}),
|
|
22733
|
-
external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
|
|
22734
|
-
external_exports.strictObject({
|
|
22735
|
-
kind: external_exports.literal("rename"),
|
|
22736
|
-
...thread,
|
|
22737
|
-
epoch: identity,
|
|
22738
|
-
name: external_exports.string().min(1).max(512)
|
|
22739
|
-
}),
|
|
22740
|
-
external_exports.strictObject({ kind: external_exports.literal("archive"), ...thread, epoch: identity, archived: external_exports.boolean() }),
|
|
22741
|
-
external_exports.strictObject({
|
|
22742
|
-
kind: external_exports.literal("respond"),
|
|
22743
|
-
...thread,
|
|
22744
|
-
epoch: identity,
|
|
22745
|
-
requestId: external_exports.union([identity, external_exports.number().int()]),
|
|
22746
|
-
result: external_exports.record(external_exports.string(), external_exports.unknown())
|
|
22747
|
-
})
|
|
22651
|
+
taskId: external_exports.string().uuid(),
|
|
22652
|
+
status: external_exports.literal("failed"),
|
|
22653
|
+
error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
|
|
22654
|
+
}).strict()
|
|
22748
22655
|
]);
|
|
22749
22656
|
|
|
22750
|
-
// ../shared-contracts/dist/
|
|
22751
|
-
var
|
|
22752
|
-
var
|
|
22753
|
-
var
|
|
22754
|
-
|
|
22755
|
-
|
|
22756
|
-
|
|
22757
|
-
|
|
22758
|
-
|
|
22759
|
-
|
|
22760
|
-
|
|
22761
|
-
|
|
22762
|
-
|
|
22763
|
-
|
|
22764
|
-
|
|
22765
|
-
|
|
22766
|
-
|
|
22767
|
-
|
|
22768
|
-
|
|
22769
|
-
|
|
22770
|
-
|
|
22771
|
-
external_exports.strictObject({ action: external_exports.literal("session"), operation: remoteSessionOperationSchema }),
|
|
22772
|
-
external_exports.strictObject({ action: external_exports.literal("list") }),
|
|
22773
|
-
external_exports.strictObject({ action: external_exports.literal("catalog") }),
|
|
22774
|
-
external_exports.strictObject({
|
|
22775
|
-
action: external_exports.literal("read-thread"),
|
|
22776
|
-
hostId: hostId.refine((id2) => id2 !== "local"),
|
|
22777
|
-
input: delegationReadParamsSchema
|
|
22778
|
-
}),
|
|
22779
|
-
external_exports.strictObject({
|
|
22780
|
-
action: external_exports.literal("save"),
|
|
22781
|
-
draft: codexSshDraftSchema,
|
|
22782
|
-
previous: codexSshConnectionSchema.nullable()
|
|
22783
|
-
}),
|
|
22784
|
-
external_exports.strictObject({ action: external_exports.literal("remove"), previous: codexSshConnectionSchema }),
|
|
22785
|
-
external_exports.strictObject({ action: external_exports.literal("connect"), hostId, enabled: external_exports.boolean() }),
|
|
22786
|
-
external_exports.strictObject({ action: external_exports.literal("state"), hostId }),
|
|
22787
|
-
external_exports.strictObject({ action: external_exports.literal("runtime"), hostId }),
|
|
22788
|
-
external_exports.strictObject({
|
|
22789
|
-
action: external_exports.literal("update"),
|
|
22790
|
-
hostId: hostId.refine((id2) => id2 !== "local"),
|
|
22791
|
-
version: remoteUpdateParamsSchema.shape.version
|
|
22792
|
-
})
|
|
22793
|
-
]);
|
|
22794
|
-
var remoteConnectionsReplySchema = external_exports.union([
|
|
22795
|
-
external_exports.strictObject({ result: jsonValueSchema }),
|
|
22796
|
-
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
22657
|
+
// ../shared-contracts/dist/codex-accounts.js
|
|
22658
|
+
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
22659
|
+
var nonBlankTextSchema4 = external_exports.string().trim().min(1);
|
|
22660
|
+
var codexAccountPlanTypeSchema = external_exports.enum([
|
|
22661
|
+
"free",
|
|
22662
|
+
"go",
|
|
22663
|
+
"plus",
|
|
22664
|
+
"pro",
|
|
22665
|
+
"prolite",
|
|
22666
|
+
"team",
|
|
22667
|
+
"self_serve_business_prolite",
|
|
22668
|
+
"self_serve_business_usage_based",
|
|
22669
|
+
"business",
|
|
22670
|
+
"ent26",
|
|
22671
|
+
"enterprise_cbp_automation",
|
|
22672
|
+
"enterprise_cbp_usage_based",
|
|
22673
|
+
"enterprise",
|
|
22674
|
+
"edu",
|
|
22675
|
+
"edu_plus",
|
|
22676
|
+
"edu_pro",
|
|
22677
|
+
"unknown"
|
|
22797
22678
|
]);
|
|
22679
|
+
var codexAccountSchema = external_exports.object({
|
|
22680
|
+
accountId: accountIdSchema,
|
|
22681
|
+
label: nonBlankTextSchema4.max(256),
|
|
22682
|
+
email: external_exports.string().email().max(320).optional(),
|
|
22683
|
+
planType: codexAccountPlanTypeSchema.optional()
|
|
22684
|
+
}).strict();
|
|
22685
|
+
var codexAccountPhaseSchema = external_exports.enum(["ready", "unavailable"]);
|
|
22686
|
+
var codexAccountListResultSchema = external_exports.object({
|
|
22687
|
+
version: external_exports.literal(2),
|
|
22688
|
+
currentAccountId: accountIdSchema.nullable(),
|
|
22689
|
+
phase: codexAccountPhaseSchema,
|
|
22690
|
+
revision: external_exports.number().int().nonnegative(),
|
|
22691
|
+
instanceId: nonBlankTextSchema4.max(1024).optional(),
|
|
22692
|
+
accounts: external_exports.array(codexAccountSchema).max(1)
|
|
22693
|
+
}).strict();
|
|
22694
|
+
var codexAccountChangedSchema = codexAccountListResultSchema;
|
|
22695
|
+
var codexAccountUsageParamsSchema = external_exports.object({ accountId: accountIdSchema, refresh: external_exports.boolean().optional() }).strict();
|
|
22696
|
+
var codexAccountUsageResultSchema = external_exports.object({
|
|
22697
|
+
accountId: accountIdSchema,
|
|
22698
|
+
usage: threadUsageSnapshotSchema.nullable(),
|
|
22699
|
+
accountCredits: accountCreditsSnapshotSchema.optional(),
|
|
22700
|
+
freshness: external_exports.enum(["live", "cached"]),
|
|
22701
|
+
observedAt: external_exports.string().datetime().nullable()
|
|
22702
|
+
}).strict();
|
|
22798
22703
|
|
|
22799
|
-
// ../shared-contracts/dist/
|
|
22800
|
-
var
|
|
22801
|
-
|
|
22802
|
-
|
|
22704
|
+
// ../shared-contracts/dist/harness-session-import.js
|
|
22705
|
+
var HARNESS_SESSION_IMPORT_ID_MAX_LENGTH = 1024;
|
|
22706
|
+
var HARNESS_SESSION_IMPORT_CWD_MAX_LENGTH = 16384;
|
|
22707
|
+
var HARNESS_SESSION_IMPORT_TITLE_MAX_LENGTH = 4096;
|
|
22708
|
+
var HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH = 1e3;
|
|
22709
|
+
var HARNESS_SESSION_IMPORT_DEFAULT_PAGE_SIZE = 20;
|
|
22710
|
+
var HARNESS_SESSION_IMPORT_UPDATED_AT_MAX = 864e13;
|
|
22711
|
+
var nonBlankTextSchema5 = external_exports.string().refine((value) => value.trim().length > 0, "Value must not be empty or whitespace").refine((value) => !value.includes("\0"), "Value must not contain NUL");
|
|
22712
|
+
var harnessSessionImportIdSchema = nonBlankTextSchema5.max(HARNESS_SESSION_IMPORT_ID_MAX_LENGTH);
|
|
22713
|
+
var harnessSessionImportCandidateSchema = external_exports.object({
|
|
22714
|
+
nativeSessionId: harnessSessionImportIdSchema,
|
|
22715
|
+
title: nonBlankTextSchema5.max(HARNESS_SESSION_IMPORT_TITLE_MAX_LENGTH).nullable(),
|
|
22716
|
+
updatedAt: external_exports.number().int().nonnegative().max(HARNESS_SESSION_IMPORT_UPDATED_AT_MAX),
|
|
22717
|
+
cwd: nonBlankTextSchema5.max(HARNESS_SESSION_IMPORT_CWD_MAX_LENGTH),
|
|
22718
|
+
// Native file discovery cannot reliably observe another process's activity.
|
|
22719
|
+
running: external_exports.boolean().nullable()
|
|
22720
|
+
}).strict();
|
|
22721
|
+
var harnessSessionImportSourcesParamsSchema = external_exports.object({}).strict();
|
|
22722
|
+
var harnessSessionImportSourcesResultSchema = external_exports.object({
|
|
22723
|
+
harnesses: external_exports.array(external_exports.object({
|
|
22724
|
+
harnessId: harnessPluginIdSchema,
|
|
22725
|
+
name: nonBlankTextSchema5.max(128)
|
|
22726
|
+
}).strict()).max(128)
|
|
22727
|
+
}).strict();
|
|
22728
|
+
var harnessSessionListParamsSchema = external_exports.object({
|
|
22729
|
+
harnessId: harnessPluginIdSchema,
|
|
22730
|
+
query: external_exports.string().trim().max(4096).refine((value) => !value.includes("\0")).optional(),
|
|
22731
|
+
offset: external_exports.number().int().nonnegative().safe().optional(),
|
|
22732
|
+
limit: external_exports.number().int().min(1).max(HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH).optional()
|
|
22733
|
+
}).strict();
|
|
22734
|
+
var harnessSessionListResultSchema = external_exports.object({
|
|
22735
|
+
candidates: external_exports.array(harnessSessionImportCandidateSchema).max(HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH),
|
|
22736
|
+
total: external_exports.number().int().nonnegative().safe()
|
|
22737
|
+
}).strict();
|
|
22738
|
+
var harnessSessionImportParamsSchema = external_exports.object({
|
|
22739
|
+
harnessId: harnessPluginIdSchema,
|
|
22740
|
+
nativeSessionId: harnessSessionImportIdSchema
|
|
22741
|
+
}).strict();
|
|
22742
|
+
var harnessSessionImportResultSchema = external_exports.object({
|
|
22743
|
+
threadId: nonBlankTextSchema5.max(1024).pipe(hostThreadIdSchema)
|
|
22744
|
+
}).strict();
|
|
22745
|
+
|
|
22746
|
+
// ../shared-contracts/dist/deepseek-modern-sessions.js
|
|
22747
|
+
var DEEPSEEK_MODERN_SESSION_LIST_MAX_LENGTH = HARNESS_SESSION_IMPORT_LIST_MAX_LENGTH;
|
|
22748
|
+
var DEEPSEEK_MODERN_HOST_THREAD_ID_MAX_LENGTH = 1024;
|
|
22749
|
+
var nonBlankTextSchema6 = external_exports.string().refine((value) => value.trim().length > 0, "Value must not be empty or whitespace").refine((value) => !value.includes("\0"), "Value must not contain NUL");
|
|
22750
|
+
var deepSeekModernSessionIdSchema = harnessSessionImportIdSchema;
|
|
22751
|
+
var deepSeekModernSessionCandidateSchema = harnessSessionImportCandidateSchema;
|
|
22752
|
+
var deepSeekModernSessionListParamsSchema = external_exports.object({}).strict();
|
|
22753
|
+
var deepSeekModernSessionListResultSchema = external_exports.object({
|
|
22754
|
+
candidates: external_exports.array(deepSeekModernSessionCandidateSchema).max(DEEPSEEK_MODERN_SESSION_LIST_MAX_LENGTH)
|
|
22755
|
+
}).strict();
|
|
22756
|
+
var deepSeekModernSessionImportParamsSchema = external_exports.object({
|
|
22757
|
+
nativeSessionId: deepSeekModernSessionIdSchema
|
|
22758
|
+
}).strict();
|
|
22759
|
+
var deepSeekModernSessionImportResultSchema = external_exports.object({
|
|
22760
|
+
threadId: nonBlankTextSchema6.max(DEEPSEEK_MODERN_HOST_THREAD_ID_MAX_LENGTH).pipe(hostThreadIdSchema)
|
|
22761
|
+
}).strict();
|
|
22762
|
+
|
|
22763
|
+
// ../shared-contracts/dist/external-thread-fork.js
|
|
22764
|
+
var externalThreadForkParamsSchema = external_exports.object({
|
|
22765
|
+
threadId: hostThreadIdSchema,
|
|
22766
|
+
lastTurnId: hostTurnIdSchema
|
|
22767
|
+
}).strict();
|
|
22768
|
+
var externalThreadForkResultSchema = external_exports.object({
|
|
22769
|
+
threadId: hostThreadIdSchema
|
|
22770
|
+
}).strict();
|
|
22771
|
+
|
|
22772
|
+
// ../shared-contracts/dist/harness-commands.js
|
|
22773
|
+
var commandIdSchema = external_exports.string().trim().min(1).max(128).regex(/^[A-Za-z0-9._:-]+$/u).brand();
|
|
22774
|
+
var commandInvocationSchema = external_exports.string().min(1).max(128);
|
|
22775
|
+
var commandLabelSchema = external_exports.string().trim().min(1).max(128);
|
|
22776
|
+
var commandDescriptionSchema = external_exports.string().trim().min(1).max(512);
|
|
22777
|
+
var harnessCommandDescriptorSchema = external_exports.object({
|
|
22778
|
+
id: commandIdSchema,
|
|
22779
|
+
invocation: commandInvocationSchema,
|
|
22780
|
+
label: commandLabelSchema,
|
|
22781
|
+
description: commandDescriptionSchema.optional(),
|
|
22782
|
+
localizations: harnessLocalizationsSchema.optional(),
|
|
22783
|
+
argumentMode: external_exports.enum(["none", "text"]),
|
|
22784
|
+
/**
|
|
22785
|
+
* Native distinction reported by the Harness. Omitted when the Harness does
|
|
22786
|
+
* not tell skills and commands apart; consumers treat that as "command".
|
|
22787
|
+
*/
|
|
22788
|
+
kind: external_exports.enum(["command", "skill"]).optional()
|
|
22789
|
+
}).strict();
|
|
22790
|
+
var harnessCommandCatalogSchema = external_exports.object({
|
|
22791
|
+
commands: external_exports.array(harnessCommandDescriptorSchema),
|
|
22792
|
+
/** Partial discovery failures; valid commands remain available. */
|
|
22793
|
+
warnings: external_exports.array(external_exports.string().min(1)).optional(),
|
|
22794
|
+
/**
|
|
22795
|
+
* `live` when a native Session has reported its live catalog for the
|
|
22796
|
+
* workspace (even when filtering leaves only built-ins); `static` for
|
|
22797
|
+
* Adapter built-ins only before live commands arrive. Adapters may set
|
|
22798
|
+
* `live` once their Session's live catalog has loaded.
|
|
22799
|
+
*/
|
|
22800
|
+
source: external_exports.enum(["live", "static"]).optional()
|
|
22801
|
+
}).strict().superRefine((catalog, context) => {
|
|
22802
|
+
const ids = /* @__PURE__ */ new Set();
|
|
22803
|
+
for (const [index, command] of catalog.commands.entries()) {
|
|
22804
|
+
if (ids.has(command.id)) {
|
|
22805
|
+
context.addIssue({
|
|
22806
|
+
code: "custom",
|
|
22807
|
+
message: "Harness command IDs must be unique",
|
|
22808
|
+
path: ["commands", index, "id"]
|
|
22809
|
+
});
|
|
22810
|
+
}
|
|
22811
|
+
ids.add(command.id);
|
|
22812
|
+
}
|
|
22803
22813
|
});
|
|
22804
|
-
var
|
|
22814
|
+
var harnessCommandsInspectParamsSchema = external_exports.object({
|
|
22815
|
+
harnessId: harnessIdSchema,
|
|
22816
|
+
/** Workspace of a draft without a Thread, for its live catalog when known. */
|
|
22817
|
+
cwd: external_exports.string().min(1).optional()
|
|
22818
|
+
}).strict();
|
|
22819
|
+
var threadCommandsInspectParamsSchema = external_exports.object({
|
|
22820
|
+
threadId: hostThreadIdSchema
|
|
22821
|
+
}).strict();
|
|
22822
|
+
var threadCommandExecuteParamsSchema = external_exports.object({
|
|
22823
|
+
threadId: hostThreadIdSchema,
|
|
22824
|
+
commandId: commandIdSchema,
|
|
22825
|
+
turnId: hostTurnIdSchema.optional(),
|
|
22826
|
+
arguments: jsonObjectSchema.optional()
|
|
22827
|
+
}).strict();
|
|
22828
|
+
var threadCommandExecuteResultSchema = external_exports.object({
|
|
22829
|
+
accepted: external_exports.literal(true),
|
|
22830
|
+
turnId: hostTurnIdSchema.optional()
|
|
22831
|
+
}).strict();
|
|
22805
22832
|
|
|
22806
|
-
// ../shared-contracts/dist/
|
|
22807
|
-
var
|
|
22808
|
-
var
|
|
22809
|
-
|
|
22810
|
-
|
|
22833
|
+
// ../shared-contracts/dist/json-rpc.js
|
|
22834
|
+
var jsonRpcVersionSchema = external_exports.literal("2.0").optional();
|
|
22835
|
+
var absentSchema = external_exports.never().optional();
|
|
22836
|
+
var methodSchema = external_exports.string().min(1);
|
|
22837
|
+
var jsonRpcIdSchema = external_exports.union([external_exports.string(), external_exports.number().int()]);
|
|
22838
|
+
var jsonRpcErrorSchema = external_exports.object({
|
|
22839
|
+
code: external_exports.number().int(),
|
|
22840
|
+
message: external_exports.string(),
|
|
22841
|
+
data: jsonValueSchema.optional()
|
|
22842
|
+
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["data"]));
|
|
22843
|
+
var jsonRpcRequestSchema = external_exports.object({
|
|
22844
|
+
jsonrpc: jsonRpcVersionSchema,
|
|
22845
|
+
id: jsonRpcIdSchema,
|
|
22846
|
+
method: methodSchema,
|
|
22847
|
+
params: jsonValueSchema.optional(),
|
|
22848
|
+
result: absentSchema,
|
|
22849
|
+
error: absentSchema
|
|
22850
|
+
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "params", "result", "error"]));
|
|
22851
|
+
var jsonRpcNotificationSchema = external_exports.object({
|
|
22852
|
+
jsonrpc: jsonRpcVersionSchema,
|
|
22853
|
+
id: absentSchema,
|
|
22854
|
+
method: methodSchema,
|
|
22855
|
+
params: jsonValueSchema.optional(),
|
|
22856
|
+
result: absentSchema,
|
|
22857
|
+
error: absentSchema
|
|
22858
|
+
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "id", "params", "result", "error"]));
|
|
22859
|
+
var jsonRpcSuccessResponseSchema = external_exports.object({
|
|
22860
|
+
jsonrpc: jsonRpcVersionSchema,
|
|
22861
|
+
id: jsonRpcIdSchema,
|
|
22862
|
+
method: absentSchema,
|
|
22863
|
+
params: absentSchema,
|
|
22864
|
+
result: jsonValueSchema,
|
|
22865
|
+
error: absentSchema
|
|
22866
|
+
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "method", "params", "error"]));
|
|
22867
|
+
var jsonRpcErrorResponseSchema = external_exports.object({
|
|
22868
|
+
jsonrpc: jsonRpcVersionSchema,
|
|
22869
|
+
id: jsonRpcIdSchema,
|
|
22870
|
+
method: absentSchema,
|
|
22871
|
+
params: absentSchema,
|
|
22872
|
+
result: absentSchema,
|
|
22873
|
+
error: jsonRpcErrorSchema
|
|
22874
|
+
}).catchall(jsonValueSchema).superRefine(rejectExplicitUndefined(["jsonrpc", "method", "params", "result"]));
|
|
22875
|
+
var jsonRpcEnvelopeSchema = external_exports.union([
|
|
22876
|
+
jsonRpcRequestSchema,
|
|
22877
|
+
jsonRpcNotificationSchema,
|
|
22878
|
+
jsonRpcSuccessResponseSchema,
|
|
22879
|
+
jsonRpcErrorResponseSchema
|
|
22811
22880
|
]);
|
|
22812
|
-
|
|
22813
|
-
|
|
22814
|
-
|
|
22815
|
-
|
|
22816
|
-
error: external_exports.string().optional()
|
|
22817
|
-
});
|
|
22818
|
-
var webUiExtensionSchema = external_exports.object({
|
|
22819
|
-
id: webUiExtensionIdSchema,
|
|
22820
|
-
name: external_exports.string().min(1).max(214),
|
|
22821
|
-
version: external_exports.string().min(1).max(128),
|
|
22822
|
-
format: external_exports.literal("dsh"),
|
|
22823
|
-
supportedTargets: external_exports.tuple([external_exports.literal("web")]),
|
|
22824
|
-
enabledTargets: external_exports.array(external_exports.literal("web")).max(1),
|
|
22825
|
-
source: external_exports.string().min(1).max(4096),
|
|
22826
|
-
/** Public project page, derived from installed package metadata and its source. */
|
|
22827
|
-
projectUrl: external_exports.string().max(4096).url({ protocol: /^https?$/u }).optional(),
|
|
22828
|
-
installedAt: external_exports.string(),
|
|
22829
|
-
meta: webUiExtensionMetaSchema.optional(),
|
|
22830
|
-
loadError: external_exports.string().optional()
|
|
22881
|
+
|
|
22882
|
+
// ../shared-contracts/dist/native-refs.js
|
|
22883
|
+
var nativeIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
22884
|
+
message: "Native identifier must not be empty or whitespace"
|
|
22831
22885
|
});
|
|
22832
|
-
var
|
|
22833
|
-
|
|
22834
|
-
|
|
22835
|
-
|
|
22836
|
-
|
|
22886
|
+
var nativeSessionRefV1RuntimeSchema = external_exports.strictObject({
|
|
22887
|
+
harnessId: harnessIdSchema,
|
|
22888
|
+
nativeSessionId: nativeIdSchema,
|
|
22889
|
+
locator: jsonValueSchema.optional(),
|
|
22890
|
+
formatVersion: external_exports.literal(1)
|
|
22891
|
+
}).superRefine(rejectExplicitUndefined(["locator"]));
|
|
22892
|
+
var nativeTurnRefV1Schema = external_exports.strictObject({
|
|
22893
|
+
harnessId: harnessIdSchema,
|
|
22894
|
+
nativeSessionId: nativeIdSchema,
|
|
22895
|
+
nativeTurnKey: nativeIdSchema,
|
|
22896
|
+
formatVersion: external_exports.literal(1)
|
|
22837
22897
|
});
|
|
22838
|
-
var
|
|
22839
|
-
|
|
22840
|
-
|
|
22841
|
-
|
|
22842
|
-
|
|
22843
|
-
|
|
22844
|
-
|
|
22898
|
+
var nativeCheckpointRefV1RuntimeSchema = external_exports.strictObject({
|
|
22899
|
+
harnessId: harnessIdSchema,
|
|
22900
|
+
nativeSessionId: nativeIdSchema,
|
|
22901
|
+
checkpointId: nativeIdSchema,
|
|
22902
|
+
locator: jsonValueSchema.optional(),
|
|
22903
|
+
formatVersion: external_exports.literal(1)
|
|
22904
|
+
}).superRefine(rejectExplicitUndefined(["locator"]));
|
|
22845
22905
|
|
|
22846
|
-
// ../shared-contracts/dist/
|
|
22847
|
-
var
|
|
22848
|
-
var
|
|
22849
|
-
var
|
|
22850
|
-
var
|
|
22851
|
-
|
|
22852
|
-
"
|
|
22853
|
-
"
|
|
22854
|
-
"
|
|
22855
|
-
"green",
|
|
22856
|
-
"amber",
|
|
22857
|
-
"rose",
|
|
22858
|
-
"slate"
|
|
22859
|
-
];
|
|
22860
|
-
var remotePeerColorSchema = external_exports.enum(REMOTE_PEER_COLORS);
|
|
22861
|
-
var REMOTE_PEER_COLOR_SET = new Set(REMOTE_PEER_COLORS);
|
|
22862
|
-
var remotePeerStateSchema = external_exports.enum([
|
|
22863
|
-
"connected",
|
|
22864
|
-
"connecting",
|
|
22865
|
-
"auth-error",
|
|
22866
|
-
"offline",
|
|
22867
|
-
"disabled"
|
|
22906
|
+
// ../shared-contracts/dist/updates.js
|
|
22907
|
+
var UPDATE_ERROR_MAX_LENGTH = 500;
|
|
22908
|
+
var UPDATE_SEMVER_PATTERN = /^\d+\.\d+\.\d+(?:-[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/u;
|
|
22909
|
+
var updateSemanticVersionSchema = external_exports.string().regex(UPDATE_SEMVER_PATTERN);
|
|
22910
|
+
var updateInstallationSchema = external_exports.enum([
|
|
22911
|
+
"npm",
|
|
22912
|
+
"windows-installer",
|
|
22913
|
+
"macos-dmg",
|
|
22914
|
+
"linux-archive"
|
|
22868
22915
|
]);
|
|
22869
|
-
var
|
|
22870
|
-
|
|
22871
|
-
|
|
22872
|
-
|
|
22873
|
-
|
|
22874
|
-
|
|
22875
|
-
|
|
22876
|
-
|
|
22877
|
-
|
|
22878
|
-
|
|
22879
|
-
|
|
22880
|
-
|
|
22881
|
-
|
|
22882
|
-
|
|
22883
|
-
|
|
22884
|
-
lastError: external_exports.string().max(1e3).optional(),
|
|
22885
|
-
projectCount: external_exports.number().int().nonnegative(),
|
|
22886
|
-
createdAt: external_exports.string(),
|
|
22887
|
-
updatedAt: external_exports.string()
|
|
22916
|
+
var updatePhaseSchema = external_exports.enum([
|
|
22917
|
+
"prepared",
|
|
22918
|
+
"downloading",
|
|
22919
|
+
"waiting-for-exit",
|
|
22920
|
+
"installing",
|
|
22921
|
+
"restarting",
|
|
22922
|
+
"succeeded",
|
|
22923
|
+
"failed"
|
|
22924
|
+
]);
|
|
22925
|
+
var npmDownloadProgressSchema = external_exports.strictObject({
|
|
22926
|
+
completed: external_exports.number().int().nonnegative(),
|
|
22927
|
+
total: external_exports.number().int().positive()
|
|
22928
|
+
}).refine((progress) => progress.completed <= progress.total, {
|
|
22929
|
+
path: ["completed"],
|
|
22930
|
+
message: "completed must not exceed total"
|
|
22888
22931
|
});
|
|
22889
|
-
var
|
|
22890
|
-
|
|
22932
|
+
var updateStatusSchema = external_exports.strictObject({
|
|
22933
|
+
version: updateSemanticVersionSchema,
|
|
22934
|
+
installation: updateInstallationSchema,
|
|
22935
|
+
phase: updatePhaseSchema,
|
|
22936
|
+
updatedAt: external_exports.number().int().nonnegative(),
|
|
22937
|
+
downloadedBytes: external_exports.number().int().nonnegative().optional(),
|
|
22938
|
+
totalBytes: external_exports.number().int().positive().optional(),
|
|
22939
|
+
npmDownload: npmDownloadProgressSchema.optional(),
|
|
22940
|
+
error: external_exports.string().min(1).max(UPDATE_ERROR_MAX_LENGTH).nullable(),
|
|
22941
|
+
serviceStopOutput: external_exports.string().optional()
|
|
22942
|
+
}).superRefine((status, context) => {
|
|
22943
|
+
if (status.downloadedBytes !== void 0 && status.totalBytes !== void 0 && status.downloadedBytes > status.totalBytes) {
|
|
22944
|
+
context.addIssue({
|
|
22945
|
+
code: "custom",
|
|
22946
|
+
path: ["downloadedBytes"],
|
|
22947
|
+
message: "downloadedBytes must not exceed totalBytes"
|
|
22948
|
+
});
|
|
22949
|
+
}
|
|
22891
22950
|
});
|
|
22892
|
-
var
|
|
22893
|
-
|
|
22894
|
-
|
|
22895
|
-
|
|
22896
|
-
|
|
22897
|
-
|
|
22898
|
-
|
|
22899
|
-
|
|
22900
|
-
|
|
22901
|
-
|
|
22902
|
-
|
|
22903
|
-
|
|
22904
|
-
origin: external_exports.string().min(1).max(2048).optional(),
|
|
22905
|
-
token: external_exports.string().min(1).max(2048).optional(),
|
|
22906
|
-
enabled: external_exports.boolean().optional()
|
|
22951
|
+
var updateEmptyParamsSchema = external_exports.strictObject({});
|
|
22952
|
+
var githubReleaseNotesUrlSchema = external_exports.string().max(300).regex(/^https:\/\/github\.com\/BytePioneer-AI\/codex-host\/releases\/tag\/v[0-9A-Za-z.+-]+$/u, "release notes URL must identify a codexhost GitHub Release");
|
|
22953
|
+
var updateCheckResultSchema = external_exports.strictObject({
|
|
22954
|
+
currentVersion: updateSemanticVersionSchema,
|
|
22955
|
+
installation: updateInstallationSchema.nullable(),
|
|
22956
|
+
latestVersion: updateSemanticVersionSchema.nullable(),
|
|
22957
|
+
updateAvailable: external_exports.boolean(),
|
|
22958
|
+
installationAvailable: external_exports.boolean(),
|
|
22959
|
+
releaseNotes: external_exports.string().min(1).max(2e4).nullable(),
|
|
22960
|
+
releaseNotesUrl: githubReleaseNotesUrlSchema.nullable(),
|
|
22961
|
+
status: updateStatusSchema.nullable(),
|
|
22962
|
+
error: external_exports.string().min(1).max(UPDATE_ERROR_MAX_LENGTH).nullable()
|
|
22907
22963
|
});
|
|
22908
|
-
var
|
|
22909
|
-
|
|
22964
|
+
var updateStartResultSchema = external_exports.strictObject({
|
|
22965
|
+
status: updateStatusSchema
|
|
22910
22966
|
});
|
|
22911
|
-
var
|
|
22912
|
-
|
|
22967
|
+
var updateStatusResultSchema = external_exports.strictObject({
|
|
22968
|
+
status: updateStatusSchema.nullable()
|
|
22913
22969
|
});
|
|
22914
|
-
|
|
22915
|
-
|
|
22916
|
-
|
|
22917
|
-
|
|
22918
|
-
|
|
22919
|
-
|
|
22920
|
-
|
|
22921
|
-
|
|
22922
|
-
|
|
22923
|
-
|
|
22970
|
+
|
|
22971
|
+
// ../shared-contracts/dist/release-announcement.js
|
|
22972
|
+
var RELEASE_ANNOUNCEMENT_GET_METHOD = "codexhost/announcement/get";
|
|
22973
|
+
var RELEASE_ANNOUNCEMENT_ACKNOWLEDGE_METHOD = "codexhost/announcement/acknowledge";
|
|
22974
|
+
var RELEASE_ANNOUNCEMENT_MAX_THEMES = 12;
|
|
22975
|
+
var releaseAnnouncementThemeSchema = external_exports.strictObject({
|
|
22976
|
+
icon: external_exports.string().min(1).max(16).optional(),
|
|
22977
|
+
title: external_exports.string().min(1).max(120),
|
|
22978
|
+
body: external_exports.string().min(1).max(1200),
|
|
22979
|
+
contributors: external_exports.array(external_exports.string().min(1).max(39)).max(30)
|
|
22924
22980
|
});
|
|
22925
|
-
var
|
|
22926
|
-
|
|
22927
|
-
|
|
22928
|
-
origin: external_exports.string().max(2048).optional(),
|
|
22929
|
-
transportKind: remotePeerTransportKindSchema.optional(),
|
|
22930
|
-
encrypted: external_exports.boolean().optional(),
|
|
22931
|
-
version: external_exports.string().max(128).optional(),
|
|
22932
|
-
platform: external_exports.string().max(64).optional(),
|
|
22933
|
-
hostname: external_exports.string().max(255).optional(),
|
|
22934
|
-
homeDir: external_exports.string().max(4096).optional(),
|
|
22935
|
-
projectCount: external_exports.number().int().nonnegative().optional(),
|
|
22936
|
-
projects: external_exports.array(remotePeerTestProjectSchema).optional(),
|
|
22937
|
-
error: external_exports.string().max(1e3).optional()
|
|
22981
|
+
var releaseAnnouncementContentSchema = external_exports.strictObject({
|
|
22982
|
+
summary: external_exports.string().min(1).max(600).optional(),
|
|
22983
|
+
themes: external_exports.array(releaseAnnouncementThemeSchema).min(1).max(RELEASE_ANNOUNCEMENT_MAX_THEMES)
|
|
22938
22984
|
});
|
|
22939
|
-
var
|
|
22940
|
-
|
|
22941
|
-
|
|
22942
|
-
|
|
22943
|
-
|
|
22985
|
+
var releaseAnnouncementSchema = external_exports.strictObject({
|
|
22986
|
+
version: updateSemanticVersionSchema,
|
|
22987
|
+
publishedAt: external_exports.iso.datetime(),
|
|
22988
|
+
url: external_exports.string().max(300).regex(/^https:\/\/github\.com\/BytePioneer-AI\/codex-host\/releases\/tag\/v[0-9A-Za-z.+-]+$/u),
|
|
22989
|
+
zh: releaseAnnouncementContentSchema.nullable(),
|
|
22990
|
+
en: releaseAnnouncementContentSchema.nullable()
|
|
22991
|
+
}).refine((value) => value.zh !== null || value.en !== null, {
|
|
22992
|
+
message: "an announcement needs at least one language"
|
|
22944
22993
|
});
|
|
22945
|
-
var
|
|
22946
|
-
|
|
22947
|
-
attachments: external_exports.literal(1).optional(),
|
|
22948
|
-
/** /api/peer/v1/workspace-files/rpc and /api/peer/v1/workspace-files/download are available. */
|
|
22949
|
-
workspaceFiles: external_exports.literal(1).optional(),
|
|
22950
|
-
/** Peer supports officeToPdf/render over /api/peer/v1/workspace-files/rpc. */
|
|
22951
|
-
officePreview: external_exports.literal(1).optional()
|
|
22994
|
+
var releaseAnnouncementGetParamsSchema = external_exports.strictObject({
|
|
22995
|
+
manual: external_exports.boolean().optional()
|
|
22952
22996
|
});
|
|
22953
|
-
var
|
|
22954
|
-
|
|
22955
|
-
|
|
22956
|
-
hostname: external_exports.string().max(255),
|
|
22957
|
-
homeDir: external_exports.string().max(4096).optional(),
|
|
22958
|
-
epoch: external_exports.string().min(1).max(256),
|
|
22959
|
-
projects: external_exports.array(remotePeerManifestProjectSchema),
|
|
22960
|
-
capabilities: remotePeerCapabilitiesSchema.optional()
|
|
22997
|
+
var releaseAnnouncementGetResultSchema = external_exports.strictObject({
|
|
22998
|
+
announcement: releaseAnnouncementSchema.nullable(),
|
|
22999
|
+
unread: external_exports.boolean()
|
|
22961
23000
|
});
|
|
22962
|
-
var
|
|
22963
|
-
|
|
22964
|
-
threadId: external_exports.string().min(1).max(1024),
|
|
22965
|
-
scope: external_exports.string().regex(REMOTE_PEER_UPLOAD_SCOPE_PATTERN).optional(),
|
|
22966
|
-
requestId: external_exports.string().min(1).max(256).optional(),
|
|
22967
|
-
mode: external_exports.enum(["queue", "steer"]).optional(),
|
|
22968
|
-
expectedTurnId: external_exports.string().min(1).max(1024).nullable().optional(),
|
|
22969
|
-
content: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
22970
|
-
external_exports.strictObject({ type: external_exports.literal("text"), text: external_exports.string() }),
|
|
22971
|
-
external_exports.strictObject({ type: external_exports.literal("file"), receiptId: external_exports.string().min(1).max(128) })
|
|
22972
|
-
])).min(1).max(64)
|
|
23001
|
+
var releaseAnnouncementAcknowledgeParamsSchema = external_exports.strictObject({
|
|
23002
|
+
version: updateSemanticVersionSchema
|
|
22973
23003
|
});
|
|
22974
|
-
|
|
22975
|
-
|
|
22976
|
-
|
|
22977
|
-
|
|
22978
|
-
|
|
22979
|
-
|
|
23004
|
+
|
|
23005
|
+
// ../shared-contracts/dist/thread-watch-notice.js
|
|
23006
|
+
var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
23007
|
+
"completed",
|
|
23008
|
+
"failed",
|
|
23009
|
+
"interrupted",
|
|
23010
|
+
"needsInput",
|
|
23011
|
+
"timedOut",
|
|
23012
|
+
"unreadable",
|
|
23013
|
+
"notFound"
|
|
23014
|
+
];
|
|
23015
|
+
var ENTRY_PATTERN = new RegExp(String.raw`^- \[([^\]\n]+)\]\(thread://([^\s()<>"?#/]+)\): ` + `(${THREAD_WATCH_NOTICE_OUTCOMES.join("|")})(?:. (.+))?$`, "u");
|
|
23016
|
+
|
|
23017
|
+
// ../shared-contracts/dist/remote-runtime.js
|
|
23018
|
+
var RUNTIME_STATUS_METHOD = "codexhost/runtime/status";
|
|
23019
|
+
var REMOTE_UPDATE_METHOD = "codexhost/remote/update";
|
|
23020
|
+
var remoteUpdatePhaseSchema = external_exports.enum([
|
|
23021
|
+
"idle",
|
|
23022
|
+
"installing",
|
|
23023
|
+
"restarting",
|
|
23024
|
+
"succeeded",
|
|
23025
|
+
"failed"
|
|
23026
|
+
]);
|
|
23027
|
+
var runtimeStatusSchema = external_exports.object({
|
|
23028
|
+
runningVersion: external_exports.string().nullable(),
|
|
23029
|
+
installedVersion: external_exports.string().nullable(),
|
|
23030
|
+
restartRequired: external_exports.boolean(),
|
|
23031
|
+
remote: external_exports.boolean(),
|
|
23032
|
+
updateSupported: external_exports.boolean(),
|
|
23033
|
+
update: external_exports.object({
|
|
23034
|
+
phase: remoteUpdatePhaseSchema,
|
|
23035
|
+
targetVersion: external_exports.string().nullable(),
|
|
23036
|
+
error: external_exports.string().nullable()
|
|
22980
23037
|
})
|
|
22981
23038
|
});
|
|
22982
|
-
var
|
|
23039
|
+
var remoteUpdateParamsSchema = external_exports.object({
|
|
23040
|
+
version: external_exports.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u)
|
|
23041
|
+
}).strict();
|
|
23042
|
+
var REMOTE_SSH_SETUP_METHOD = "codexhost/remote/ssh-setup";
|
|
23043
|
+
var remoteSshSetupParamsSchema = external_exports.object({
|
|
23044
|
+
hostname: external_exports.string().min(1).max(1024).refine((value) => !value.startsWith("-") && !/\s/u.test(value)),
|
|
23045
|
+
port: external_exports.number().int().min(1).max(65535).nullable(),
|
|
23046
|
+
identity: external_exports.string().max(4096).nullable(),
|
|
23047
|
+
action: external_exports.enum(["inspect", "install", "update", "repair", "uninstall"]),
|
|
23048
|
+
uninstallPackage: external_exports.boolean().optional(),
|
|
23049
|
+
version: external_exports.string().regex(/^\d+\.\d+\.\d+$/u).nullable()
|
|
23050
|
+
}).strict();
|
|
23051
|
+
var remoteSshSetupResultSchema = external_exports.object({ state: external_exports.enum(["installed", "not-installed"]) }).strict();
|
|
23052
|
+
|
|
23053
|
+
// ../shared-contracts/dist/remote-sessions.js
|
|
23054
|
+
var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
|
|
23055
|
+
var REMOTE_IDENTITY_MAX_LENGTH = 1024;
|
|
23056
|
+
var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
|
|
23057
|
+
var target = {
|
|
23058
|
+
hostId: identity.regex(/^(?:remote-(?:ssh(?:-|:)|control:)|remote-peer:[a-zA-Z0-9_-]{1,64}$)/u)
|
|
23059
|
+
};
|
|
23060
|
+
var thread = { ...target, threadId: identity };
|
|
23061
|
+
var text = external_exports.string().min(1).max(8e3);
|
|
23062
|
+
var input2 = { text, requestId: identity };
|
|
23063
|
+
var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
|
|
23064
|
+
external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
|
|
22983
23065
|
external_exports.object({
|
|
22984
|
-
|
|
22985
|
-
|
|
22986
|
-
|
|
22987
|
-
|
|
22988
|
-
|
|
22989
|
-
|
|
22990
|
-
|
|
22991
|
-
|
|
22992
|
-
|
|
23066
|
+
accepted: external_exports.literal(false),
|
|
23067
|
+
code: external_exports.enum([
|
|
23068
|
+
"remote/queue-unavailable",
|
|
23069
|
+
"remote/steer-unavailable",
|
|
23070
|
+
"remote/turn-changed",
|
|
23071
|
+
"remote/send-rejected",
|
|
23072
|
+
"session/queue-item-not-found",
|
|
23073
|
+
"session/queue-item-starting"
|
|
23074
|
+
]),
|
|
23075
|
+
message: external_exports.string()
|
|
23076
|
+
})
|
|
23077
|
+
]);
|
|
23078
|
+
var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
|
|
23079
|
+
external_exports.object({ available: external_exports.literal(false) }),
|
|
23080
|
+
external_exports.object({
|
|
23081
|
+
available: external_exports.literal(true),
|
|
23082
|
+
items: external_exports.array(external_exports.object({ id: identity, clientUserMessageId: identity, preview: external_exports.string().max(801) })).max(100)
|
|
23083
|
+
})
|
|
23084
|
+
]);
|
|
23085
|
+
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
23086
|
+
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
23087
|
+
external_exports.strictObject({
|
|
23088
|
+
kind: external_exports.literal("create"),
|
|
23089
|
+
...target,
|
|
23090
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
23091
|
+
epoch: identity
|
|
23092
|
+
}),
|
|
23093
|
+
external_exports.strictObject({ kind: external_exports.literal("projectHarnesses"), ...target, epoch: identity }),
|
|
23094
|
+
external_exports.strictObject({
|
|
23095
|
+
kind: external_exports.literal("inspectHarness"),
|
|
23096
|
+
...target,
|
|
23097
|
+
epoch: identity,
|
|
23098
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
23099
|
+
harnessId: identity
|
|
23100
|
+
}),
|
|
23101
|
+
external_exports.strictObject({
|
|
23102
|
+
kind: external_exports.literal("startSelected"),
|
|
23103
|
+
...target,
|
|
23104
|
+
epoch: identity,
|
|
23105
|
+
cwd: external_exports.string().min(1).max(8192),
|
|
23106
|
+
harnessId: identity,
|
|
23107
|
+
model: external_exports.string().min(1).max(4096),
|
|
23108
|
+
serviceTier: external_exports.enum(["priority", "ultrafast"]).optional(),
|
|
23109
|
+
reasoningEffort: identity.optional()
|
|
23110
|
+
}),
|
|
23111
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
23112
|
+
external_exports.strictObject({
|
|
23113
|
+
kind: external_exports.literal("list"),
|
|
23114
|
+
...target,
|
|
23115
|
+
cursor: external_exports.string().nullable(),
|
|
23116
|
+
archived: external_exports.boolean(),
|
|
23117
|
+
includeLoaded: external_exports.literal(true).optional()
|
|
23118
|
+
}),
|
|
23119
|
+
external_exports.strictObject({
|
|
23120
|
+
kind: external_exports.literal("read"),
|
|
23121
|
+
...thread,
|
|
23122
|
+
page: external_exports.strictObject({
|
|
23123
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
23124
|
+
epoch: identity.optional(),
|
|
23125
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
23126
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
23127
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
23128
|
+
message: "A history continuation requires its connection epoch"
|
|
23129
|
+
}).optional()
|
|
23130
|
+
}),
|
|
23131
|
+
external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
|
|
23132
|
+
external_exports.strictObject({
|
|
23133
|
+
kind: external_exports.literal("configure"),
|
|
23134
|
+
...thread,
|
|
23135
|
+
epoch: identity,
|
|
23136
|
+
modelId: identity.optional(),
|
|
23137
|
+
serviceTier: harnessModelServiceTierSchema.optional(),
|
|
23138
|
+
thinkingOptionId: identity.optional(),
|
|
23139
|
+
permissionModeId: identity.optional()
|
|
23140
|
+
}).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting").refine((value) => value.serviceTier === void 0 || value.modelId !== void 0, {
|
|
23141
|
+
message: "A service tier requires a Model ID"
|
|
23142
|
+
}),
|
|
23143
|
+
external_exports.strictObject({
|
|
23144
|
+
kind: external_exports.literal("prompt"),
|
|
23145
|
+
...thread,
|
|
23146
|
+
epoch: identity,
|
|
23147
|
+
text,
|
|
23148
|
+
requestId: identity.optional()
|
|
23149
|
+
}),
|
|
23150
|
+
external_exports.strictObject({ kind: external_exports.literal("queue"), ...thread, epoch: identity }),
|
|
23151
|
+
external_exports.strictObject({
|
|
23152
|
+
kind: external_exports.literal("delivery"),
|
|
23153
|
+
...thread,
|
|
23154
|
+
epoch: identity,
|
|
23155
|
+
action: external_exports.discriminatedUnion("kind", [
|
|
23156
|
+
external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input2 }),
|
|
23157
|
+
external_exports.strictObject({ kind: external_exports.literal("steer"), ...input2, turnId: identity }),
|
|
23158
|
+
external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
|
|
23159
|
+
external_exports.strictObject({
|
|
23160
|
+
kind: external_exports.literal("start"),
|
|
23161
|
+
itemId: identity,
|
|
23162
|
+
onlyIfHead: external_exports.literal(true).optional()
|
|
23163
|
+
}),
|
|
23164
|
+
external_exports.strictObject({ kind: external_exports.literal("sendNow"), itemId: identity })
|
|
23165
|
+
])
|
|
22993
23166
|
}),
|
|
22994
|
-
|
|
22995
|
-
|
|
22996
|
-
|
|
22997
|
-
|
|
22998
|
-
|
|
22999
|
-
|
|
23167
|
+
external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
|
|
23168
|
+
external_exports.strictObject({
|
|
23169
|
+
kind: external_exports.literal("rename"),
|
|
23170
|
+
...thread,
|
|
23171
|
+
epoch: identity,
|
|
23172
|
+
name: external_exports.string().min(1).max(512)
|
|
23000
23173
|
}),
|
|
23001
|
-
|
|
23174
|
+
external_exports.strictObject({ kind: external_exports.literal("archive"), ...thread, epoch: identity, archived: external_exports.boolean() }),
|
|
23175
|
+
external_exports.strictObject({
|
|
23176
|
+
kind: external_exports.literal("respond"),
|
|
23177
|
+
...thread,
|
|
23178
|
+
epoch: identity,
|
|
23179
|
+
requestId: external_exports.union([identity, external_exports.number().int()]),
|
|
23180
|
+
result: external_exports.record(external_exports.string(), external_exports.unknown())
|
|
23181
|
+
})
|
|
23002
23182
|
]);
|
|
23003
|
-
|
|
23004
|
-
|
|
23005
|
-
|
|
23006
|
-
|
|
23007
|
-
|
|
23008
|
-
|
|
23009
|
-
|
|
23010
|
-
|
|
23011
|
-
|
|
23012
|
-
|
|
23013
|
-
|
|
23014
|
-
|
|
23015
|
-
|
|
23016
|
-
|
|
23017
|
-
});
|
|
23018
|
-
var remotePeerCreateDirParamsSchema = external_exports.object({
|
|
23019
|
-
peerId: remotePeerIdSchema,
|
|
23020
|
-
parentPath: external_exports.string().min(1).max(8192),
|
|
23021
|
-
name: external_exports.string().min(1).max(255).refine((value) => value.trim().length > 0, "Directory name cannot be blank")
|
|
23183
|
+
|
|
23184
|
+
// ../shared-contracts/dist/remote-connections.js
|
|
23185
|
+
var CONSOLE_REMOTE_CONNECTIONS_METHOD = "codexhost/console/remote-connections";
|
|
23186
|
+
var hostId = external_exports.string().min(1).max(1024);
|
|
23187
|
+
var codexSshConnectionSchema = external_exports.object({
|
|
23188
|
+
hostId,
|
|
23189
|
+
displayName: external_exports.string().min(1).max(1024),
|
|
23190
|
+
source: external_exports.enum(["codex-managed", "discovered"]),
|
|
23191
|
+
sshAlias: external_exports.string().max(1024).nullable(),
|
|
23192
|
+
sshHost: external_exports.string().min(1).max(1024),
|
|
23193
|
+
sshPort: external_exports.number().int().min(1).max(65535).nullable(),
|
|
23194
|
+
identity: external_exports.string().max(4096).nullable(),
|
|
23195
|
+
autoConnect: external_exports.boolean(),
|
|
23196
|
+
connectionAnalyticsId: external_exports.string().max(1024).optional()
|
|
23022
23197
|
});
|
|
23023
|
-
var
|
|
23024
|
-
|
|
23025
|
-
|
|
23198
|
+
var codexSshDraftSchema = external_exports.strictObject({
|
|
23199
|
+
displayName: external_exports.string().min(1).max(1024),
|
|
23200
|
+
hostname: external_exports.string().min(1).max(1024),
|
|
23201
|
+
sshPort: external_exports.number().int().min(1).max(65535).nullable(),
|
|
23202
|
+
identity: external_exports.string().max(4096).nullable()
|
|
23026
23203
|
});
|
|
23027
|
-
var
|
|
23028
|
-
|
|
23029
|
-
|
|
23030
|
-
|
|
23204
|
+
var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
23205
|
+
external_exports.strictObject({ action: external_exports.literal("session"), operation: remoteSessionOperationSchema }),
|
|
23206
|
+
external_exports.strictObject({ action: external_exports.literal("list") }),
|
|
23207
|
+
external_exports.strictObject({ action: external_exports.literal("catalog") }),
|
|
23208
|
+
external_exports.strictObject({
|
|
23209
|
+
action: external_exports.literal("read-thread"),
|
|
23210
|
+
hostId: hostId.refine((id2) => id2 !== "local"),
|
|
23211
|
+
input: delegationReadParamsSchema
|
|
23212
|
+
}),
|
|
23213
|
+
external_exports.strictObject({
|
|
23214
|
+
action: external_exports.literal("save"),
|
|
23215
|
+
draft: codexSshDraftSchema,
|
|
23216
|
+
previous: codexSshConnectionSchema.nullable()
|
|
23217
|
+
}),
|
|
23218
|
+
external_exports.strictObject({ action: external_exports.literal("remove"), previous: codexSshConnectionSchema }),
|
|
23219
|
+
external_exports.strictObject({ action: external_exports.literal("connect"), hostId, enabled: external_exports.boolean() }),
|
|
23220
|
+
external_exports.strictObject({ action: external_exports.literal("state"), hostId }),
|
|
23221
|
+
external_exports.strictObject({ action: external_exports.literal("runtime"), hostId }),
|
|
23222
|
+
external_exports.strictObject({
|
|
23223
|
+
action: external_exports.literal("update"),
|
|
23224
|
+
hostId: hostId.refine((id2) => id2 !== "local"),
|
|
23225
|
+
version: remoteUpdateParamsSchema.shape.version
|
|
23226
|
+
})
|
|
23227
|
+
]);
|
|
23228
|
+
var remoteConnectionsReplySchema = external_exports.union([
|
|
23229
|
+
external_exports.strictObject({ result: jsonValueSchema }),
|
|
23230
|
+
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
23231
|
+
]);
|
|
23232
|
+
|
|
23233
|
+
// ../shared-contracts/dist/thread-title.js
|
|
23234
|
+
var threadTitleInputSchema = external_exports.strictObject({
|
|
23235
|
+
prompt: external_exports.string().trim().min(1).max(2e3),
|
|
23236
|
+
cwd: external_exports.string().max(4096).nullable()
|
|
23031
23237
|
});
|
|
23032
|
-
var
|
|
23033
|
-
|
|
23034
|
-
|
|
23035
|
-
|
|
23238
|
+
var threadTitleResultSchema = external_exports.string().trim().min(1).max(60).nullable();
|
|
23239
|
+
|
|
23240
|
+
// ../shared-contracts/dist/web-ui-extensions.js
|
|
23241
|
+
var webUiExtensionIdSchema = external_exports.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u);
|
|
23242
|
+
var localizedTextSchema2 = external_exports.union([
|
|
23243
|
+
external_exports.string(),
|
|
23244
|
+
external_exports.object({ en: external_exports.string() }).catchall(external_exports.string())
|
|
23245
|
+
]);
|
|
23246
|
+
var webUiExtensionMetaSchema = external_exports.object({
|
|
23247
|
+
title: localizedTextSchema2.optional(),
|
|
23248
|
+
description: localizedTextSchema2.optional(),
|
|
23249
|
+
icon: external_exports.string().max(Math.ceil(256 * 1024 / 3) * 4 + 64).regex(/^data:image\/(?:svg\+xml|png|jpeg|webp);base64,[A-Za-z0-9+/]*={0,2}$/u).optional(),
|
|
23250
|
+
error: external_exports.string().optional()
|
|
23036
23251
|
});
|
|
23037
|
-
var
|
|
23038
|
-
|
|
23039
|
-
|
|
23252
|
+
var webUiExtensionSchema = external_exports.object({
|
|
23253
|
+
id: webUiExtensionIdSchema,
|
|
23254
|
+
name: external_exports.string().min(1).max(214),
|
|
23255
|
+
version: external_exports.string().min(1).max(128),
|
|
23256
|
+
format: external_exports.literal("dsh"),
|
|
23257
|
+
supportedTargets: external_exports.tuple([external_exports.literal("web")]),
|
|
23258
|
+
enabledTargets: external_exports.array(external_exports.literal("web")).max(1),
|
|
23259
|
+
source: external_exports.string().min(1).max(4096),
|
|
23260
|
+
/** Public project page, derived from installed package metadata and its source. */
|
|
23261
|
+
projectUrl: external_exports.string().max(4096).url({ protocol: /^https?$/u }).optional(),
|
|
23262
|
+
installedAt: external_exports.string(),
|
|
23263
|
+
meta: webUiExtensionMetaSchema.optional(),
|
|
23264
|
+
loadError: external_exports.string().optional()
|
|
23040
23265
|
});
|
|
23041
|
-
var
|
|
23042
|
-
|
|
23043
|
-
|
|
23266
|
+
var webUiExtensionsStateSchema = external_exports.object({
|
|
23267
|
+
extensions: external_exports.array(webUiExtensionSchema),
|
|
23268
|
+
loadedIds: external_exports.array(webUiExtensionIdSchema),
|
|
23269
|
+
safeMode: external_exports.boolean(),
|
|
23270
|
+
storeError: external_exports.string().optional()
|
|
23044
23271
|
});
|
|
23272
|
+
var webUiExtensionRegistrySchema = external_exports.string().trim().max(2048).url({ protocol: /^https?$/u, normalize: true }).refine((value) => !/[\s\\?#]/u.test(value) && !value.split("/")[2]?.includes("@"), "Use an HTTP(S) registry URL without credentials, a query, or a fragment.").transform((value) => value.endsWith("/") ? value : `${value}/`);
|
|
23273
|
+
var webUiExtensionInstallSchema = external_exports.object({
|
|
23274
|
+
spec: external_exports.string().trim().min(1).max(4096),
|
|
23275
|
+
registry: webUiExtensionRegistrySchema.optional()
|
|
23276
|
+
}).strict();
|
|
23277
|
+
var webUiExtensionEnabledSchema = external_exports.object({ id: webUiExtensionIdSchema, enabled: external_exports.boolean() }).strict();
|
|
23278
|
+
var webUiExtensionRemoveSchema = external_exports.object({ id: webUiExtensionIdSchema }).strict();
|
|
23045
23279
|
|
|
23046
23280
|
// ../shared-contracts/dist/index.js
|
|
23047
23281
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
@@ -23659,6 +23893,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23659
23893
|
var CONTINUATION_PATTERN = /^[ \t]+(.+?)\s*$/u;
|
|
23660
23894
|
var ORDERED_ITEM_PATTERN = /^\d+[.)][ \t]+(.+?)\s*$/u;
|
|
23661
23895
|
var FENCE_PATTERN = /^```([\w+-]*)\s*$/u;
|
|
23896
|
+
var DETAILS_OPEN_PATTERN = /^<details(\s+open)?\s*>$/iu;
|
|
23897
|
+
var DETAILS_CLOSE_PATTERN = /^<\/details>\s*$/iu;
|
|
23898
|
+
var SUMMARY_LINE_PATTERN = /^<summary>(.*?)<\/summary>\s*$/iu;
|
|
23662
23899
|
var THEMATIC_BREAK_PATTERN = /^(?:---|___|\*\*\*)[ \t]*$/u;
|
|
23663
23900
|
var CJK_PATTERN = /[\u3040-\u30ff\u3400-\u9fff\uac00-\ud7af]/u;
|
|
23664
23901
|
var INLINE_PATTERN = /(`+)((?:(?!\1).)+)\1|\*\*(.+?)\*\*|\[([^\]]+)\]\(([^)\s]+)\)/gu;
|
|
@@ -23682,6 +23919,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23682
23919
|
index = appendFencedCode(document2, root, lines, index, fence[1] ?? "");
|
|
23683
23920
|
continue;
|
|
23684
23921
|
}
|
|
23922
|
+
const detailsOpen = DETAILS_OPEN_PATTERN.exec(line.trim());
|
|
23923
|
+
if (detailsOpen) {
|
|
23924
|
+
index = appendDetails(document2, root, lines, index, Boolean(detailsOpen[1]));
|
|
23925
|
+
continue;
|
|
23926
|
+
}
|
|
23685
23927
|
const heading = HEADING_PATTERN.exec(line);
|
|
23686
23928
|
if (heading?.[1] && heading[2]) {
|
|
23687
23929
|
const tag = `h${heading[1].length}`;
|
|
@@ -23711,6 +23953,52 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23711
23953
|
index = appendParagraph(document2, root, lines, index);
|
|
23712
23954
|
}
|
|
23713
23955
|
}
|
|
23956
|
+
function appendDetails(document2, root, lines, start, open2) {
|
|
23957
|
+
let depth = 1;
|
|
23958
|
+
let index = start + 1;
|
|
23959
|
+
const innerLines = [];
|
|
23960
|
+
while (index < lines.length && depth > 0) {
|
|
23961
|
+
const current = lines[index] ?? "";
|
|
23962
|
+
const trimmed = current.trim();
|
|
23963
|
+
if (DETAILS_OPEN_PATTERN.test(trimmed)) {
|
|
23964
|
+
depth += 1;
|
|
23965
|
+
innerLines.push(current);
|
|
23966
|
+
} else if (DETAILS_CLOSE_PATTERN.test(trimmed)) {
|
|
23967
|
+
depth -= 1;
|
|
23968
|
+
if (depth > 0) innerLines.push(current);
|
|
23969
|
+
} else {
|
|
23970
|
+
innerLines.push(current);
|
|
23971
|
+
}
|
|
23972
|
+
index += 1;
|
|
23973
|
+
}
|
|
23974
|
+
let summaryText = "Details";
|
|
23975
|
+
const bodyLines = [];
|
|
23976
|
+
let foundSummary = false;
|
|
23977
|
+
for (const innerLine of innerLines) {
|
|
23978
|
+
if (!foundSummary && innerLine.trim().length === 0) continue;
|
|
23979
|
+
if (!foundSummary) {
|
|
23980
|
+
const summaryMatch = SUMMARY_LINE_PATTERN.exec(innerLine.trim());
|
|
23981
|
+
if (summaryMatch) {
|
|
23982
|
+
summaryText = summaryMatch[1]?.trim() || "Details";
|
|
23983
|
+
foundSummary = true;
|
|
23984
|
+
continue;
|
|
23985
|
+
}
|
|
23986
|
+
foundSummary = true;
|
|
23987
|
+
}
|
|
23988
|
+
bodyLines.push(innerLine);
|
|
23989
|
+
}
|
|
23990
|
+
const details = document2.createElement("details");
|
|
23991
|
+
if (open2) details.setAttribute("open", "");
|
|
23992
|
+
const summary = document2.createElement("summary");
|
|
23993
|
+
appendInline(document2, summary, summaryText);
|
|
23994
|
+
details.append(summary);
|
|
23995
|
+
const body = document2.createElement("div");
|
|
23996
|
+
body.className = "settings-update-notes-details-body";
|
|
23997
|
+
appendReleaseNotesBlocks(document2, body, bodyLines.join("\n"));
|
|
23998
|
+
details.append(body);
|
|
23999
|
+
root.append(details);
|
|
24000
|
+
return index;
|
|
24001
|
+
}
|
|
23714
24002
|
function appendFencedCode(document2, root, lines, start, language) {
|
|
23715
24003
|
const body = [];
|
|
23716
24004
|
let index = start + 1;
|
|
@@ -23775,7 +24063,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
23775
24063
|
let index = start;
|
|
23776
24064
|
while (index < lines.length) {
|
|
23777
24065
|
const current = lines[index] ?? "";
|
|
23778
|
-
if (current.trim().length === 0 || FENCE_PATTERN.test(current) || HEADING_PATTERN.test(current) || BLOCKQUOTE_PATTERN.test(current) || THEMATIC_BREAK_PATTERN.test(current) || UNORDERED_ITEM_PATTERN.test(current) || ORDERED_ITEM_PATTERN.test(current)) {
|
|
24066
|
+
if (current.trim().length === 0 || FENCE_PATTERN.test(current) || DETAILS_OPEN_PATTERN.test(current.trim()) || DETAILS_CLOSE_PATTERN.test(current.trim()) || HEADING_PATTERN.test(current) || BLOCKQUOTE_PATTERN.test(current) || THEMATIC_BREAK_PATTERN.test(current) || UNORDERED_ITEM_PATTERN.test(current) || ORDERED_ITEM_PATTERN.test(current)) {
|
|
23779
24067
|
break;
|
|
23780
24068
|
}
|
|
23781
24069
|
paragraphLines.push(current.trim());
|
|
@@ -27119,6 +27407,11 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
27119
27407
|
const result = await manager.sendRequest(THREAD_FORK_METHOD, params);
|
|
27120
27408
|
return externalThreadForkResultSchema.parse(result);
|
|
27121
27409
|
},
|
|
27410
|
+
async handoffThread(input3) {
|
|
27411
|
+
const params = threadHandoffParamsSchema.parse(input3);
|
|
27412
|
+
const result = await manager.sendRequest(THREAD_HANDOFF_METHOD, params);
|
|
27413
|
+
return threadHandoffResultSchema.parse(result);
|
|
27414
|
+
},
|
|
27122
27415
|
inspectHarness,
|
|
27123
27416
|
async listSkills(params) {
|
|
27124
27417
|
return skillsListResultSchema.parse(
|
|
@@ -40521,18 +40814,20 @@ ${error62.stderrTail}`] : []
|
|
|
40521
40814
|
const renderActions = (extensionId, displayName, installed, catalogEntry, state) => {
|
|
40522
40815
|
if (!actionBar || !modalToggle) return;
|
|
40523
40816
|
const updateAvailable = hasCatalogUpdate(installed, catalogEntry);
|
|
40524
|
-
const
|
|
40817
|
+
const extAction = state.pendingMutations.get(extensionId) ?? null;
|
|
40818
|
+
const controlsDisabled = extAction !== null || state.globalBusy;
|
|
40525
40819
|
const nodes = [];
|
|
40526
40820
|
if (!installed && catalogEntry) {
|
|
40527
40821
|
const installButton = createEl(
|
|
40528
40822
|
document2,
|
|
40529
40823
|
"button",
|
|
40530
40824
|
"settings-command-button",
|
|
40531
|
-
|
|
40825
|
+
extAction === "install" ? copy.installing : copy.install
|
|
40532
40826
|
);
|
|
40533
40827
|
installButton.type = "button";
|
|
40534
40828
|
installButton.dataset.action = "install";
|
|
40535
|
-
installButton.
|
|
40829
|
+
installButton.setAttribute("aria-busy", String(extAction === "install"));
|
|
40830
|
+
installButton.disabled = controlsDisabled || !state.canInstall;
|
|
40536
40831
|
installButton.addEventListener("click", () => {
|
|
40537
40832
|
if (!installButton.disabled) onInstall?.(catalogEntry, false);
|
|
40538
40833
|
});
|
|
@@ -40552,11 +40847,12 @@ ${error62.stderrTail}`] : []
|
|
|
40552
40847
|
document2,
|
|
40553
40848
|
"button",
|
|
40554
40849
|
"settings-command-button",
|
|
40555
|
-
|
|
40850
|
+
extAction === "update" ? copy.updating : formatMessage(copy.updateToVersion, { version: catalogEntry.version })
|
|
40556
40851
|
);
|
|
40557
40852
|
updateButton.type = "button";
|
|
40558
40853
|
updateButton.dataset.action = "update";
|
|
40559
|
-
updateButton.
|
|
40854
|
+
updateButton.setAttribute("aria-busy", String(extAction === "update"));
|
|
40855
|
+
updateButton.disabled = controlsDisabled || !state.canInstall;
|
|
40560
40856
|
updateButton.addEventListener("click", () => {
|
|
40561
40857
|
if (!updateButton.disabled) onInstall?.(catalogEntry, true);
|
|
40562
40858
|
});
|
|
@@ -40564,7 +40860,7 @@ ${error62.stderrTail}`] : []
|
|
|
40564
40860
|
}
|
|
40565
40861
|
const blocked = isToggleBlocked(installed);
|
|
40566
40862
|
modalToggle.checked = installed.enabled;
|
|
40567
|
-
modalToggle.disabled =
|
|
40863
|
+
modalToggle.disabled = controlsDisabled || blocked;
|
|
40568
40864
|
modalToggle.setAttribute(
|
|
40569
40865
|
"aria-label",
|
|
40570
40866
|
formatMessage(copy.toggleLabel, { name: displayName })
|
|
@@ -40575,7 +40871,7 @@ ${error62.stderrTail}`] : []
|
|
|
40575
40871
|
const openPageButton = createEl(document2, "button", "settings-command-button");
|
|
40576
40872
|
openPageButton.type = "button";
|
|
40577
40873
|
openPageButton.dataset.action = "open-page";
|
|
40578
|
-
openPageButton.disabled =
|
|
40874
|
+
openPageButton.disabled = controlsDisabled;
|
|
40579
40875
|
openPageButton.append(
|
|
40580
40876
|
createRendererSettingsIcon("external-link", 13),
|
|
40581
40877
|
createEl(document2, "span", "", copy.openPage)
|
|
@@ -40595,7 +40891,7 @@ ${error62.stderrTail}`] : []
|
|
|
40595
40891
|
);
|
|
40596
40892
|
openSettingsButton.type = "button";
|
|
40597
40893
|
openSettingsButton.dataset.action = "open-settings";
|
|
40598
|
-
openSettingsButton.disabled =
|
|
40894
|
+
openSettingsButton.disabled = controlsDisabled;
|
|
40599
40895
|
openSettingsButton.append(
|
|
40600
40896
|
createRendererSettingsIcon("settings", 13),
|
|
40601
40897
|
createEl(document2, "span", "", copy.openExtensionSettings)
|
|
@@ -40624,11 +40920,12 @@ ${error62.stderrTail}`] : []
|
|
|
40624
40920
|
document2,
|
|
40625
40921
|
"button",
|
|
40626
40922
|
"settings-command-button settings-command-button--secondary settings-command-button--danger",
|
|
40627
|
-
|
|
40923
|
+
extAction === "uninstall" ? copy.uninstalling : copy.uninstallConfirm
|
|
40628
40924
|
);
|
|
40629
40925
|
confirmButton.type = "button";
|
|
40630
40926
|
confirmButton.dataset.action = "confirm-uninstall";
|
|
40631
|
-
confirmButton.
|
|
40927
|
+
confirmButton.setAttribute("aria-busy", String(extAction === "uninstall"));
|
|
40928
|
+
confirmButton.disabled = controlsDisabled;
|
|
40632
40929
|
confirmButton.addEventListener("click", () => {
|
|
40633
40930
|
if (!confirmButton.disabled) onUninstall?.(installed);
|
|
40634
40931
|
});
|
|
@@ -40640,9 +40937,9 @@ ${error62.stderrTail}`] : []
|
|
|
40640
40937
|
);
|
|
40641
40938
|
cancelButton.type = "button";
|
|
40642
40939
|
cancelButton.dataset.action = "cancel-uninstall";
|
|
40643
|
-
cancelButton.disabled =
|
|
40940
|
+
cancelButton.disabled = controlsDisabled;
|
|
40644
40941
|
cancelButton.addEventListener("click", () => {
|
|
40645
|
-
if (
|
|
40942
|
+
if (controlsDisabled) return;
|
|
40646
40943
|
confirmingUninstall = false;
|
|
40647
40944
|
if (currentState) {
|
|
40648
40945
|
renderContent(extensionId, currentItem, currentCatalogEntry, currentState);
|
|
@@ -40658,13 +40955,13 @@ ${error62.stderrTail}`] : []
|
|
|
40658
40955
|
);
|
|
40659
40956
|
uninstallButton.type = "button";
|
|
40660
40957
|
uninstallButton.dataset.action = "uninstall";
|
|
40661
|
-
uninstallButton.disabled =
|
|
40958
|
+
uninstallButton.disabled = controlsDisabled;
|
|
40662
40959
|
uninstallButton.append(
|
|
40663
40960
|
createRendererSettingsIcon("trash", 13),
|
|
40664
40961
|
createEl(document2, "span", "", copy.uninstall)
|
|
40665
40962
|
);
|
|
40666
40963
|
uninstallButton.addEventListener("click", () => {
|
|
40667
|
-
if (
|
|
40964
|
+
if (controlsDisabled) return;
|
|
40668
40965
|
confirmingUninstall = true;
|
|
40669
40966
|
if (currentState) {
|
|
40670
40967
|
renderContent(extensionId, currentItem, currentCatalogEntry, currentState);
|
|
@@ -40697,7 +40994,7 @@ ${error62.stderrTail}`] : []
|
|
|
40697
40994
|
} else {
|
|
40698
40995
|
delete dialog.dataset.extensionState;
|
|
40699
40996
|
}
|
|
40700
|
-
if (state.
|
|
40997
|
+
if (state.pendingMutations.has(extensionId)) dialog.dataset.busy = "true";
|
|
40701
40998
|
else delete dialog.dataset.busy;
|
|
40702
40999
|
const categories = (installed?.state === "valid" ? installed.manifest.categories : void 0) ?? catalogEntry?.categories;
|
|
40703
41000
|
const iconUrl = resolveInstalledExtensionIconUrl(installed, catalogEntry);
|
|
@@ -40982,7 +41279,8 @@ ${error62.stderrTail}`] : []
|
|
|
40982
41279
|
modalToggle.addEventListener("change", () => {
|
|
40983
41280
|
if (!currentItem || !modalToggle) return;
|
|
40984
41281
|
const desired = modalToggle.checked;
|
|
40985
|
-
|
|
41282
|
+
const isBusyThis = currentState?.globalBusy || Boolean(currentState?.pendingMutations.has(currentItem.id));
|
|
41283
|
+
if (isBusyThis || isToggleBlocked(currentItem)) {
|
|
40986
41284
|
modalToggle.checked = currentItem.enabled;
|
|
40987
41285
|
return;
|
|
40988
41286
|
}
|
|
@@ -41583,9 +41881,8 @@ ${error62.stderrTail}`] : []
|
|
|
41583
41881
|
visibleEntries,
|
|
41584
41882
|
installedById,
|
|
41585
41883
|
canInstall,
|
|
41586
|
-
|
|
41587
|
-
|
|
41588
|
-
activeMutationAction,
|
|
41884
|
+
pendingMutations,
|
|
41885
|
+
globalBusy,
|
|
41589
41886
|
onOpenDetails,
|
|
41590
41887
|
onInstall,
|
|
41591
41888
|
onViewInstalled
|
|
@@ -41598,22 +41895,26 @@ ${error62.stderrTail}`] : []
|
|
|
41598
41895
|
const installed = installedById.get(entry.id);
|
|
41599
41896
|
const updateAvailable = hasCatalogUpdate(installed, entry);
|
|
41600
41897
|
const installState = installed ? updateAvailable ? "update" : "installed" : "available";
|
|
41601
|
-
const
|
|
41898
|
+
const entryAction = pendingMutations.get(entry.id) ?? null;
|
|
41899
|
+
const isBusyCard = entryAction !== null;
|
|
41900
|
+
const controlsDisabled = isBusyCard || globalBusy;
|
|
41602
41901
|
const actionButton = createEl(document2, "button");
|
|
41603
41902
|
actionButton.type = "button";
|
|
41604
41903
|
actionButton.dataset.extensionId = entry.id;
|
|
41605
41904
|
if (installState === "available") {
|
|
41606
41905
|
actionButton.className = "settings-command-button settings-extensions-card__button";
|
|
41607
41906
|
actionButton.dataset.action = "install";
|
|
41608
|
-
const installingThis =
|
|
41907
|
+
const installingThis = entryAction === "install";
|
|
41609
41908
|
actionButton.textContent = installingThis ? copy.installing : copy.install;
|
|
41610
|
-
actionButton.
|
|
41909
|
+
actionButton.setAttribute("aria-busy", String(installingThis));
|
|
41910
|
+
actionButton.disabled = controlsDisabled || !canInstall;
|
|
41611
41911
|
} else if (installState === "update") {
|
|
41612
41912
|
actionButton.className = "settings-command-button settings-extensions-card__button settings-extensions-card__button--update";
|
|
41613
41913
|
actionButton.dataset.action = "update";
|
|
41614
|
-
const updatingThis =
|
|
41914
|
+
const updatingThis = entryAction === "update";
|
|
41615
41915
|
actionButton.textContent = updatingThis ? copy.updating : copy.update;
|
|
41616
|
-
actionButton.
|
|
41916
|
+
actionButton.setAttribute("aria-busy", String(updatingThis));
|
|
41917
|
+
actionButton.disabled = controlsDisabled || !canInstall;
|
|
41617
41918
|
} else {
|
|
41618
41919
|
actionButton.className = "settings-command-button settings-command-button--secondary settings-extensions-card__button settings-extensions-card__button--installed";
|
|
41619
41920
|
actionButton.dataset.action = "installed";
|
|
@@ -41621,7 +41922,7 @@ ${error62.stderrTail}`] : []
|
|
|
41621
41922
|
createRendererSettingsIcon("check", 12),
|
|
41622
41923
|
createEl(document2, "span", "", copy.installedBadge)
|
|
41623
41924
|
);
|
|
41624
|
-
actionButton.disabled =
|
|
41925
|
+
actionButton.disabled = controlsDisabled;
|
|
41625
41926
|
}
|
|
41626
41927
|
actionButton.addEventListener("click", (event) => {
|
|
41627
41928
|
event.stopPropagation?.();
|
|
@@ -41934,16 +42235,18 @@ ${error62.stderrTail}`] : []
|
|
|
41934
42235
|
let loading = false;
|
|
41935
42236
|
let catalogLoading = false;
|
|
41936
42237
|
let catalogRequestToken = 0;
|
|
41937
|
-
let
|
|
41938
|
-
|
|
41939
|
-
let
|
|
42238
|
+
let listApplyToken = 0;
|
|
42239
|
+
const pendingMutations = /* @__PURE__ */ new Map();
|
|
42240
|
+
let importing = false;
|
|
42241
|
+
let recovering = false;
|
|
42242
|
+
let toggleQueue = Promise.resolve();
|
|
41940
42243
|
let pollTimer;
|
|
41941
42244
|
let activeRecoveryDialog = null;
|
|
41942
42245
|
let selectedCapability = "all";
|
|
41943
42246
|
let selectedCategory = null;
|
|
41944
42247
|
let searchQuery = "";
|
|
41945
|
-
let
|
|
41946
|
-
|
|
42248
|
+
let modalFeedback = null;
|
|
42249
|
+
const hasPendingMutations = () => pendingMutations.size > 0 || importing || recovering;
|
|
41947
42250
|
const clientCapabilities = () => {
|
|
41948
42251
|
const client = resolveAvailableClient(getClient);
|
|
41949
42252
|
return {
|
|
@@ -42002,10 +42305,9 @@ ${error62.stderrTail}`] : []
|
|
|
42002
42305
|
unavailable,
|
|
42003
42306
|
canInstall,
|
|
42004
42307
|
canUninstall,
|
|
42005
|
-
|
|
42006
|
-
|
|
42007
|
-
|
|
42008
|
-
feedback: modalFeedbackExtensionId !== null && modalFeedbackExtensionId === detailModal.extensionId ? currentFeedback : null
|
|
42308
|
+
pendingMutations: new Map(pendingMutations),
|
|
42309
|
+
globalBusy: recovering,
|
|
42310
|
+
feedback: modalFeedback !== null && modalFeedback.extensionId === detailModal.extensionId ? modalFeedback.feedback : null
|
|
42009
42311
|
};
|
|
42010
42312
|
};
|
|
42011
42313
|
const detailModal = createDesktopExtensionDetailModal({
|
|
@@ -42046,7 +42348,7 @@ ${error62.stderrTail}`] : []
|
|
|
42046
42348
|
if (pageId) context.navigateToPage?.(pageId);
|
|
42047
42349
|
} : void 0,
|
|
42048
42350
|
onClose: () => {
|
|
42049
|
-
|
|
42351
|
+
modalFeedback = null;
|
|
42050
42352
|
}
|
|
42051
42353
|
});
|
|
42052
42354
|
const createModal = createDesktopExtensionCreateModal({
|
|
@@ -42066,8 +42368,10 @@ ${error62.stderrTail}`] : []
|
|
|
42066
42368
|
}
|
|
42067
42369
|
});
|
|
42068
42370
|
const setFeedback = (next, modalExtensionId = null) => {
|
|
42069
|
-
|
|
42070
|
-
|
|
42371
|
+
if (modalExtensionId !== null) {
|
|
42372
|
+
modalFeedback = next ? { extensionId: modalExtensionId, feedback: next } : null;
|
|
42373
|
+
return;
|
|
42374
|
+
}
|
|
42071
42375
|
if (!next) {
|
|
42072
42376
|
banner.hidden = true;
|
|
42073
42377
|
bannerText.textContent = "";
|
|
@@ -42086,14 +42390,13 @@ ${error62.stderrTail}`] : []
|
|
|
42086
42390
|
};
|
|
42087
42391
|
const syncToolbarState = () => {
|
|
42088
42392
|
const activeLoading = activeTab === "installed" ? loading : catalogLoading;
|
|
42089
|
-
|
|
42090
|
-
refreshButton.disabled = busy;
|
|
42393
|
+
refreshButton.disabled = activeLoading || recovering;
|
|
42091
42394
|
refreshButton.setAttribute("aria-busy", String(activeLoading));
|
|
42092
42395
|
refreshButton.title = activeLoading ? copy.refreshing : copy.refresh;
|
|
42093
42396
|
refreshButton.setAttribute("aria-label", activeLoading ? copy.refreshing : copy.refresh);
|
|
42094
42397
|
const { canInstall, canRecover } = clientCapabilities();
|
|
42095
|
-
importButton.disabled =
|
|
42096
|
-
recoveryMenuItem.disabled =
|
|
42398
|
+
importButton.disabled = importing || recovering || !canInstall;
|
|
42399
|
+
recoveryMenuItem.disabled = hasPendingMutations() || !canRecover;
|
|
42097
42400
|
installedTabLabel.textContent = formatMessage(copy.tabInstalled, {
|
|
42098
42401
|
count: String(listing?.extensions.length ?? 0)
|
|
42099
42402
|
});
|
|
@@ -42272,7 +42575,7 @@ ${error62.stderrTail}`] : []
|
|
|
42272
42575
|
}
|
|
42273
42576
|
closeHeaderMenus();
|
|
42274
42577
|
if (detailModal.extensionId !== extensionId) {
|
|
42275
|
-
|
|
42578
|
+
modalFeedback = null;
|
|
42276
42579
|
}
|
|
42277
42580
|
detailModal.open(extensionId, buildDetailModalState());
|
|
42278
42581
|
};
|
|
@@ -42283,10 +42586,13 @@ ${error62.stderrTail}`] : []
|
|
|
42283
42586
|
const errorId = preferenceId(`host-ext-error-${item.id}`);
|
|
42284
42587
|
const blocked = isToggleBlocked(item);
|
|
42285
42588
|
const statusState = itemStatusState(item);
|
|
42589
|
+
const extAction = pendingMutations.get(item.id) ?? null;
|
|
42590
|
+
const isExtBusy = extAction !== null;
|
|
42591
|
+
const controlsDisabled = isExtBusy || recovering;
|
|
42286
42592
|
const toggle = createPreferenceSwitch(document2, switchId, errorId);
|
|
42287
42593
|
toggle.checked = item.enabled;
|
|
42288
42594
|
toggle.setAttribute("aria-label", formatMessage(copy.toggleLabel, { name: displayName }));
|
|
42289
|
-
toggle.disabled =
|
|
42595
|
+
toggle.disabled = controlsDisabled || blocked;
|
|
42290
42596
|
if (blocked) {
|
|
42291
42597
|
toggle.title = blockedToggleReason(item, copy);
|
|
42292
42598
|
}
|
|
@@ -42297,7 +42603,7 @@ ${error62.stderrTail}`] : []
|
|
|
42297
42603
|
toggle.addEventListener("keydown", stopTrigger);
|
|
42298
42604
|
toggle.addEventListener("change", () => {
|
|
42299
42605
|
const desired = toggle.checked;
|
|
42300
|
-
if (
|
|
42606
|
+
if (recovering || pendingMutations.has(item.id) || blocked) {
|
|
42301
42607
|
toggle.checked = item.enabled;
|
|
42302
42608
|
return;
|
|
42303
42609
|
}
|
|
@@ -42314,7 +42620,7 @@ ${error62.stderrTail}`] : []
|
|
|
42314
42620
|
btn.type = "button";
|
|
42315
42621
|
btn.dataset.action = "open-page";
|
|
42316
42622
|
btn.dataset.extensionId = item.id;
|
|
42317
|
-
btn.disabled =
|
|
42623
|
+
btn.disabled = controlsDisabled;
|
|
42318
42624
|
btn.addEventListener("click", (event) => {
|
|
42319
42625
|
event.stopPropagation?.();
|
|
42320
42626
|
if (!btn.disabled) openExtensionPage(item);
|
|
@@ -42324,7 +42630,7 @@ ${error62.stderrTail}`] : []
|
|
|
42324
42630
|
}
|
|
42325
42631
|
let update;
|
|
42326
42632
|
if (catalogEntry && hasCatalogUpdate(item, catalogEntry)) {
|
|
42327
|
-
const updating =
|
|
42633
|
+
const updating = extAction === "update";
|
|
42328
42634
|
const button2 = createEl(
|
|
42329
42635
|
document2,
|
|
42330
42636
|
"button",
|
|
@@ -42334,7 +42640,7 @@ ${error62.stderrTail}`] : []
|
|
|
42334
42640
|
button2.type = "button";
|
|
42335
42641
|
button2.dataset.action = "update";
|
|
42336
42642
|
button2.setAttribute("aria-busy", String(updating));
|
|
42337
|
-
button2.disabled =
|
|
42643
|
+
button2.disabled = controlsDisabled || !canUpdate;
|
|
42338
42644
|
button2.addEventListener("click", () => {
|
|
42339
42645
|
if (!button2.disabled) void installFromCatalog(catalogEntry, true);
|
|
42340
42646
|
});
|
|
@@ -42368,7 +42674,7 @@ ${error62.stderrTail}`] : []
|
|
|
42368
42674
|
capabilityBadges: deriveCapabilityBadges(itemCapabilities(item), copy),
|
|
42369
42675
|
secondaryAction: openPageButton,
|
|
42370
42676
|
actionControl: toggle,
|
|
42371
|
-
busy:
|
|
42677
|
+
busy: isExtBusy,
|
|
42372
42678
|
dataset: {
|
|
42373
42679
|
extensionState: statusState,
|
|
42374
42680
|
trustTier: catalogEntry?.trustTier
|
|
@@ -42505,7 +42811,7 @@ ${error62.stderrTail}`] : []
|
|
|
42505
42811
|
{
|
|
42506
42812
|
label: copy.retry,
|
|
42507
42813
|
onClick: () => {
|
|
42508
|
-
if (!catalogLoading && !
|
|
42814
|
+
if (!catalogLoading && !recovering) {
|
|
42509
42815
|
void loadCatalog({ forceRefresh: true, silent: false });
|
|
42510
42816
|
}
|
|
42511
42817
|
}
|
|
@@ -42520,9 +42826,9 @@ ${error62.stderrTail}`] : []
|
|
|
42520
42826
|
document2,
|
|
42521
42827
|
messages,
|
|
42522
42828
|
catalog,
|
|
42523
|
-
catalogLoading ||
|
|
42829
|
+
catalogLoading || recovering,
|
|
42524
42830
|
() => {
|
|
42525
|
-
if (!catalogLoading && !
|
|
42831
|
+
if (!catalogLoading && !recovering) {
|
|
42526
42832
|
void loadCatalog({ forceRefresh: true, silent: false });
|
|
42527
42833
|
}
|
|
42528
42834
|
},
|
|
@@ -42584,9 +42890,8 @@ ${error62.stderrTail}`] : []
|
|
|
42584
42890
|
visibleEntries,
|
|
42585
42891
|
installedById,
|
|
42586
42892
|
canInstall,
|
|
42587
|
-
|
|
42588
|
-
|
|
42589
|
-
activeMutationAction,
|
|
42893
|
+
pendingMutations,
|
|
42894
|
+
globalBusy: recovering,
|
|
42590
42895
|
onOpenDetails: openDetailModal,
|
|
42591
42896
|
onInstall: (entry, isUpdate) => {
|
|
42592
42897
|
void installFromCatalog(entry, isUpdate);
|
|
@@ -42602,7 +42907,7 @@ ${error62.stderrTail}`] : []
|
|
|
42602
42907
|
render();
|
|
42603
42908
|
},
|
|
42604
42909
|
onRetryCatalog: () => {
|
|
42605
|
-
if (!catalogLoading && !
|
|
42910
|
+
if (!catalogLoading && !recovering) {
|
|
42606
42911
|
void loadCatalog({ forceRefresh: true, silent: false });
|
|
42607
42912
|
}
|
|
42608
42913
|
}
|
|
@@ -42638,14 +42943,16 @@ ${error62.stderrTail}`] : []
|
|
|
42638
42943
|
clearPollTimer();
|
|
42639
42944
|
if (disposed || context.signal.aborted || document2.visibilityState === "hidden") return;
|
|
42640
42945
|
pollTimer = setTimeout(() => {
|
|
42641
|
-
if (disposed || context.signal.aborted ||
|
|
42946
|
+
if (disposed || context.signal.aborted || hasPendingMutations() || loading || activeRecoveryDialog || importModal.isOpen) {
|
|
42642
42947
|
schedulePoll();
|
|
42643
42948
|
return;
|
|
42644
42949
|
}
|
|
42645
42950
|
void loadInstalled({ silent: true });
|
|
42646
42951
|
}, POLL_INTERVAL_MS2);
|
|
42647
42952
|
};
|
|
42648
|
-
const applyLoadedList = (result) => {
|
|
42953
|
+
const applyLoadedList = (result, token) => {
|
|
42954
|
+
if (token !== void 0 && token !== listApplyToken) return false;
|
|
42955
|
+
if (token === void 0) listApplyToken += 1;
|
|
42649
42956
|
const hadOpenPageId = pageHost.extensionId;
|
|
42650
42957
|
listing = result;
|
|
42651
42958
|
pluginPages?.syncInstalledExtensions?.(result.extensions, result.configuration.revision);
|
|
@@ -42653,6 +42960,18 @@ ${error62.stderrTail}`] : []
|
|
|
42653
42960
|
if (hadOpenPageId && !pageHost.isOpen) {
|
|
42654
42961
|
setFeedback({ tone: "info", text: copy.pageClosedDisabled });
|
|
42655
42962
|
}
|
|
42963
|
+
return true;
|
|
42964
|
+
};
|
|
42965
|
+
const refreshInstalledAfterMutation = async () => {
|
|
42966
|
+
const client = resolveAvailableClient(getClient);
|
|
42967
|
+
if (!client?.listHostExtensions) return;
|
|
42968
|
+
const token = ++listApplyToken;
|
|
42969
|
+
try {
|
|
42970
|
+
const refreshed = await client.listHostExtensions();
|
|
42971
|
+
if (disposed || context.signal.aborted) return;
|
|
42972
|
+
applyLoadedList(refreshed, token);
|
|
42973
|
+
} catch {
|
|
42974
|
+
}
|
|
42656
42975
|
};
|
|
42657
42976
|
const loadInstalled = async (options = {}) => {
|
|
42658
42977
|
const silent = options.silent ?? false;
|
|
@@ -42673,17 +42992,23 @@ ${error62.stderrTail}`] : []
|
|
|
42673
42992
|
render();
|
|
42674
42993
|
}
|
|
42675
42994
|
const listHostExtensions = client.listHostExtensions.bind(client);
|
|
42995
|
+
const token = ++listApplyToken;
|
|
42676
42996
|
await context.runLatest(async () => listHostExtensions(), {
|
|
42677
42997
|
success(result) {
|
|
42678
42998
|
loading = false;
|
|
42679
42999
|
unavailable = false;
|
|
42680
|
-
applyLoadedList(result);
|
|
42681
|
-
if (!keepFeedback) setFeedback(null);
|
|
43000
|
+
const applied = applyLoadedList(result, token);
|
|
43001
|
+
if (applied && !keepFeedback) setFeedback(null);
|
|
42682
43002
|
render();
|
|
42683
43003
|
schedulePoll();
|
|
42684
43004
|
},
|
|
42685
43005
|
failure(error62) {
|
|
42686
43006
|
loading = false;
|
|
43007
|
+
if (token !== listApplyToken) {
|
|
43008
|
+
render();
|
|
43009
|
+
schedulePoll();
|
|
43010
|
+
return;
|
|
43011
|
+
}
|
|
42687
43012
|
if (error62 instanceof RendererMethodUnavailableError) {
|
|
42688
43013
|
unavailable = true;
|
|
42689
43014
|
listing = null;
|
|
@@ -42754,7 +43079,8 @@ ${error62.stderrTail}`] : []
|
|
|
42754
43079
|
}
|
|
42755
43080
|
};
|
|
42756
43081
|
const installFromCatalog = async (entry, isUpdate) => {
|
|
42757
|
-
if (
|
|
43082
|
+
if (recovering || pendingMutations.has(entry.id) || disposed || context.signal.aborted)
|
|
43083
|
+
return;
|
|
42758
43084
|
const client = resolveAvailableClient(getClient);
|
|
42759
43085
|
const installedItem = listing?.extensions.find((item) => item.id === entry.id);
|
|
42760
43086
|
const canUpdate = isUpdate && installedItem?.state === "valid" && Boolean(client?.updateHostExtension);
|
|
@@ -42762,10 +43088,7 @@ ${error62.stderrTail}`] : []
|
|
|
42762
43088
|
const update = client?.updateHostExtension?.bind(client);
|
|
42763
43089
|
if (!canUpdate && !install) return;
|
|
42764
43090
|
const fallbackName = catalogDisplayName(entry, messages.locale);
|
|
42765
|
-
|
|
42766
|
-
mutating = true;
|
|
42767
|
-
activeMutationId = entry.id;
|
|
42768
|
-
activeMutationAction = isUpdate ? "update" : "install";
|
|
43091
|
+
pendingMutations.set(entry.id, isUpdate ? "update" : "install");
|
|
42769
43092
|
clearPollTimer();
|
|
42770
43093
|
render();
|
|
42771
43094
|
try {
|
|
@@ -42786,6 +43109,7 @@ ${error62.stderrTail}`] : []
|
|
|
42786
43109
|
}
|
|
42787
43110
|
if (disposed || context.signal.aborted) return;
|
|
42788
43111
|
const displayName = result.manifest.name[messages.locale] || result.manifest.name.en || fallbackName;
|
|
43112
|
+
const modalTargetId = detailModal.extensionId === entry.id ? entry.id : null;
|
|
42789
43113
|
setFeedback(
|
|
42790
43114
|
{
|
|
42791
43115
|
tone: "success",
|
|
@@ -42796,14 +43120,10 @@ ${error62.stderrTail}`] : []
|
|
|
42796
43120
|
},
|
|
42797
43121
|
modalTargetId
|
|
42798
43122
|
);
|
|
42799
|
-
|
|
42800
|
-
const refreshed = await client.listHostExtensions();
|
|
42801
|
-
if (!disposed && !context.signal.aborted) {
|
|
42802
|
-
applyLoadedList(refreshed);
|
|
42803
|
-
}
|
|
42804
|
-
}
|
|
43123
|
+
await refreshInstalledAfterMutation();
|
|
42805
43124
|
} catch (error62) {
|
|
42806
43125
|
if (disposed || context.signal.aborted) return;
|
|
43126
|
+
const modalTargetId = detailModal.extensionId === entry.id ? entry.id : null;
|
|
42807
43127
|
setFeedback(
|
|
42808
43128
|
{
|
|
42809
43129
|
tone: "danger",
|
|
@@ -42812,24 +43132,21 @@ ${error62.stderrTail}`] : []
|
|
|
42812
43132
|
modalTargetId
|
|
42813
43133
|
);
|
|
42814
43134
|
} finally {
|
|
43135
|
+
pendingMutations.delete(entry.id);
|
|
42815
43136
|
if (!disposed && !context.signal.aborted) {
|
|
42816
|
-
mutating = false;
|
|
42817
|
-
activeMutationId = null;
|
|
42818
|
-
activeMutationAction = null;
|
|
42819
43137
|
render();
|
|
42820
|
-
schedulePoll();
|
|
43138
|
+
if (!hasPendingMutations()) schedulePoll();
|
|
42821
43139
|
}
|
|
42822
43140
|
}
|
|
42823
43141
|
};
|
|
42824
43142
|
const importExtension = async (source) => {
|
|
43143
|
+
if (importing || recovering) return;
|
|
42825
43144
|
const client = resolveAvailableClient(getClient);
|
|
42826
43145
|
const install = client?.installHostExtension?.bind(client);
|
|
42827
43146
|
if (!install) {
|
|
42828
43147
|
throw new Error(copy.importUnavailable);
|
|
42829
43148
|
}
|
|
42830
|
-
|
|
42831
|
-
activeMutationId = null;
|
|
42832
|
-
activeMutationAction = "install";
|
|
43149
|
+
importing = true;
|
|
42833
43150
|
clearPollTimer();
|
|
42834
43151
|
syncToolbarState();
|
|
42835
43152
|
try {
|
|
@@ -42849,32 +43166,23 @@ ${error62.stderrTail}`] : []
|
|
|
42849
43166
|
version: result.manifest.version
|
|
42850
43167
|
})
|
|
42851
43168
|
});
|
|
42852
|
-
|
|
42853
|
-
const refreshed = await client.listHostExtensions();
|
|
42854
|
-
if (!disposed && !context.signal.aborted) {
|
|
42855
|
-
applyLoadedList(refreshed);
|
|
42856
|
-
}
|
|
42857
|
-
}
|
|
43169
|
+
await refreshInstalledAfterMutation();
|
|
42858
43170
|
} finally {
|
|
43171
|
+
importing = false;
|
|
42859
43172
|
if (!disposed && !context.signal.aborted) {
|
|
42860
|
-
mutating = false;
|
|
42861
|
-
activeMutationId = null;
|
|
42862
|
-
activeMutationAction = null;
|
|
42863
43173
|
render();
|
|
42864
|
-
schedulePoll();
|
|
43174
|
+
if (!hasPendingMutations()) schedulePoll();
|
|
42865
43175
|
}
|
|
42866
43176
|
}
|
|
42867
43177
|
};
|
|
42868
43178
|
const uninstallExtension = async (item) => {
|
|
42869
|
-
if (
|
|
43179
|
+
if (recovering || pendingMutations.has(item.id) || disposed || context.signal.aborted)
|
|
43180
|
+
return;
|
|
42870
43181
|
const client = resolveAvailableClient(getClient);
|
|
42871
43182
|
const uninstall = client?.uninstallHostExtension?.bind(client);
|
|
42872
43183
|
if (!uninstall) return;
|
|
42873
43184
|
const displayName = extensionDisplayName(item, messages.locale);
|
|
42874
|
-
|
|
42875
|
-
mutating = true;
|
|
42876
|
-
activeMutationId = item.id;
|
|
42877
|
-
activeMutationAction = "uninstall";
|
|
43185
|
+
pendingMutations.set(item.id, "uninstall");
|
|
42878
43186
|
clearPollTimer();
|
|
42879
43187
|
render();
|
|
42880
43188
|
try {
|
|
@@ -42886,19 +43194,17 @@ ${error62.stderrTail}`] : []
|
|
|
42886
43194
|
if (pageHost.extensionId === item.id) {
|
|
42887
43195
|
pageHost.close();
|
|
42888
43196
|
}
|
|
42889
|
-
detailModal.
|
|
43197
|
+
if (detailModal.extensionId === item.id) {
|
|
43198
|
+
detailModal.close();
|
|
43199
|
+
}
|
|
42890
43200
|
setFeedback({
|
|
42891
43201
|
tone: "success",
|
|
42892
43202
|
text: formatMessage(copy.uninstalledSuccess, { name: displayName })
|
|
42893
43203
|
});
|
|
42894
|
-
|
|
42895
|
-
const refreshed = await client.listHostExtensions();
|
|
42896
|
-
if (!disposed && !context.signal.aborted) {
|
|
42897
|
-
applyLoadedList(refreshed);
|
|
42898
|
-
}
|
|
42899
|
-
}
|
|
43204
|
+
await refreshInstalledAfterMutation();
|
|
42900
43205
|
} catch (error62) {
|
|
42901
43206
|
if (disposed || context.signal.aborted) return;
|
|
43207
|
+
const modalTargetId = detailModal.extensionId === item.id ? item.id : null;
|
|
42902
43208
|
setFeedback(
|
|
42903
43209
|
{
|
|
42904
43210
|
tone: "danger",
|
|
@@ -42907,17 +43213,16 @@ ${error62.stderrTail}`] : []
|
|
|
42907
43213
|
modalTargetId
|
|
42908
43214
|
);
|
|
42909
43215
|
} finally {
|
|
43216
|
+
pendingMutations.delete(item.id);
|
|
42910
43217
|
if (!disposed && !context.signal.aborted) {
|
|
42911
|
-
mutating = false;
|
|
42912
|
-
activeMutationId = null;
|
|
42913
|
-
activeMutationAction = null;
|
|
42914
43218
|
render();
|
|
42915
|
-
schedulePoll();
|
|
43219
|
+
if (!hasPendingMutations()) schedulePoll();
|
|
42916
43220
|
}
|
|
42917
43221
|
}
|
|
42918
43222
|
};
|
|
42919
43223
|
const toggleExtension = async (item, enable) => {
|
|
42920
|
-
if (
|
|
43224
|
+
if (recovering || pendingMutations.has(item.id) || disposed || context.signal.aborted)
|
|
43225
|
+
return;
|
|
42921
43226
|
const client = resolveAvailableClient(getClient);
|
|
42922
43227
|
const mutate = enable ? client?.enableHostExtension?.bind(client) : client?.disableHostExtension?.bind(client);
|
|
42923
43228
|
if (!mutate) {
|
|
@@ -42925,17 +43230,17 @@ ${error62.stderrTail}`] : []
|
|
|
42925
43230
|
render();
|
|
42926
43231
|
return;
|
|
42927
43232
|
}
|
|
42928
|
-
const expectedRevision2 = listing?.configuration.revision ?? 0;
|
|
42929
43233
|
const displayName = extensionDisplayName(item, messages.locale);
|
|
42930
|
-
|
|
42931
|
-
mutating = true;
|
|
42932
|
-
activeMutationId = item.id;
|
|
42933
|
-
activeMutationAction = "toggle";
|
|
43234
|
+
pendingMutations.set(item.id, "toggle");
|
|
42934
43235
|
clearPollTimer();
|
|
42935
43236
|
render();
|
|
42936
|
-
|
|
43237
|
+
let shouldReload = false;
|
|
43238
|
+
const runQueued = toggleQueue.then(async () => {
|
|
43239
|
+
if (disposed || context.signal.aborted) return;
|
|
43240
|
+
const expectedRevision2 = listing?.configuration.revision ?? 0;
|
|
42937
43241
|
const result = await mutate({ id: item.id, expectedRevision: expectedRevision2 });
|
|
42938
43242
|
if (disposed || context.signal.aborted) return;
|
|
43243
|
+
const modalTargetId = detailModal.extensionId === item.id ? item.id : null;
|
|
42939
43244
|
if (result.state === "saved") {
|
|
42940
43245
|
if (!enable && pageHost.extensionId === item.id) {
|
|
42941
43246
|
pageHost.close();
|
|
@@ -42958,14 +43263,17 @@ ${error62.stderrTail}`] : []
|
|
|
42958
43263
|
},
|
|
42959
43264
|
modalTargetId
|
|
42960
43265
|
);
|
|
42961
|
-
|
|
42962
|
-
activeMutationId = null;
|
|
42963
|
-
activeMutationAction = null;
|
|
42964
|
-
render();
|
|
42965
|
-
await loadInstalled({ silent: true, keepFeedback: true });
|
|
43266
|
+
shouldReload = true;
|
|
42966
43267
|
return;
|
|
42967
43268
|
}
|
|
42968
43269
|
if (result.state === "revision-conflict") {
|
|
43270
|
+
listApplyToken += 1;
|
|
43271
|
+
if (listing) {
|
|
43272
|
+
listing = {
|
|
43273
|
+
...listing,
|
|
43274
|
+
configuration: { ...listing.configuration, revision: result.revision }
|
|
43275
|
+
};
|
|
43276
|
+
}
|
|
42969
43277
|
setFeedback(
|
|
42970
43278
|
{
|
|
42971
43279
|
tone: "warning",
|
|
@@ -42973,13 +43281,15 @@ ${error62.stderrTail}`] : []
|
|
|
42973
43281
|
},
|
|
42974
43282
|
modalTargetId
|
|
42975
43283
|
);
|
|
42976
|
-
|
|
42977
|
-
activeMutationId = null;
|
|
42978
|
-
activeMutationAction = null;
|
|
42979
|
-
render();
|
|
42980
|
-
await loadInstalled({ silent: true, keepFeedback: true });
|
|
42981
|
-
return;
|
|
43284
|
+
shouldReload = true;
|
|
42982
43285
|
}
|
|
43286
|
+
});
|
|
43287
|
+
toggleQueue = runQueued.then(
|
|
43288
|
+
() => void 0,
|
|
43289
|
+
() => void 0
|
|
43290
|
+
);
|
|
43291
|
+
try {
|
|
43292
|
+
await runQueued;
|
|
42983
43293
|
} catch (error62) {
|
|
42984
43294
|
if (disposed || context.signal.aborted) return;
|
|
42985
43295
|
if (error62 instanceof RendererMethodUnavailableError) {
|
|
@@ -42988,6 +43298,7 @@ ${error62.stderrTail}`] : []
|
|
|
42988
43298
|
setFeedback(null);
|
|
42989
43299
|
return;
|
|
42990
43300
|
}
|
|
43301
|
+
const modalTargetId = detailModal.extensionId === item.id ? item.id : null;
|
|
42991
43302
|
setFeedback(
|
|
42992
43303
|
{
|
|
42993
43304
|
tone: "danger",
|
|
@@ -42996,17 +43307,20 @@ ${error62.stderrTail}`] : []
|
|
|
42996
43307
|
modalTargetId
|
|
42997
43308
|
);
|
|
42998
43309
|
} finally {
|
|
43310
|
+
pendingMutations.delete(item.id);
|
|
42999
43311
|
if (!disposed && !context.signal.aborted) {
|
|
43000
|
-
mutating = false;
|
|
43001
|
-
activeMutationId = null;
|
|
43002
|
-
activeMutationAction = null;
|
|
43003
43312
|
render();
|
|
43004
|
-
|
|
43313
|
+
if (shouldReload) {
|
|
43314
|
+
await loadInstalled({ silent: true, keepFeedback: true });
|
|
43315
|
+
} else if (!hasPendingMutations()) {
|
|
43316
|
+
schedulePoll();
|
|
43317
|
+
}
|
|
43005
43318
|
}
|
|
43006
43319
|
}
|
|
43007
43320
|
};
|
|
43008
43321
|
const openRecoveryDialog = () => {
|
|
43009
|
-
if (disposed || context.signal.aborted ||
|
|
43322
|
+
if (disposed || context.signal.aborted || hasPendingMutations() || activeRecoveryDialog)
|
|
43323
|
+
return;
|
|
43010
43324
|
const client = resolveAvailableClient(getClient);
|
|
43011
43325
|
if (!client?.recoverHostExtensions) return;
|
|
43012
43326
|
detailModal.close();
|
|
@@ -43065,7 +43379,7 @@ ${error62.stderrTail}`] : []
|
|
|
43065
43379
|
context.signal.addEventListener("abort", cleanupDialog, { once: true });
|
|
43066
43380
|
form.addEventListener("submit", (event) => {
|
|
43067
43381
|
event.preventDefault();
|
|
43068
|
-
if (dialogBusy ||
|
|
43382
|
+
if (dialogBusy || hasPendingMutations()) return;
|
|
43069
43383
|
const recover = resolveAvailableClient(getClient)?.recoverHostExtensions;
|
|
43070
43384
|
if (!recover) {
|
|
43071
43385
|
modal.close();
|
|
@@ -43075,9 +43389,9 @@ ${error62.stderrTail}`] : []
|
|
|
43075
43389
|
}
|
|
43076
43390
|
dialogError.textContent = "";
|
|
43077
43391
|
setDialogBusy(true);
|
|
43078
|
-
|
|
43392
|
+
recovering = true;
|
|
43079
43393
|
clearPollTimer();
|
|
43080
|
-
|
|
43394
|
+
render();
|
|
43081
43395
|
const params = listing !== null ? { expectedRevision: listing.configuration.revision } : {};
|
|
43082
43396
|
void recover(params).then(async (result) => {
|
|
43083
43397
|
if (disposed || context.signal.aborted) return;
|
|
@@ -43097,31 +43411,40 @@ ${error62.stderrTail}`] : []
|
|
|
43097
43411
|
tone: "info",
|
|
43098
43412
|
text: copy.recoverySaved
|
|
43099
43413
|
});
|
|
43100
|
-
|
|
43414
|
+
recovering = false;
|
|
43101
43415
|
modal.close();
|
|
43102
43416
|
render();
|
|
43103
43417
|
await loadInstalled({ silent: true, keepFeedback: true });
|
|
43104
43418
|
return;
|
|
43105
43419
|
}
|
|
43106
43420
|
if (result.state === "revision-conflict") {
|
|
43421
|
+
listApplyToken += 1;
|
|
43422
|
+
if (listing) {
|
|
43423
|
+
listing = {
|
|
43424
|
+
...listing,
|
|
43425
|
+
configuration: { ...listing.configuration, revision: result.revision }
|
|
43426
|
+
};
|
|
43427
|
+
}
|
|
43107
43428
|
setFeedback({
|
|
43108
43429
|
tone: "warning",
|
|
43109
43430
|
text: copy.revisionConflictBanner
|
|
43110
43431
|
});
|
|
43111
|
-
|
|
43432
|
+
recovering = false;
|
|
43112
43433
|
modal.close();
|
|
43113
43434
|
render();
|
|
43114
43435
|
await loadInstalled({ silent: true, keepFeedback: true });
|
|
43115
43436
|
return;
|
|
43116
43437
|
}
|
|
43117
|
-
|
|
43438
|
+
recovering = false;
|
|
43118
43439
|
setDialogBusy(false);
|
|
43119
|
-
|
|
43440
|
+
render();
|
|
43441
|
+
schedulePoll();
|
|
43120
43442
|
}).catch((error62) => {
|
|
43121
43443
|
if (disposed || context.signal.aborted) return;
|
|
43122
|
-
|
|
43444
|
+
recovering = false;
|
|
43123
43445
|
setDialogBusy(false);
|
|
43124
|
-
|
|
43446
|
+
render();
|
|
43447
|
+
schedulePoll();
|
|
43125
43448
|
if (error62 instanceof RendererMethodUnavailableError) {
|
|
43126
43449
|
modal.close();
|
|
43127
43450
|
unavailable = true;
|
|
@@ -43152,7 +43475,7 @@ ${error62.stderrTail}`] : []
|
|
|
43152
43475
|
};
|
|
43153
43476
|
const onVisibilityChange = () => {
|
|
43154
43477
|
if (document2.visibilityState === "hidden") clearPollTimer();
|
|
43155
|
-
else if (!disposed && !context.signal.aborted && !
|
|
43478
|
+
else if (!disposed && !context.signal.aborted && !hasPendingMutations() && !loading && !activeRecoveryDialog && !importModal.isOpen) {
|
|
43156
43479
|
void loadInstalled({ silent: true });
|
|
43157
43480
|
}
|
|
43158
43481
|
};
|
|
@@ -43241,14 +43564,14 @@ ${error62.stderrTail}`] : []
|
|
|
43241
43564
|
createModal.open();
|
|
43242
43565
|
});
|
|
43243
43566
|
importButton.addEventListener("click", () => {
|
|
43244
|
-
if (
|
|
43567
|
+
if (importing || recovering || !clientCapabilities().canInstall) return;
|
|
43245
43568
|
closeHeaderMenus();
|
|
43246
43569
|
detailModal.close();
|
|
43247
43570
|
createModal.close();
|
|
43248
43571
|
importModal.open();
|
|
43249
43572
|
});
|
|
43250
43573
|
refreshButton.addEventListener("click", () => {
|
|
43251
|
-
if (
|
|
43574
|
+
if (recovering) return;
|
|
43252
43575
|
closeHeaderMenus();
|
|
43253
43576
|
if (activeTab === "marketplace") {
|
|
43254
43577
|
if (!catalogLoading) void loadCatalog({ forceRefresh: true, silent: false });
|
|
@@ -43258,7 +43581,7 @@ ${error62.stderrTail}`] : []
|
|
|
43258
43581
|
}
|
|
43259
43582
|
});
|
|
43260
43583
|
bannerRetry.addEventListener("click", () => {
|
|
43261
|
-
if (
|
|
43584
|
+
if (recovering) return;
|
|
43262
43585
|
if (activeTab === "marketplace") {
|
|
43263
43586
|
if (!catalogLoading) void loadCatalog({ forceRefresh: true, silent: false });
|
|
43264
43587
|
} else if (!loading) {
|
|
@@ -47078,6 +47401,12 @@ ${error62.stderrTail}`] : []
|
|
|
47078
47401
|
panel.replaceChildren();
|
|
47079
47402
|
panel.append(createPanelHead(document2, viewPhase, message2));
|
|
47080
47403
|
appendServiceStopOutput(status);
|
|
47404
|
+
if (status?.phase === "failed" && status.error) {
|
|
47405
|
+
const error62 = document2.createElement("p");
|
|
47406
|
+
error62.className = "settings-update-error";
|
|
47407
|
+
error62.textContent = status.error;
|
|
47408
|
+
panel.append(error62);
|
|
47409
|
+
}
|
|
47081
47410
|
setManualFallback(viewPhase === "failed");
|
|
47082
47411
|
if (status?.phase === "downloading" && status.totalBytes !== void 0 && status.downloadedBytes !== void 0) {
|
|
47083
47412
|
const progress = document2.createElement("progress");
|
|
@@ -49212,6 +49541,40 @@ ${error62.stderrTail}`] : []
|
|
|
49212
49541
|
white-space: pre-wrap;
|
|
49213
49542
|
}
|
|
49214
49543
|
|
|
49544
|
+
.settings-update-notes details {
|
|
49545
|
+
min-width: 0;
|
|
49546
|
+
border: 1px solid var(--settings-border);
|
|
49547
|
+
border-radius: 8px;
|
|
49548
|
+
background: var(--settings-surface);
|
|
49549
|
+
}
|
|
49550
|
+
|
|
49551
|
+
.settings-update-notes summary {
|
|
49552
|
+
padding: 9px 12px;
|
|
49553
|
+
color: var(--settings-text);
|
|
49554
|
+
font-size: 13px;
|
|
49555
|
+
font-weight: 500;
|
|
49556
|
+
line-height: 20px;
|
|
49557
|
+
cursor: pointer;
|
|
49558
|
+
user-select: none;
|
|
49559
|
+
}
|
|
49560
|
+
|
|
49561
|
+
.settings-update-notes summary:hover {
|
|
49562
|
+
background: var(--settings-hover);
|
|
49563
|
+
border-radius: 7px;
|
|
49564
|
+
}
|
|
49565
|
+
|
|
49566
|
+
.settings-update-notes details[open] > summary {
|
|
49567
|
+
border-bottom: 1px solid var(--settings-divider);
|
|
49568
|
+
border-radius: 7px 7px 0 0;
|
|
49569
|
+
}
|
|
49570
|
+
|
|
49571
|
+
.settings-update-notes-details-body {
|
|
49572
|
+
display: grid;
|
|
49573
|
+
min-width: 0;
|
|
49574
|
+
gap: 10px;
|
|
49575
|
+
padding: 12px;
|
|
49576
|
+
}
|
|
49577
|
+
|
|
49215
49578
|
/* Manual update sits directly under the status panel, not behind a disclosure:
|
|
49216
49579
|
automatic updates can fail for machine-local reasons and this is the way out. */
|
|
49217
49580
|
.settings-update-controls {
|