@liberseek/boft-cli-win32-arm64 0.8.3 → 0.8.4
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 +58 -5
- package/app/console-web.js +436 -67
- package/app/desktop-controller.mjs +72 -9
- package/app/host-runtime.mjs +772 -218
- package/app/plugins/antigravity/plugin.mjs +91 -13
- package/app/plugins/claude-code/plugin.mjs +404 -26
- package/app/plugins/codebuddy/plugin.mjs +117 -22
- package/app/plugins/codex-usage/plugin.mjs +176 -74
- package/app/plugins/copilot/assets/icon.png +0 -0
- package/app/plugins/copilot/manifest.json +26 -0
- package/app/plugins/copilot/plugin.mjs +34601 -0
- package/app/plugins/cursor-cli/plugin.mjs +20794 -44912
- package/app/plugins/deepseek-harness/plugin.mjs +83 -11
- package/app/plugins/enabled.json +1 -0
- package/app/plugins/grok/plugin.mjs +214 -24
- package/app/plugins/hermes/plugin.mjs +80 -9
- package/app/plugins/kimi-code/plugin.mjs +76 -7
- package/app/plugins/kiro-cli/plugin.mjs +76 -7
- package/app/plugins/muse/plugin.mjs +73 -5
- package/app/plugins/omp/plugin.mjs +2155 -2000
- package/app/plugins/opencode/plugin.mjs +85 -11
- package/app/plugins/pi/plugin.mjs +2515 -2298
- package/app/plugins/qoder/plugin.mjs +83 -11
- package/app/plugins/qoder-cn/plugin.mjs +83 -11
- package/app/plugins/workbuddy/plugin.mjs +378 -46
- package/app/plugins/zcode/plugin.mjs +84 -11
- package/app/renderer-extension.js +833 -162
- package/bin/boft.exe +0 -0
- package/libexec/boft-node-repl.exe +0 -0
- package/libexec/boft-shim.exe +0 -0
- package/libexec/boft-updater.exe +0 -0
- package/package.json +1 -1
package/app/console-web.js
CHANGED
|
@@ -14768,10 +14768,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14768
14768
|
var project = external_exports.string().min(1).max(4096);
|
|
14769
14769
|
var usageStatisticsParamsSchema = external_exports.strictObject({
|
|
14770
14770
|
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
14771
|
+
/** Display timezone for ranges, dates and hourly buckets; omitted means the Host's local zone. */
|
|
14772
|
+
timeZone: external_exports.string().min(1).max(128).refine((value) => {
|
|
14773
|
+
try {
|
|
14774
|
+
new Intl.DateTimeFormat("en", { timeZone: value });
|
|
14775
|
+
return true;
|
|
14776
|
+
} catch {
|
|
14777
|
+
return false;
|
|
14778
|
+
}
|
|
14779
|
+
}, "Unsupported usage statistics timezone").optional(),
|
|
14771
14780
|
harness: harness.optional(),
|
|
14772
14781
|
model: model.nullable().optional(),
|
|
14773
14782
|
project: project.nullable().optional(),
|
|
14774
|
-
/** One
|
|
14783
|
+
/** One date in the query timezone inside the range. */
|
|
14775
14784
|
date: localDate.optional()
|
|
14776
14785
|
});
|
|
14777
14786
|
var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
@@ -14807,7 +14816,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14807
14816
|
});
|
|
14808
14817
|
var usageStatisticsResultSchema = external_exports.strictObject({
|
|
14809
14818
|
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
14810
|
-
/** First
|
|
14819
|
+
/** First date in the query timezone (Host local when omitted); null for all time. */
|
|
14811
14820
|
from: localDate.nullable(),
|
|
14812
14821
|
to: localDate,
|
|
14813
14822
|
/** The filters these figures apply, echoed so a late answer to older filters is recognised. */
|
|
@@ -14847,7 +14856,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14847
14856
|
totals: usageStatisticsTotalsSchema,
|
|
14848
14857
|
/** Each date and Harness of the range: every filter except the day. */
|
|
14849
14858
|
daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
|
|
14850
|
-
/**
|
|
14859
|
+
/** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
|
|
14851
14860
|
hourly: external_exports.array(external_exports.strictObject({
|
|
14852
14861
|
weekday: external_exports.number().int().min(0).max(6),
|
|
14853
14862
|
hour: external_exports.number().int().min(0).max(23),
|
|
@@ -14990,6 +14999,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14990
14999
|
"codexhost/harness/display-settings/set",
|
|
14991
15000
|
"codexhost/harness/inspect",
|
|
14992
15001
|
"codexhost/harness/installation",
|
|
15002
|
+
"codexhost/harness/installation/start",
|
|
15003
|
+
"codexhost/harness/installation/status",
|
|
14993
15004
|
"codexhost/harness/launch-settings/get",
|
|
14994
15005
|
"codexhost/harness/launch-settings/set",
|
|
14995
15006
|
HARNESS_LONG_CONTEXT_GET_METHOD,
|
|
@@ -15069,7 +15080,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15069
15080
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
15070
15081
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15071
15082
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15083
|
+
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
15084
|
+
var composerIndicatorsSchema = external_exports.array(external_exports.object({
|
|
15085
|
+
kind: external_exports.literal("countdown"),
|
|
15086
|
+
id: external_exports.string().min(1).max(64),
|
|
15087
|
+
expiresAtUnix: nonNegativeSafeIntegerSchema,
|
|
15088
|
+
label: indicatorTextSchema(256).optional(),
|
|
15089
|
+
tooltip: indicatorTextSchema(1024).optional()
|
|
15090
|
+
}).strict()).max(2).refine((entries) => new Set(entries.map(({ id }) => id)).size === entries.length, {
|
|
15091
|
+
message: "Composer indicator IDs must be unique"
|
|
15092
|
+
});
|
|
15072
15093
|
var threadUsageSnapshotSchema = external_exports.object({
|
|
15094
|
+
composerIndicators: composerIndicatorsSchema.optional(),
|
|
15073
15095
|
inputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15074
15096
|
cachedInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15075
15097
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
@@ -15495,7 +15517,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15495
15517
|
}).strict().optional(),
|
|
15496
15518
|
input: external_exports.object({
|
|
15497
15519
|
image: external_exports.boolean()
|
|
15498
|
-
}).strict().optional()
|
|
15520
|
+
}).strict().optional(),
|
|
15521
|
+
/** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
|
|
15522
|
+
steer: external_exports.boolean().optional()
|
|
15499
15523
|
}).strict();
|
|
15500
15524
|
var harnessConfigurationStateSchema = external_exports.object({
|
|
15501
15525
|
effectiveModel: harnessModelRefSchema.optional(),
|
|
@@ -15543,7 +15567,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15543
15567
|
var harnessInspectParamsSchema = external_exports.object({
|
|
15544
15568
|
harnessId: harnessIdSchema,
|
|
15545
15569
|
cwd: nonBlankTextSchema2.max(16384).optional(),
|
|
15546
|
-
refresh: external_exports.boolean().optional()
|
|
15570
|
+
refresh: external_exports.boolean().optional(),
|
|
15571
|
+
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
15572
|
+
purpose: external_exports.literal("availability").optional()
|
|
15547
15573
|
}).strict();
|
|
15548
15574
|
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
15549
15575
|
harnessId: harnessIdSchema
|
|
@@ -15628,6 +15654,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15628
15654
|
seen.add(thread.threadId);
|
|
15629
15655
|
}
|
|
15630
15656
|
});
|
|
15657
|
+
var threadSteeringInspectParamsSchema = external_exports.object({
|
|
15658
|
+
threadId: hostThreadIdSchema,
|
|
15659
|
+
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
15660
|
+
text: external_exports.string().optional()
|
|
15661
|
+
}).strict();
|
|
15662
|
+
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
15663
|
+
var threadSteeringInspectResultSchema = external_exports.object({
|
|
15664
|
+
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
15665
|
+
}).strict();
|
|
15631
15666
|
|
|
15632
15667
|
// ../shared-contracts/dist/harness-route.js
|
|
15633
15668
|
var harnessPluginRouteSchema = external_exports.object({
|
|
@@ -15653,7 +15688,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15653
15688
|
}).strict();
|
|
15654
15689
|
|
|
15655
15690
|
// ../shared-contracts/dist/harness-installation.js
|
|
15656
|
-
var
|
|
15691
|
+
var HARNESS_INSTALLATION_START_METHOD = "codexhost/harness/installation/start";
|
|
15692
|
+
var HARNESS_INSTALLATION_STATUS_METHOD = "codexhost/harness/installation/status";
|
|
15657
15693
|
var harnessInstallationParamsSchema = external_exports.object({
|
|
15658
15694
|
harnessId: harnessIdSchema,
|
|
15659
15695
|
action: external_exports.enum(["check", "update", "install"])
|
|
@@ -15663,6 +15699,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15663
15699
|
latestVersion: external_exports.string().min(1).max(128),
|
|
15664
15700
|
updateAvailable: external_exports.boolean(),
|
|
15665
15701
|
canUpdate: external_exports.boolean(),
|
|
15702
|
+
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
15703
|
+
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
15704
|
+
/** Official download opened by the user; does not imply an automatic installation. */
|
|
15705
|
+
manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
|
|
15666
15706
|
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
15667
15707
|
message: external_exports.string().max(2048).optional(),
|
|
15668
15708
|
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
@@ -15670,6 +15710,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15670
15710
|
notice: harnessLocalizedTextSchema.optional(),
|
|
15671
15711
|
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
15672
15712
|
}).strict();
|
|
15713
|
+
var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
|
|
15714
|
+
var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
|
|
15715
|
+
external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
|
|
15716
|
+
external_exports.object({
|
|
15717
|
+
taskId: external_exports.string().uuid(),
|
|
15718
|
+
status: external_exports.literal("succeeded"),
|
|
15719
|
+
result: harnessInstallationStateSchema
|
|
15720
|
+
}).strict(),
|
|
15721
|
+
external_exports.object({
|
|
15722
|
+
taskId: external_exports.string().uuid(),
|
|
15723
|
+
status: external_exports.literal("failed"),
|
|
15724
|
+
error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
|
|
15725
|
+
}).strict()
|
|
15726
|
+
]);
|
|
15673
15727
|
|
|
15674
15728
|
// ../shared-contracts/dist/codex-accounts.js
|
|
15675
15729
|
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
@@ -18435,6 +18489,8 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
18435
18489
|
harness: "Harness",
|
|
18436
18490
|
model: "Model",
|
|
18437
18491
|
project: "Project",
|
|
18492
|
+
host: "Machine",
|
|
18493
|
+
localHost: "This machine",
|
|
18438
18494
|
filterModel: "Filter by model",
|
|
18439
18495
|
filterProject: "Filter by project",
|
|
18440
18496
|
unknownModel: "Unknown model",
|
|
@@ -18618,6 +18674,8 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
18618
18674
|
harness: "Harness",
|
|
18619
18675
|
model: "\u6A21\u578B",
|
|
18620
18676
|
project: "\u9879\u76EE",
|
|
18677
|
+
host: "\u673A\u5668",
|
|
18678
|
+
localHost: "\u672C\u673A",
|
|
18621
18679
|
filterModel: "\u6309\u6A21\u578B\u7B5B\u9009",
|
|
18622
18680
|
filterProject: "\u6309\u9879\u76EE\u7B5B\u9009",
|
|
18623
18681
|
unknownModel: "\u672A\u77E5\u6A21\u578B",
|
|
@@ -19382,6 +19440,26 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
19382
19440
|
};
|
|
19383
19441
|
}
|
|
19384
19442
|
|
|
19443
|
+
// src/renderer-installation-client.ts
|
|
19444
|
+
async function runRendererInstallation(send, input) {
|
|
19445
|
+
const params = harnessInstallationParamsSchema.parse(input);
|
|
19446
|
+
const options = { priority: "background", timeoutMs: 15e3 };
|
|
19447
|
+
let task = harnessInstallationTaskSchema.parse(
|
|
19448
|
+
await send(HARNESS_INSTALLATION_START_METHOD, params, options)
|
|
19449
|
+
);
|
|
19450
|
+
const taskId = task.taskId;
|
|
19451
|
+
while (task.status === "running") {
|
|
19452
|
+
await new Promise((resolve) => globalThis.setTimeout(resolve, 500));
|
|
19453
|
+
task = harnessInstallationTaskSchema.parse(
|
|
19454
|
+
await send(HARNESS_INSTALLATION_STATUS_METHOD, { taskId }, options)
|
|
19455
|
+
);
|
|
19456
|
+
if (task.taskId !== taskId) throw new Error("Harness installation task identity changed");
|
|
19457
|
+
}
|
|
19458
|
+
if (task.status === "failed")
|
|
19459
|
+
throw Object.assign(new Error(task.error.message), { code: task.error.code });
|
|
19460
|
+
return task.result;
|
|
19461
|
+
}
|
|
19462
|
+
|
|
19385
19463
|
// src/renderer-request-sender.ts
|
|
19386
19464
|
var RendererMethodUnavailableError = class extends Error {
|
|
19387
19465
|
constructor(method, cause) {
|
|
@@ -19531,7 +19609,15 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
19531
19609
|
};
|
|
19532
19610
|
const inspectHarness = async (input, options) => {
|
|
19533
19611
|
const params = harnessInspectParamsSchema.parse(input);
|
|
19534
|
-
|
|
19612
|
+
let result;
|
|
19613
|
+
try {
|
|
19614
|
+
result = await manager.sendRequest(HARNESS_INSPECT_METHOD, params, options);
|
|
19615
|
+
} catch (error51) {
|
|
19616
|
+
if (!params.purpose || !isInvalidParams(error51)) throw error51;
|
|
19617
|
+
const full = { ...params };
|
|
19618
|
+
delete full.purpose;
|
|
19619
|
+
result = await manager.sendRequest(HARNESS_INSPECT_METHOD, full, options);
|
|
19620
|
+
}
|
|
19535
19621
|
return harnessInspectionSchema.parse(result);
|
|
19536
19622
|
};
|
|
19537
19623
|
const inspectHarnessCommands = async (input) => {
|
|
@@ -19571,13 +19657,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
19571
19657
|
};
|
|
19572
19658
|
return Object.freeze({
|
|
19573
19659
|
async installation(input) {
|
|
19574
|
-
return
|
|
19575
|
-
await manager.sendRequest(
|
|
19576
|
-
HARNESS_INSTALLATION_METHOD,
|
|
19577
|
-
harnessInstallationParamsSchema.parse(input),
|
|
19578
|
-
{ priority: "interactive" }
|
|
19579
|
-
)
|
|
19580
|
-
);
|
|
19660
|
+
return runRendererInstallation(manager.sendRequest, input);
|
|
19581
19661
|
},
|
|
19582
19662
|
async getHarnessDisplaySettings() {
|
|
19583
19663
|
return harnessDisplaySettingsSchema.parse(
|
|
@@ -19822,6 +19902,9 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
19822
19902
|
}
|
|
19823
19903
|
});
|
|
19824
19904
|
}
|
|
19905
|
+
function isInvalidParams(error51) {
|
|
19906
|
+
return typeof error51 === "object" && error51 !== null && "code" in error51 && error51.code === -32602;
|
|
19907
|
+
}
|
|
19825
19908
|
|
|
19826
19909
|
// src/settings/accounts.css
|
|
19827
19910
|
var accounts_default = `.settings-harness-account__logo {
|
|
@@ -20928,10 +21011,17 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
20928
21011
|
connectionInstallRunning: "Installing on the selected Host. You can leave this page; login or setup may still be required afterward.",
|
|
20929
21012
|
harnessVersion: harnessVersionEnglish,
|
|
20930
21013
|
harnessVersionTitle: "Harness CLI version",
|
|
21014
|
+
harnessVersionApplicationTitle: "Application version",
|
|
20931
21015
|
harnessVersionCurrent: "Current version",
|
|
20932
21016
|
harnessVersionLatest: "Latest version",
|
|
20933
21017
|
harnessVersionChecking: "Checking versions\u2026",
|
|
21018
|
+
harnessVersionAvailable: "Update available",
|
|
20934
21019
|
harnessVersionUpdate: "Update",
|
|
21020
|
+
harnessVersionDownloadUpdate: "Download update",
|
|
21021
|
+
harnessUpdateAll: "Update all",
|
|
21022
|
+
harnessUpdateAllProgress: "Updating",
|
|
21023
|
+
harnessUpdateAllDescription: "Update all eligible Harnesses on the selected Host.",
|
|
21024
|
+
harnessUpdateAllResult: "Updated {succeeded}; failed {failed}.",
|
|
20935
21025
|
harnessVersionUpdating: "Updating\u2026",
|
|
20936
21026
|
harnessVersionUpToDate: "Up to date",
|
|
20937
21027
|
harnessVersionUpdated: "Update verified. New sessions will use the new version.",
|
|
@@ -21236,10 +21326,17 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
21236
21326
|
connectionInstallRunning: "\u6B63\u5728\u6240\u9009 Host \u4E0A\u5B89\u88C5\uFF0C\u79BB\u5F00\u9875\u9762\u4E0D\u4F1A\u4E2D\u65AD\u3002\u5B89\u88C5\u540E\u53EF\u80FD\u4ECD\u9700\u767B\u5F55\u6216\u914D\u7F6E\u3002",
|
|
21237
21327
|
harnessVersion: harnessVersionChinese,
|
|
21238
21328
|
harnessVersionTitle: "Harness CLI \u7248\u672C",
|
|
21329
|
+
harnessVersionApplicationTitle: "\u5E94\u7528\u7248\u672C",
|
|
21239
21330
|
harnessVersionCurrent: "\u5F53\u524D\u7248\u672C",
|
|
21240
21331
|
harnessVersionLatest: "\u6700\u65B0\u7248\u672C",
|
|
21241
21332
|
harnessVersionChecking: "\u6B63\u5728\u68C0\u67E5\u7248\u672C\u2026",
|
|
21333
|
+
harnessVersionAvailable: "\u6709\u66F4\u65B0",
|
|
21242
21334
|
harnessVersionUpdate: "\u66F4\u65B0",
|
|
21335
|
+
harnessVersionDownloadUpdate: "\u4E0B\u8F7D\u66F4\u65B0",
|
|
21336
|
+
harnessUpdateAll: "\u5168\u90E8\u66F4\u65B0",
|
|
21337
|
+
harnessUpdateAllProgress: "\u66F4\u65B0\u4E2D",
|
|
21338
|
+
harnessUpdateAllDescription: "\u66F4\u65B0\u5F53\u524D Host \u4E0A\u652F\u6301\u81EA\u52A8\u66F4\u65B0\u4E14\u6709\u65B0\u7248\u672C\u7684 Harness\u3002",
|
|
21339
|
+
harnessUpdateAllResult: "\u5DF2\u66F4\u65B0 {succeeded} \u9879\uFF0C{failed} \u9879\u5931\u8D25\u3002",
|
|
21243
21340
|
harnessVersionUpdating: "\u6B63\u5728\u66F4\u65B0\u2026",
|
|
21244
21341
|
harnessVersionUpToDate: "\u5DF2\u662F\u6700\u65B0",
|
|
21245
21342
|
harnessVersionUpdated: "\u5DF2\u786E\u8BA4\u66F4\u65B0\u6210\u529F\uFF0C\u65B0\u4F1A\u8BDD\u5C06\u4F7F\u7528\u65B0\u7248\u672C\u3002",
|
|
@@ -21371,6 +21468,34 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
21371
21468
|
return names.size === 1 ? names.values().next().value ?? model2 : model2;
|
|
21372
21469
|
}
|
|
21373
21470
|
|
|
21471
|
+
// src/console/usage/usage-hosts.ts
|
|
21472
|
+
var LOCAL_USAGE_HOST_ID = "local";
|
|
21473
|
+
function usageHostOptions(hosts, localLabel, selected) {
|
|
21474
|
+
const options = [{ key: LOCAL_USAGE_HOST_ID, label: localLabel }];
|
|
21475
|
+
const seen = /* @__PURE__ */ new Set([LOCAL_USAGE_HOST_ID]);
|
|
21476
|
+
const add = (hostId2, label) => {
|
|
21477
|
+
if (hostId2.length === 0 || seen.has(hostId2)) return;
|
|
21478
|
+
seen.add(hostId2);
|
|
21479
|
+
options.push({ key: hostId2, label: label !== void 0 && label.length > 0 ? label : hostId2 });
|
|
21480
|
+
};
|
|
21481
|
+
for (const host of hosts ?? []) add(host.hostId, host.label);
|
|
21482
|
+
if (!seen.has(selected)) add(selected, void 0);
|
|
21483
|
+
return options;
|
|
21484
|
+
}
|
|
21485
|
+
function createLatestKeyGuard() {
|
|
21486
|
+
let generation = 0;
|
|
21487
|
+
let key;
|
|
21488
|
+
return {
|
|
21489
|
+
begin(next) {
|
|
21490
|
+
generation += 1;
|
|
21491
|
+
key = next;
|
|
21492
|
+
const mine = generation;
|
|
21493
|
+
const selected = next;
|
|
21494
|
+
return () => generation === mine && Object.is(key, selected);
|
|
21495
|
+
}
|
|
21496
|
+
};
|
|
21497
|
+
}
|
|
21498
|
+
|
|
21374
21499
|
// src/renderer-usage-control.ts
|
|
21375
21500
|
var ENGLISH_USAGE_MESSAGES = Object.freeze({
|
|
21376
21501
|
usage: "Usage",
|
|
@@ -22731,6 +22856,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
22731
22856
|
const range = text("range");
|
|
22732
22857
|
const measure = text("measure");
|
|
22733
22858
|
const granularity = text("granularity");
|
|
22859
|
+
const hostId2 = text("hostId");
|
|
22734
22860
|
const harness2 = text("harness");
|
|
22735
22861
|
const model2 = text("model");
|
|
22736
22862
|
const project2 = text("project");
|
|
@@ -22739,6 +22865,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
22739
22865
|
...range && USAGE_STATISTICS_RANGES.includes(range) ? { range } : {},
|
|
22740
22866
|
...measure && MEASURES.includes(measure) ? { measure } : {},
|
|
22741
22867
|
...granularity === "day" || granularity === "week" || granularity === "month" ? { granularity } : {},
|
|
22868
|
+
...hostId2 !== void 0 && hostId2.length > 0 ? { hostId: hostId2 } : {},
|
|
22742
22869
|
...harness2 !== void 0 ? { harness: harness2 } : {},
|
|
22743
22870
|
...model2 !== void 0 ? { model: model2 } : {},
|
|
22744
22871
|
...project2 !== void 0 ? { project: project2 } : {},
|
|
@@ -22777,7 +22904,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
22777
22904
|
day.setDate(day.getDate() - (day.getDay() + 6) % 7);
|
|
22778
22905
|
return isoDate(day);
|
|
22779
22906
|
}
|
|
22780
|
-
function createUsageStatisticsPage(consoleMessages2, request, pageLocale) {
|
|
22907
|
+
function createUsageStatisticsPage(consoleMessages2, request, pageLocale, usageHosts) {
|
|
22781
22908
|
const messages = consoleMessages2.usageStatistics;
|
|
22782
22909
|
return Object.freeze({
|
|
22783
22910
|
id: "usage-statistics",
|
|
@@ -22786,10 +22913,12 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
22786
22913
|
mount(context) {
|
|
22787
22914
|
const document2 = context.content.ownerDocument;
|
|
22788
22915
|
const locale = pageLocale ?? (document2.documentElement.lang || "en");
|
|
22916
|
+
const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
22789
22917
|
const count3 = (value) => count2(value, locale);
|
|
22790
22918
|
const tokenCount2 = (totals2, value) => tokenCount(totals2, value, locale);
|
|
22791
22919
|
const saved = readView();
|
|
22792
22920
|
const view = {
|
|
22921
|
+
hostId: saved.hostId ?? LOCAL_USAGE_HOST_ID,
|
|
22793
22922
|
range: saved.range ?? "30d",
|
|
22794
22923
|
measure: saved.measure ?? "cost",
|
|
22795
22924
|
granularity: saved.granularity ?? null,
|
|
@@ -22820,7 +22949,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
22820
22949
|
let projectLabel = /* @__PURE__ */ new Map();
|
|
22821
22950
|
const projectName = (key) => key === UNKNOWN ? messages.unknownProject : projectLabel.get(key) ?? baseName(key);
|
|
22822
22951
|
const measureLabel = (measure) => measure === "cost" ? messages.cost : messages.tokens;
|
|
22823
|
-
const dateFormat = (options) => new Intl.DateTimeFormat(locale, options);
|
|
22952
|
+
const dateFormat = (options) => new Intl.DateTimeFormat(locale, { ...options, timeZone });
|
|
22824
22953
|
const shortDate = dateFormat({ month: "short", day: "numeric" });
|
|
22825
22954
|
const longDate = dateFormat({
|
|
22826
22955
|
year: "numeric",
|
|
@@ -22839,10 +22968,51 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
22839
22968
|
const prices = createModelPricesDialog(
|
|
22840
22969
|
document2,
|
|
22841
22970
|
consoleMessages2,
|
|
22842
|
-
request,
|
|
22971
|
+
(method, params2) => request(method, params2, view.hostId),
|
|
22843
22972
|
context.signal,
|
|
22844
22973
|
load
|
|
22845
22974
|
);
|
|
22975
|
+
let offeredHosts = usageHosts ? [] : void 0;
|
|
22976
|
+
const hostCombo = new ComboBox(document2, {
|
|
22977
|
+
label: messages.host,
|
|
22978
|
+
searchLabel: messages.search,
|
|
22979
|
+
emptyLabel: messages.noMatches,
|
|
22980
|
+
signal: context.signal,
|
|
22981
|
+
searchable: false,
|
|
22982
|
+
display: (option) => `${messages.host} \xB7 ${option.label}`,
|
|
22983
|
+
onChange: (key) => {
|
|
22984
|
+
if (key === view.hostId) return;
|
|
22985
|
+
view.hostId = key;
|
|
22986
|
+
view.harness = "";
|
|
22987
|
+
view.model = "";
|
|
22988
|
+
view.project = "";
|
|
22989
|
+
date5 = null;
|
|
22990
|
+
unpricedOnly = false;
|
|
22991
|
+
result = null;
|
|
22992
|
+
error51 = null;
|
|
22993
|
+
loadedAt = 0;
|
|
22994
|
+
names.clear();
|
|
22995
|
+
save();
|
|
22996
|
+
hostOptions();
|
|
22997
|
+
render();
|
|
22998
|
+
void refreshHarnessNames();
|
|
22999
|
+
load();
|
|
23000
|
+
}
|
|
23001
|
+
});
|
|
23002
|
+
const hostOptions = () => {
|
|
23003
|
+
const options = usageHostOptions(offeredHosts, messages.localHost, view.hostId);
|
|
23004
|
+
hostCombo.element.hidden = options.length < 2;
|
|
23005
|
+
hostCombo.update(options, view.hostId === LOCAL_USAGE_HOST_ID ? "" : view.hostId);
|
|
23006
|
+
};
|
|
23007
|
+
const offerHosts = () => {
|
|
23008
|
+
if (!usageHosts) return;
|
|
23009
|
+
void usageHosts().then((hosts) => {
|
|
23010
|
+
if (context.signal.aborted) return;
|
|
23011
|
+
offeredHosts = hosts;
|
|
23012
|
+
hostOptions();
|
|
23013
|
+
}).catch(() => void 0);
|
|
23014
|
+
};
|
|
23015
|
+
hostOptions();
|
|
22846
23016
|
const updated = h(document2, "span", { className: "console-muted console-usage-updated" });
|
|
22847
23017
|
const refresh = h(
|
|
22848
23018
|
document2,
|
|
@@ -22855,7 +23025,10 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
22855
23025
|
},
|
|
22856
23026
|
createRendererSettingsIcon("refresh", 16)
|
|
22857
23027
|
);
|
|
22858
|
-
refresh.addEventListener("click", () =>
|
|
23028
|
+
refresh.addEventListener("click", () => {
|
|
23029
|
+
offerHosts();
|
|
23030
|
+
load();
|
|
23031
|
+
});
|
|
22859
23032
|
const auto = new ComboBox(document2, {
|
|
22860
23033
|
label: messages.autoRefresh,
|
|
22861
23034
|
searchLabel: messages.search,
|
|
@@ -22894,6 +23067,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
22894
23067
|
document2,
|
|
22895
23068
|
"div",
|
|
22896
23069
|
{ className: "console-usage-toolbar" },
|
|
23070
|
+
hostCombo.element,
|
|
22897
23071
|
updated,
|
|
22898
23072
|
refresh,
|
|
22899
23073
|
auto.element,
|
|
@@ -23532,7 +23706,6 @@ ${detail}` : ""}`
|
|
|
23532
23706
|
}
|
|
23533
23707
|
function hourlyPanel(data) {
|
|
23534
23708
|
const singleDay = data.filters.date !== null || data.range === "today";
|
|
23535
|
-
const zone = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
23536
23709
|
return panel(
|
|
23537
23710
|
singleDay ? messages.hourlyDay : messages.hourly,
|
|
23538
23711
|
hourlyChart(document2, {
|
|
@@ -23547,7 +23720,7 @@ ${detail}` : ""}`
|
|
|
23547
23720
|
weekStartsOnMonday: !locale.startsWith("en"),
|
|
23548
23721
|
labels: { cost: messages.cost, tokens: messages.tokens }
|
|
23549
23722
|
}),
|
|
23550
|
-
h(document2, "span", { className: "console-muted console-usage-zone" },
|
|
23723
|
+
h(document2, "span", { className: "console-muted console-usage-zone" }, timeZone)
|
|
23551
23724
|
);
|
|
23552
23725
|
}
|
|
23553
23726
|
function sessionsPanel(title, rows, tableKey) {
|
|
@@ -23694,6 +23867,7 @@ ${detail}` : ""}`
|
|
|
23694
23867
|
const project2 = filterValue(view.project);
|
|
23695
23868
|
return {
|
|
23696
23869
|
range: view.range,
|
|
23870
|
+
timeZone,
|
|
23697
23871
|
...view.harness ? { harness: view.harness } : {},
|
|
23698
23872
|
...model2 !== void 0 ? { model: model2 } : {},
|
|
23699
23873
|
...project2 !== void 0 ? { project: project2 } : {},
|
|
@@ -23706,10 +23880,26 @@ ${detail}` : ""}`
|
|
|
23706
23880
|
if (result && !result.reading.complete) poll = window.setTimeout(load, POLL_MS);
|
|
23707
23881
|
else if (view.autoRefreshMs > 0) poll = window.setTimeout(load, view.autoRefreshMs);
|
|
23708
23882
|
}
|
|
23883
|
+
const harnessNamesRead = createLatestKeyGuard();
|
|
23884
|
+
async function refreshHarnessNames() {
|
|
23885
|
+
const hostId2 = view.hostId;
|
|
23886
|
+
const isCurrent = harnessNamesRead.begin(hostId2);
|
|
23887
|
+
names.clear();
|
|
23888
|
+
try {
|
|
23889
|
+
const value = await request(HARNESS_PLUGIN_LIST_METHOD2, {}, hostId2);
|
|
23890
|
+
if (!isCurrent()) return;
|
|
23891
|
+
for (const plugin of harnessPluginListResultSchema.parse(value).plugins) {
|
|
23892
|
+
names.set(plugin.id, plugin.name);
|
|
23893
|
+
}
|
|
23894
|
+
} catch {
|
|
23895
|
+
if (!isCurrent()) return;
|
|
23896
|
+
}
|
|
23897
|
+
if (!context.signal.aborted) render();
|
|
23898
|
+
}
|
|
23709
23899
|
function load() {
|
|
23710
23900
|
window.clearTimeout(poll);
|
|
23711
23901
|
const requested = params();
|
|
23712
|
-
void context.runLatest(() => request(USAGE_STATISTICS_METHOD, requested), {
|
|
23902
|
+
void context.runLatest(() => request(USAGE_STATISTICS_METHOD, requested, view.hostId), {
|
|
23713
23903
|
success(value) {
|
|
23714
23904
|
const parsed = usageStatisticsResultSchema.safeParse(value);
|
|
23715
23905
|
if (parsed.success) {
|
|
@@ -23734,12 +23924,8 @@ ${detail}` : ""}`
|
|
|
23734
23924
|
}
|
|
23735
23925
|
context.content.replaceChildren(header, prices.element, filters, notices, body);
|
|
23736
23926
|
render();
|
|
23737
|
-
|
|
23738
|
-
|
|
23739
|
-
names.set(plugin.id, plugin.name);
|
|
23740
|
-
}
|
|
23741
|
-
if (!context.signal.aborted) render();
|
|
23742
|
-
}).catch(() => void 0);
|
|
23927
|
+
offerHosts();
|
|
23928
|
+
void refreshHarnessNames();
|
|
23743
23929
|
load();
|
|
23744
23930
|
return () => {
|
|
23745
23931
|
window.clearTimeout(poll);
|
|
@@ -25379,7 +25565,7 @@ ${detail}` : ""}`
|
|
|
25379
25565
|
}
|
|
25380
25566
|
|
|
25381
25567
|
// src/settings/harness-version-panel.ts
|
|
25382
|
-
function createHarnessVersionPanel(document2, messages, signal, agent, client) {
|
|
25568
|
+
function createHarnessVersionPanel(document2, messages, signal, agent, client, onChange = () => void 0) {
|
|
25383
25569
|
const panel = document2.createElement("section");
|
|
25384
25570
|
panel.className = "settings-harness-version";
|
|
25385
25571
|
panel.dataset.harnessVersion = agent;
|
|
@@ -25405,37 +25591,67 @@ ${detail}` : ""}`
|
|
|
25405
25591
|
panel.append(heading, versions, status, actions, note);
|
|
25406
25592
|
let state;
|
|
25407
25593
|
let busy = false;
|
|
25594
|
+
let updating = false;
|
|
25408
25595
|
let unsupported = false;
|
|
25596
|
+
let updatePromise = null;
|
|
25409
25597
|
const render = () => {
|
|
25598
|
+
heading.textContent = state?.versionKind === "application" ? messages.harnessVersionApplicationTitle : messages.harnessVersionTitle;
|
|
25410
25599
|
current.textContent = `${messages.harnessVersionCurrent}: ${state?.currentVersion ?? "\u2014"}`;
|
|
25411
25600
|
latest.textContent = `${messages.harnessVersionLatest}: ${harnessVersionLabel(state, messages.harnessVersion)}`;
|
|
25412
25601
|
update.disabled = busy || signal.aborted || !state?.canUpdate || !state.updateAvailable;
|
|
25602
|
+
const manualUrl = !state?.canUpdate && state?.updateAvailable ? state.manualUpdateUrl : void 0;
|
|
25603
|
+
actions.replaceChildren(update);
|
|
25604
|
+
update.hidden = !busy && !signal.aborted && Boolean(manualUrl);
|
|
25605
|
+
if (update.hidden && manualUrl) {
|
|
25606
|
+
const download2 = document2.createElement("a");
|
|
25607
|
+
download2.className = "settings-command-button settings-command-button--secondary";
|
|
25608
|
+
download2.dataset.harnessVersionAction = "download-update";
|
|
25609
|
+
download2.textContent = messages.harnessVersionDownloadUpdate;
|
|
25610
|
+
download2.href = manualUrl;
|
|
25611
|
+
download2.target = "_blank";
|
|
25612
|
+
download2.rel = "noopener noreferrer";
|
|
25613
|
+
actions.append(download2);
|
|
25614
|
+
}
|
|
25413
25615
|
update.textContent = state?.canUpdate && state.latestVersion !== "Unknown" && !state.updateAvailable ? messages.harnessVersionUpToDate : messages.harnessVersionUpdate;
|
|
25414
25616
|
const detail = harnessVersionNote(state, messages.harnessVersion);
|
|
25415
|
-
note.textContent = detail ? `${detail} ${messages.harnessVersionNote}` : messages.harnessVersionNote;
|
|
25617
|
+
note.textContent = detail ? !state?.canUpdate ? detail : `${detail} ${messages.harnessVersionNote}` : messages.harnessVersionNote;
|
|
25416
25618
|
};
|
|
25417
25619
|
const run = async (action) => {
|
|
25418
|
-
if (busy || unsupported || signal.aborted) return;
|
|
25419
|
-
if (action === "update" && (!state?.canUpdate || !state.updateAvailable)) return;
|
|
25620
|
+
if (busy || unsupported || signal.aborted) return false;
|
|
25621
|
+
if (action === "update" && (!state?.canUpdate || !state.updateAvailable)) return false;
|
|
25420
25622
|
busy = true;
|
|
25623
|
+
updating = action === "update";
|
|
25624
|
+
onChange();
|
|
25421
25625
|
status.textContent = action === "check" ? messages.harnessVersionChecking : messages.harnessVersionUpdating;
|
|
25422
25626
|
render();
|
|
25423
25627
|
try {
|
|
25424
25628
|
const result = await client.run(action);
|
|
25425
|
-
if (signal.aborted) return;
|
|
25629
|
+
if (signal.aborted) return false;
|
|
25426
25630
|
state = result;
|
|
25427
25631
|
status.textContent = !result.canUpdate ? messages.harnessVersionManual : action === "update" ? result.updateAvailable ? messages.harnessVersionFailed : messages.harnessVersionUpdated : "";
|
|
25632
|
+
return result.canUpdate && !result.updateAvailable;
|
|
25428
25633
|
} catch (error51) {
|
|
25429
|
-
if (signal.aborted) return;
|
|
25634
|
+
if (signal.aborted) return false;
|
|
25430
25635
|
unsupported = typeof error51 === "object" && error51 !== null && "code" in error51 && (error51.code === -32601 || error51.code === -32078);
|
|
25431
25636
|
status.textContent = unsupported ? messages.harnessVersionUnsupported : messages.harnessVersionFailed;
|
|
25432
25637
|
if (state) state = { ...state, canUpdate: false };
|
|
25638
|
+
return false;
|
|
25433
25639
|
} finally {
|
|
25434
25640
|
busy = false;
|
|
25435
|
-
|
|
25641
|
+
updating = false;
|
|
25642
|
+
if (!signal.aborted) {
|
|
25643
|
+
render();
|
|
25644
|
+
onChange();
|
|
25645
|
+
}
|
|
25436
25646
|
}
|
|
25437
25647
|
};
|
|
25438
|
-
|
|
25648
|
+
const updateVersion = () => {
|
|
25649
|
+
updatePromise ??= run("update").finally(() => {
|
|
25650
|
+
updatePromise = null;
|
|
25651
|
+
});
|
|
25652
|
+
return updatePromise;
|
|
25653
|
+
};
|
|
25654
|
+
update.addEventListener("click", () => void updateVersion());
|
|
25439
25655
|
const owner = document2.defaultView;
|
|
25440
25656
|
let checkFrame = null;
|
|
25441
25657
|
let checkTimer = null;
|
|
@@ -25462,7 +25678,95 @@ ${detail}` : ""}`
|
|
|
25462
25678
|
} else {
|
|
25463
25679
|
void run("check");
|
|
25464
25680
|
}
|
|
25465
|
-
return
|
|
25681
|
+
return {
|
|
25682
|
+
element: panel,
|
|
25683
|
+
get state() {
|
|
25684
|
+
return state;
|
|
25685
|
+
},
|
|
25686
|
+
get updating() {
|
|
25687
|
+
return updating;
|
|
25688
|
+
},
|
|
25689
|
+
update: updateVersion
|
|
25690
|
+
};
|
|
25691
|
+
}
|
|
25692
|
+
|
|
25693
|
+
// src/settings/connection-versions.ts
|
|
25694
|
+
function createConnectionVersions(document2, messages, signal, diagnostics, onChange) {
|
|
25695
|
+
const panels = /* @__PURE__ */ new Map();
|
|
25696
|
+
const installation = diagnostics?.installation?.bind(diagnostics);
|
|
25697
|
+
return {
|
|
25698
|
+
get(hostId2, agent) {
|
|
25699
|
+
if (!installation || signal.aborted) return void 0;
|
|
25700
|
+
const key = JSON.stringify([hostId2, agent]);
|
|
25701
|
+
let panel = panels.get(key);
|
|
25702
|
+
if (!panel) {
|
|
25703
|
+
panel = createHarnessVersionPanel(
|
|
25704
|
+
document2,
|
|
25705
|
+
messages,
|
|
25706
|
+
signal,
|
|
25707
|
+
agent,
|
|
25708
|
+
{
|
|
25709
|
+
run: (action) => installation(hostId2, agent, action)
|
|
25710
|
+
},
|
|
25711
|
+
onChange
|
|
25712
|
+
);
|
|
25713
|
+
panels.set(key, panel);
|
|
25714
|
+
}
|
|
25715
|
+
return panel;
|
|
25716
|
+
}
|
|
25717
|
+
};
|
|
25718
|
+
}
|
|
25719
|
+
|
|
25720
|
+
// src/settings/connection-updates.ts
|
|
25721
|
+
function createConnectionUpdates(document2, messages, signal, onChange) {
|
|
25722
|
+
const batches = /* @__PURE__ */ new Map();
|
|
25723
|
+
const eligible = (panels) => panels.filter((panel) => panel.state?.updateAvailable && panel.state.canUpdate);
|
|
25724
|
+
const start = async (hostId2, panels) => {
|
|
25725
|
+
if (signal.aborted || batches.get(hostId2)?.running) return;
|
|
25726
|
+
const targets = eligible(panels);
|
|
25727
|
+
if (!targets.length) return;
|
|
25728
|
+
const batch = { running: true, total: targets.length, succeeded: 0, failed: 0 };
|
|
25729
|
+
batches.set(hostId2, batch);
|
|
25730
|
+
onChange();
|
|
25731
|
+
await Promise.all(
|
|
25732
|
+
targets.map(async (panel) => {
|
|
25733
|
+
try {
|
|
25734
|
+
if (await panel.update()) batch.succeeded++;
|
|
25735
|
+
else batch.failed++;
|
|
25736
|
+
} catch {
|
|
25737
|
+
batch.failed++;
|
|
25738
|
+
}
|
|
25739
|
+
if (!signal.aborted) onChange();
|
|
25740
|
+
})
|
|
25741
|
+
);
|
|
25742
|
+
batch.running = false;
|
|
25743
|
+
if (!signal.aborted) onChange();
|
|
25744
|
+
};
|
|
25745
|
+
return {
|
|
25746
|
+
createControls(hostId2, panels) {
|
|
25747
|
+
const batch = batches.get(hostId2);
|
|
25748
|
+
const count3 = eligible(panels).length;
|
|
25749
|
+
const button2 = document2.createElement("button");
|
|
25750
|
+
button2.type = "button";
|
|
25751
|
+
button2.className = "settings-command-button settings-command-button--secondary settings-connection-update-all";
|
|
25752
|
+
button2.dataset.connectionAction = "update-all";
|
|
25753
|
+
button2.disabled = signal.aborted || Boolean(batch?.running) || !count3;
|
|
25754
|
+
button2.title = messages.harnessUpdateAllDescription;
|
|
25755
|
+
const label = batch?.running ? `${messages.harnessUpdateAllProgress} ${batch.succeeded + batch.failed}/${batch.total}` : count3 ? `${messages.harnessUpdateAll} (${count3})` : messages.harnessUpdateAll;
|
|
25756
|
+
button2.append(createRendererSettingsIcon("download", 15), label);
|
|
25757
|
+
button2.addEventListener("click", () => {
|
|
25758
|
+
if (!button2.disabled) void start(hostId2, panels);
|
|
25759
|
+
});
|
|
25760
|
+
const result = document2.createElement("p");
|
|
25761
|
+
result.className = "settings-connection-update-result";
|
|
25762
|
+
result.setAttribute("role", "status");
|
|
25763
|
+
result.hidden = !batch || batch.running;
|
|
25764
|
+
if (batch && !batch.running) {
|
|
25765
|
+
result.textContent = messages.harnessUpdateAllResult.replace("{succeeded}", String(batch.succeeded)).replace("{failed}", String(batch.failed));
|
|
25766
|
+
}
|
|
25767
|
+
return { button: button2, result };
|
|
25768
|
+
}
|
|
25769
|
+
};
|
|
25466
25770
|
}
|
|
25467
25771
|
|
|
25468
25772
|
// src/settings/selection-scroll.ts
|
|
@@ -25732,6 +26036,7 @@ ${error51.stderrTail}`] : []
|
|
|
25732
26036
|
status.dataset.connectionTone = connectionStatusTone(item.availability, item.error !== null);
|
|
25733
26037
|
status.setAttribute("role", "cell");
|
|
25734
26038
|
status.textContent = item.error?.code === "authenticationRequired" ? messages.connectionLoginRequired : item.error?.code === "configurationRequired" ? messages.connectionConfigurationRequired : connectionStatusLabel(item.availability, messages, item.error !== null);
|
|
26039
|
+
const version2 = item.version;
|
|
25735
26040
|
const action = document2.createElement("div");
|
|
25736
26041
|
action.className = "settings-connection-row__action";
|
|
25737
26042
|
action.setAttribute("role", "cell");
|
|
@@ -25747,6 +26052,31 @@ ${error51.stderrTail}`] : []
|
|
|
25747
26052
|
action.append(viewError);
|
|
25748
26053
|
}
|
|
25749
26054
|
if (longContext) action.append(longContext);
|
|
26055
|
+
if (version2?.state?.updateAvailable && !version2.updating) {
|
|
26056
|
+
const available = document2.createElement("span");
|
|
26057
|
+
available.className = "settings-connection-version-available";
|
|
26058
|
+
available.textContent = messages.harnessVersionAvailable;
|
|
26059
|
+
available.title = `${messages.harnessVersionCurrent}: ${version2.state.currentVersion ?? "\u2014"}
|
|
26060
|
+
${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages.harnessVersion)}`;
|
|
26061
|
+
action.append(available);
|
|
26062
|
+
}
|
|
26063
|
+
if (version2?.state?.updateAvailable && version2.state.canUpdate) {
|
|
26064
|
+
const update = document2.createElement("button");
|
|
26065
|
+
update.type = "button";
|
|
26066
|
+
update.className = "settings-connection-install-link";
|
|
26067
|
+
update.dataset.connectionAction = "update";
|
|
26068
|
+
update.disabled = version2.updating;
|
|
26069
|
+
update.title = messages.harnessVersionUpdate;
|
|
26070
|
+
update.setAttribute("aria-label", `${messages.harnessVersionUpdate}: ${item.name}`);
|
|
26071
|
+
update.append(createRendererSettingsIcon("download", 17));
|
|
26072
|
+
update.addEventListener("click", (event) => {
|
|
26073
|
+
event.stopPropagation();
|
|
26074
|
+
if (update.disabled) return;
|
|
26075
|
+
void version2.update();
|
|
26076
|
+
select();
|
|
26077
|
+
});
|
|
26078
|
+
action.append(update);
|
|
26079
|
+
}
|
|
25750
26080
|
if (group) {
|
|
25751
26081
|
const toggle = document2.createElement("button");
|
|
25752
26082
|
toggle.type = "button";
|
|
@@ -26064,9 +26394,7 @@ ${error51.stderrTail}`] : []
|
|
|
26064
26394
|
let selectedHostId = null;
|
|
26065
26395
|
let selectedItemKey = null;
|
|
26066
26396
|
let launchControls = null;
|
|
26067
|
-
const versionPanels = /* @__PURE__ */ new Map();
|
|
26068
26397
|
const longContextControls = /* @__PURE__ */ new Map();
|
|
26069
|
-
const updatingVersions = /* @__PURE__ */ new Set();
|
|
26070
26398
|
const hostNames = /* @__PURE__ */ new Map();
|
|
26071
26399
|
let latestSnapshot = null;
|
|
26072
26400
|
let disposeHostScroller = () => void 0;
|
|
@@ -26113,7 +26441,15 @@ ${error51.stderrTail}`] : []
|
|
|
26113
26441
|
return element;
|
|
26114
26442
|
};
|
|
26115
26443
|
const diagnostics = getDiagnostics();
|
|
26444
|
+
const versions = createConnectionVersions(
|
|
26445
|
+
document2,
|
|
26446
|
+
messages,
|
|
26447
|
+
context.signal,
|
|
26448
|
+
diagnostics,
|
|
26449
|
+
scheduleRender
|
|
26450
|
+
);
|
|
26116
26451
|
const installs = diagnostics ? harnessInstallStore(diagnostics) : null;
|
|
26452
|
+
const updates = createConnectionUpdates(document2, messages, context.signal, scheduleRender);
|
|
26117
26453
|
const runRefresh = () => {
|
|
26118
26454
|
if (pending || !diagnostics) return;
|
|
26119
26455
|
pending = true;
|
|
@@ -26249,10 +26585,13 @@ ${error51.stderrTail}`] : []
|
|
|
26249
26585
|
const agent = item.agentSnapshot?.agent;
|
|
26250
26586
|
if (!agent) return item;
|
|
26251
26587
|
const state = installs?.get(selectedHost.hostId, agent);
|
|
26588
|
+
const availability = state?.status ?? item.availability;
|
|
26589
|
+
const version2 = item.agentSnapshot?.availability !== "notInstalled" && availability !== "installing" && availability !== "checking" ? versions.get(selectedHost.hostId, agent) : void 0;
|
|
26252
26590
|
return {
|
|
26253
26591
|
...item,
|
|
26254
26592
|
...state ? { availability: state.status } : {},
|
|
26255
|
-
...
|
|
26593
|
+
...version2 ? { version: version2 } : {},
|
|
26594
|
+
...version2?.updating ? { availability: "updating" } : {},
|
|
26256
26595
|
...state?.error ? { installError: state.error } : {},
|
|
26257
26596
|
...diagnostics?.installation && harnessHasInstallCommands(item.agentSnapshot?.plugin) ? {
|
|
26258
26597
|
install: () => {
|
|
@@ -26289,30 +26628,7 @@ ${error51.stderrTail}`] : []
|
|
|
26289
26628
|
openExternalUrl
|
|
26290
26629
|
);
|
|
26291
26630
|
launchControls = { hostId: selectedHost.hostId, itemKey: item.key, element };
|
|
26292
|
-
|
|
26293
|
-
const installation = diagnostics?.installation?.bind(diagnostics);
|
|
26294
|
-
if (agent && item.agentSnapshot?.availability !== "notInstalled" && item.availability !== "installing" && item.availability !== "checking" && installation) {
|
|
26295
|
-
const key = JSON.stringify([selectedHost.hostId, agent]);
|
|
26296
|
-
let panel = versionPanels.get(key);
|
|
26297
|
-
if (!panel) {
|
|
26298
|
-
const hostId2 = selectedHost.hostId;
|
|
26299
|
-
panel = createHarnessVersionPanel(document2, messages, context.signal, agent, {
|
|
26300
|
-
async run(action) {
|
|
26301
|
-
if (action !== "update") return installation(hostId2, agent, action);
|
|
26302
|
-
updatingVersions.add(key);
|
|
26303
|
-
if (diagnostics) render(diagnostics.snapshot());
|
|
26304
|
-
try {
|
|
26305
|
-
return await installation(hostId2, agent, action);
|
|
26306
|
-
} finally {
|
|
26307
|
-
updatingVersions.delete(key);
|
|
26308
|
-
if (!context.signal.aborted && diagnostics) render(diagnostics.snapshot());
|
|
26309
|
-
}
|
|
26310
|
-
}
|
|
26311
|
-
});
|
|
26312
|
-
versionPanels.set(key, panel);
|
|
26313
|
-
}
|
|
26314
|
-
inspector.append(panel);
|
|
26315
|
-
}
|
|
26631
|
+
if (item.version) inspector.append(item.version.element);
|
|
26316
26632
|
};
|
|
26317
26633
|
for (const pinnedItem of items.filter((item) => !item.agentSnapshot)) {
|
|
26318
26634
|
const row = createConnectionRow(
|
|
@@ -26507,7 +26823,14 @@ ${error51.stderrTail}`] : []
|
|
|
26507
26823
|
}
|
|
26508
26824
|
const selectedItem = items.find((item) => item.key === selectedItemKey) ?? items[0];
|
|
26509
26825
|
if (selectedItem) selectItem(selectedItem);
|
|
26510
|
-
|
|
26826
|
+
const updateControls = updates.createControls(
|
|
26827
|
+
selectedHost.hostId,
|
|
26828
|
+
items.flatMap((item) => item.version ? [item.version] : [])
|
|
26829
|
+
);
|
|
26830
|
+
const hostHeader = document2.createElement("div");
|
|
26831
|
+
hostHeader.className = "settings-connection-host-header";
|
|
26832
|
+
hostHeader.append(hostStrip, updateControls.button);
|
|
26833
|
+
list.append(hostHeader, updateControls.result, tableHeader, rows);
|
|
26511
26834
|
layout.append(list, inspector);
|
|
26512
26835
|
content.replaceChildren(layout);
|
|
26513
26836
|
disposeHostScroller = configureHostScroller(
|
|
@@ -30019,7 +30342,7 @@ ${error51.stderrTail}`] : []
|
|
|
30019
30342
|
}
|
|
30020
30343
|
});
|
|
30021
30344
|
}
|
|
30022
|
-
function createDefaultRendererSettingsPages(messages = DEFAULT_RENDERER_SETTINGS_MESSAGES, getUpdateClient = () => null, getDiagnostics = () => null, getAccountClient = () => null, getSessionImportClient = () => null, openImportedThread = () => Promise.reject(new Error("Imported Thread navigation is unavailable")), getLoadedSessionsClient = () => null, getRemoteConnections = () => null, requestUsageStatistics = () => Promise.reject(new Error("Local Host connection is unavailable"))) {
|
|
30345
|
+
function createDefaultRendererSettingsPages(messages = DEFAULT_RENDERER_SETTINGS_MESSAGES, getUpdateClient = () => null, getDiagnostics = () => null, getAccountClient = () => null, getSessionImportClient = () => null, openImportedThread = () => Promise.reject(new Error("Imported Thread navigation is unavailable")), getLoadedSessionsClient = () => null, getRemoteConnections = () => null, requestUsageStatistics = () => Promise.reject(new Error("Local Host connection is unavailable")), usageStatisticsHosts) {
|
|
30023
30346
|
return Object.freeze([
|
|
30024
30347
|
createConnectionsSettingsPage(messages, getDiagnostics, void 0, getRemoteConnections, () => {
|
|
30025
30348
|
const client = getUpdateClient();
|
|
@@ -30036,7 +30359,8 @@ ${error51.stderrTail}`] : []
|
|
|
30036
30359
|
createUsageStatisticsPage(
|
|
30037
30360
|
consoleMessages(messages.locale),
|
|
30038
30361
|
requestUsageStatistics,
|
|
30039
|
-
messages.locale
|
|
30362
|
+
messages.locale,
|
|
30363
|
+
usageStatisticsHosts
|
|
30040
30364
|
),
|
|
30041
30365
|
createAppearanceSettingsPage(messages, getLoadedSessionsClient),
|
|
30042
30366
|
createPluginsSettingsPage(messages, getDiagnostics),
|
|
@@ -30835,6 +31159,20 @@ ${error51.stderrTail}`] : []
|
|
|
30835
31159
|
gap: 16px;
|
|
30836
31160
|
}
|
|
30837
31161
|
|
|
31162
|
+
.settings-connections-content {
|
|
31163
|
+
container: settings-connections / inline-size;
|
|
31164
|
+
}
|
|
31165
|
+
|
|
31166
|
+
@container settings-connections (max-width: 780px) {
|
|
31167
|
+
.settings-connections-layout {
|
|
31168
|
+
grid-template-columns: minmax(0, 1fr);
|
|
31169
|
+
}
|
|
31170
|
+
|
|
31171
|
+
.settings-connection-inspector {
|
|
31172
|
+
position: static;
|
|
31173
|
+
}
|
|
31174
|
+
}
|
|
31175
|
+
|
|
30838
31176
|
.settings-connection-list {
|
|
30839
31177
|
overflow: hidden;
|
|
30840
31178
|
background: var(--settings-surface);
|
|
@@ -30842,14 +31180,36 @@ ${error51.stderrTail}`] : []
|
|
|
30842
31180
|
border-radius: 10px;
|
|
30843
31181
|
}
|
|
30844
31182
|
|
|
31183
|
+
.settings-connection-host-header {
|
|
31184
|
+
display: flex;
|
|
31185
|
+
align-items: center;
|
|
31186
|
+
min-width: 0;
|
|
31187
|
+
border-bottom: 1px solid var(--settings-divider);
|
|
31188
|
+
}
|
|
31189
|
+
|
|
31190
|
+
.settings-connection-update-all {
|
|
31191
|
+
flex: none;
|
|
31192
|
+
margin-right: 10px;
|
|
31193
|
+
white-space: nowrap;
|
|
31194
|
+
}
|
|
31195
|
+
|
|
31196
|
+
.settings-connection-update-result {
|
|
31197
|
+
margin: 0;
|
|
31198
|
+
padding: 7px 10px;
|
|
31199
|
+
color: var(--settings-muted);
|
|
31200
|
+
font-size: 11px;
|
|
31201
|
+
line-height: 18px;
|
|
31202
|
+
border-bottom: 1px solid var(--settings-divider);
|
|
31203
|
+
}
|
|
31204
|
+
|
|
30845
31205
|
.settings-connection-host-strip {
|
|
30846
31206
|
display: grid;
|
|
31207
|
+
flex: 1;
|
|
30847
31208
|
grid-template-columns: 28px minmax(0, 1fr) 28px;
|
|
30848
31209
|
align-items: center;
|
|
30849
31210
|
min-width: 0;
|
|
30850
31211
|
gap: 6px;
|
|
30851
31212
|
padding: 10px 12px;
|
|
30852
|
-
border-bottom: 1px solid var(--settings-divider);
|
|
30853
31213
|
}
|
|
30854
31214
|
|
|
30855
31215
|
.settings-connection-host-scroll {
|
|
@@ -31109,6 +31469,14 @@ ${error51.stderrTail}`] : []
|
|
|
31109
31469
|
line-height: 18px;
|
|
31110
31470
|
}
|
|
31111
31471
|
|
|
31472
|
+
.settings-connection-version-available {
|
|
31473
|
+
flex: none;
|
|
31474
|
+
color: var(--settings-muted);
|
|
31475
|
+
font-size: 10px;
|
|
31476
|
+
line-height: 16px;
|
|
31477
|
+
white-space: nowrap;
|
|
31478
|
+
}
|
|
31479
|
+
|
|
31112
31480
|
.settings-connection-row__status::before {
|
|
31113
31481
|
width: 6px;
|
|
31114
31482
|
height: 6px;
|
|
@@ -31145,6 +31513,7 @@ ${error51.stderrTail}`] : []
|
|
|
31145
31513
|
justify-content: flex-end;
|
|
31146
31514
|
min-width: 0;
|
|
31147
31515
|
gap: 4px;
|
|
31516
|
+
white-space: nowrap;
|
|
31148
31517
|
}
|
|
31149
31518
|
|
|
31150
31519
|
.settings-connection-row__handle {
|