@karlorz/codexhost-cli-darwin-x64 0.13.3-6 → 0.14.0-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 +539 -95
- package/app/console-web.js +879 -73
- package/app/cpa-live-voice-hook.js +605 -37
- package/app/desktop-controller.mjs +94 -9
- package/app/host-runtime.mjs +1662 -642
- package/app/plugins/antigravity/plugin.mjs +113 -13
- package/app/plugins/claude-code/plugin.mjs +429 -26
- package/app/plugins/codebuddy/plugin.mjs +139 -22
- package/app/plugins/codex-usage/plugin.mjs +198 -74
- package/app/plugins/copilot/assets/icon.png +0 -0
- package/app/plugins/copilot/manifest.json +26 -0
- package/app/plugins/copilot/plugin.mjs +34645 -0
- package/app/plugins/cursor-cli/plugin.mjs +20877 -44973
- package/app/plugins/deepseek-harness/plugin.mjs +105 -11
- package/app/plugins/enabled.json +1 -0
- package/app/plugins/grok/plugin.mjs +1073 -214
- package/app/plugins/hermes/plugin.mjs +102 -9
- package/app/plugins/kimi-code/plugin.mjs +98 -7
- package/app/plugins/kiro-cli/plugin.mjs +98 -7
- package/app/plugins/omp/plugin.mjs +2177 -2000
- package/app/plugins/opencode/plugin.mjs +107 -11
- package/app/plugins/pi/plugin.mjs +2554 -2285
- package/app/plugins/qoder/plugin.mjs +105 -11
- package/app/plugins/qoder-cn/plugin.mjs +105 -11
- package/app/plugins/workbuddy/plugin.mjs +400 -46
- package/app/plugins/zcode/plugin.mjs +106 -11
- package/app/renderer-extension.js +2717 -1237
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
|
@@ -14656,10 +14656,19 @@ var model = external_exports.string().min(1).max(512);
|
|
|
14656
14656
|
var project = external_exports.string().min(1).max(4096);
|
|
14657
14657
|
var usageStatisticsParamsSchema = external_exports.strictObject({
|
|
14658
14658
|
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
14659
|
+
/** Display timezone for ranges, dates and hourly buckets; omitted means the Host's local zone. */
|
|
14660
|
+
timeZone: external_exports.string().min(1).max(128).refine((value) => {
|
|
14661
|
+
try {
|
|
14662
|
+
new Intl.DateTimeFormat("en", { timeZone: value });
|
|
14663
|
+
return true;
|
|
14664
|
+
} catch {
|
|
14665
|
+
return false;
|
|
14666
|
+
}
|
|
14667
|
+
}, "Unsupported usage statistics timezone").optional(),
|
|
14659
14668
|
harness: harness.optional(),
|
|
14660
14669
|
model: model.nullable().optional(),
|
|
14661
14670
|
project: project.nullable().optional(),
|
|
14662
|
-
/** One
|
|
14671
|
+
/** One date in the query timezone inside the range. */
|
|
14663
14672
|
date: localDate.optional()
|
|
14664
14673
|
});
|
|
14665
14674
|
var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
@@ -14695,7 +14704,7 @@ var usageStatisticsSessionSchema = external_exports.strictObject({
|
|
|
14695
14704
|
});
|
|
14696
14705
|
var usageStatisticsResultSchema = external_exports.strictObject({
|
|
14697
14706
|
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
14698
|
-
/** First
|
|
14707
|
+
/** First date in the query timezone (Host local when omitted); null for all time. */
|
|
14699
14708
|
from: localDate.nullable(),
|
|
14700
14709
|
to: localDate,
|
|
14701
14710
|
/** The filters these figures apply, echoed so a late answer to older filters is recognised. */
|
|
@@ -14735,7 +14744,7 @@ var usageStatisticsResultSchema = external_exports.strictObject({
|
|
|
14735
14744
|
totals: usageStatisticsTotalsSchema,
|
|
14736
14745
|
/** Each date and Harness of the range: every filter except the day. */
|
|
14737
14746
|
daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
|
|
14738
|
-
/**
|
|
14747
|
+
/** Weekday (0 = Sunday) and hour in the query timezone, all filters applied. */
|
|
14739
14748
|
hourly: external_exports.array(external_exports.strictObject({
|
|
14740
14749
|
weekday: external_exports.number().int().min(0).max(6),
|
|
14741
14750
|
hour: external_exports.number().int().min(0).max(23),
|
|
@@ -14826,8 +14835,12 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
14826
14835
|
"codexhost/harness/display-settings/set",
|
|
14827
14836
|
"codexhost/harness/inspect",
|
|
14828
14837
|
"codexhost/harness/installation",
|
|
14838
|
+
"codexhost/harness/installation/start",
|
|
14839
|
+
"codexhost/harness/installation/status",
|
|
14829
14840
|
"codexhost/harness/launch-settings/get",
|
|
14830
14841
|
"codexhost/harness/launch-settings/set",
|
|
14842
|
+
"codexhost/harness/grok-computer-use/get",
|
|
14843
|
+
"codexhost/harness/grok-computer-use/set",
|
|
14831
14844
|
"codexhost/harness/web-ui/open",
|
|
14832
14845
|
"codexhost/harness/accounts/sources",
|
|
14833
14846
|
"codexhost/harness/accounts/list",
|
|
@@ -14901,7 +14914,18 @@ var threadManualCompactionStartedSchema = external_exports.strictObject({
|
|
|
14901
14914
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
14902
14915
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
14903
14916
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
14917
|
+
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
|
|
14918
|
+
var composerIndicatorsSchema = external_exports.array(external_exports.object({
|
|
14919
|
+
kind: external_exports.literal("countdown"),
|
|
14920
|
+
id: external_exports.string().min(1).max(64),
|
|
14921
|
+
expiresAtUnix: nonNegativeSafeIntegerSchema,
|
|
14922
|
+
label: indicatorTextSchema(256).optional(),
|
|
14923
|
+
tooltip: indicatorTextSchema(1024).optional()
|
|
14924
|
+
}).strict()).max(2).refine((entries) => new Set(entries.map(({ id }) => id)).size === entries.length, {
|
|
14925
|
+
message: "Composer indicator IDs must be unique"
|
|
14926
|
+
});
|
|
14904
14927
|
var threadUsageSnapshotSchema = external_exports.object({
|
|
14928
|
+
composerIndicators: composerIndicatorsSchema.optional(),
|
|
14905
14929
|
inputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
14906
14930
|
cachedInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
14907
14931
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
@@ -15309,7 +15333,9 @@ var harnessSessionCapabilitiesSchema = external_exports.object({
|
|
|
15309
15333
|
}).strict().optional(),
|
|
15310
15334
|
autonomousTurns: external_exports.object({
|
|
15311
15335
|
observe: external_exports.boolean()
|
|
15312
|
-
}).strict().optional()
|
|
15336
|
+
}).strict().optional(),
|
|
15337
|
+
/** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
|
|
15338
|
+
steer: external_exports.boolean().optional()
|
|
15313
15339
|
}).strict();
|
|
15314
15340
|
var harnessConfigurationStateSchema = external_exports.object({
|
|
15315
15341
|
effectiveModel: harnessModelRefSchema.optional(),
|
|
@@ -15356,7 +15382,9 @@ var harnessInspectionSchema = external_exports.union([
|
|
|
15356
15382
|
var harnessInspectParamsSchema = external_exports.object({
|
|
15357
15383
|
harnessId: harnessIdSchema,
|
|
15358
15384
|
cwd: nonBlankTextSchema2.max(16384).optional(),
|
|
15359
|
-
refresh: external_exports.boolean().optional()
|
|
15385
|
+
refresh: external_exports.boolean().optional(),
|
|
15386
|
+
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
15387
|
+
purpose: external_exports.literal("availability").optional()
|
|
15360
15388
|
}).strict();
|
|
15361
15389
|
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
15362
15390
|
harnessId: harnessIdSchema
|
|
@@ -15439,6 +15467,15 @@ var threadOwnershipListResultSchema = external_exports.object({
|
|
|
15439
15467
|
seen.add(thread.threadId);
|
|
15440
15468
|
}
|
|
15441
15469
|
});
|
|
15470
|
+
var threadSteeringInspectParamsSchema = external_exports.object({
|
|
15471
|
+
threadId: hostThreadIdSchema,
|
|
15472
|
+
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
15473
|
+
text: external_exports.string().optional()
|
|
15474
|
+
}).strict();
|
|
15475
|
+
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
15476
|
+
var threadSteeringInspectResultSchema = external_exports.object({
|
|
15477
|
+
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
15478
|
+
}).strict();
|
|
15442
15479
|
|
|
15443
15480
|
// ../../shared-contracts/dist/harness-plugins.js
|
|
15444
15481
|
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
@@ -15530,6 +15567,26 @@ var harnessLaunchSettingsSchema = external_exports.object({
|
|
|
15530
15567
|
restartRequired: external_exports.boolean()
|
|
15531
15568
|
}).strict();
|
|
15532
15569
|
|
|
15570
|
+
// ../../shared-contracts/dist/grok-computer-use.js
|
|
15571
|
+
var grokComputerUseGetSchema = external_exports.object({}).strict();
|
|
15572
|
+
var grokComputerUseSetSchema = external_exports.object({
|
|
15573
|
+
enabled: external_exports.boolean().optional(),
|
|
15574
|
+
browser: external_exports.boolean().optional()
|
|
15575
|
+
}).strict().refine((value) => value.enabled !== void 0 || value.browser !== void 0, {
|
|
15576
|
+
message: "Expected enabled or browser"
|
|
15577
|
+
});
|
|
15578
|
+
var grokComputerUseSettingsSchema = external_exports.object({
|
|
15579
|
+
enabled: external_exports.boolean(),
|
|
15580
|
+
available: external_exports.boolean(),
|
|
15581
|
+
unavailableReason: external_exports.string().min(1).max(500).optional(),
|
|
15582
|
+
browser: external_exports.boolean().optional(),
|
|
15583
|
+
browserFilesPresent: external_exports.boolean().optional(),
|
|
15584
|
+
browserAvailable: external_exports.boolean().optional(),
|
|
15585
|
+
browserUnavailableReason: external_exports.string().min(1).max(500).optional(),
|
|
15586
|
+
applyFailed: external_exports.boolean().optional(),
|
|
15587
|
+
applyError: external_exports.string().min(1).max(500).optional()
|
|
15588
|
+
}).strict();
|
|
15589
|
+
|
|
15533
15590
|
// ../../shared-contracts/dist/harness-installation.js
|
|
15534
15591
|
var harnessInstallationParamsSchema = external_exports.object({
|
|
15535
15592
|
harnessId: harnessIdSchema,
|
|
@@ -15540,6 +15597,10 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
15540
15597
|
latestVersion: external_exports.string().min(1).max(128),
|
|
15541
15598
|
updateAvailable: external_exports.boolean(),
|
|
15542
15599
|
canUpdate: external_exports.boolean(),
|
|
15600
|
+
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
15601
|
+
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
15602
|
+
/** Official download opened by the user; does not imply an automatic installation. */
|
|
15603
|
+
manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
|
|
15543
15604
|
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
15544
15605
|
message: external_exports.string().max(2048).optional(),
|
|
15545
15606
|
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
@@ -15547,6 +15608,20 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
15547
15608
|
notice: harnessLocalizedTextSchema.optional(),
|
|
15548
15609
|
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
15549
15610
|
}).strict();
|
|
15611
|
+
var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
|
|
15612
|
+
var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
|
|
15613
|
+
external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
|
|
15614
|
+
external_exports.object({
|
|
15615
|
+
taskId: external_exports.string().uuid(),
|
|
15616
|
+
status: external_exports.literal("succeeded"),
|
|
15617
|
+
result: harnessInstallationStateSchema
|
|
15618
|
+
}).strict(),
|
|
15619
|
+
external_exports.object({
|
|
15620
|
+
taskId: external_exports.string().uuid(),
|
|
15621
|
+
status: external_exports.literal("failed"),
|
|
15622
|
+
error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
|
|
15623
|
+
}).strict()
|
|
15624
|
+
]);
|
|
15550
15625
|
|
|
15551
15626
|
// ../../shared-contracts/dist/codex-accounts.js
|
|
15552
15627
|
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
@@ -15981,6 +16056,13 @@ import { setImmediate as yieldToEventLoop } from "node:timers/promises";
|
|
|
15981
16056
|
// ../../harness-adapter/dist/usage-statistics.js
|
|
15982
16057
|
import { createReadStream } from "node:fs";
|
|
15983
16058
|
import { createInterface } from "node:readline";
|
|
16059
|
+
var HarnessUsageSourceChangedError = class extends Error {
|
|
16060
|
+
code = "HARNESS_USAGE_SOURCE_CHANGED";
|
|
16061
|
+
/** Plugins may bundle their own copy of this contract, so instanceof is insufficient. */
|
|
16062
|
+
static is(error51) {
|
|
16063
|
+
return typeof error51 === "object" && error51 !== null && "code" in error51 && error51.code === "HARNESS_USAGE_SOURCE_CHANGED";
|
|
16064
|
+
}
|
|
16065
|
+
};
|
|
15984
16066
|
var MAX_SESSION_ID_LENGTH = 512;
|
|
15985
16067
|
var MAX_CWD_LENGTH = 4096;
|
|
15986
16068
|
var MAX_SESSION_TITLE_LENGTH = 200;
|
|
@@ -15992,10 +16074,13 @@ function usageSessionTitle(value) {
|
|
|
15992
16074
|
return void 0;
|
|
15993
16075
|
if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
|
|
15994
16076
|
return normalized;
|
|
15995
|
-
|
|
15996
|
-
|
|
15997
|
-
|
|
15998
|
-
|
|
16077
|
+
let title = "";
|
|
16078
|
+
for (const character of normalized) {
|
|
16079
|
+
if (title.length + character.length >= MAX_SESSION_TITLE_LENGTH)
|
|
16080
|
+
break;
|
|
16081
|
+
title += character;
|
|
16082
|
+
}
|
|
16083
|
+
return `${title.trimEnd()}…`;
|
|
15999
16084
|
}
|
|
16000
16085
|
function sessionIdOk(value) {
|
|
16001
16086
|
return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
|
|
@@ -16498,8 +16583,9 @@ var CodexCounters = class {
|
|
|
16498
16583
|
// dist/rollout-io.js
|
|
16499
16584
|
import { createReadStream as createReadStream2 } from "node:fs";
|
|
16500
16585
|
import { StringDecoder } from "node:string_decoder";
|
|
16501
|
-
import {
|
|
16502
|
-
import {
|
|
16586
|
+
import { pipeline } from "node:stream/promises";
|
|
16587
|
+
import { Readable } from "node:stream";
|
|
16588
|
+
import { constants as zstdConstants, createZstdDecompress } from "node:zlib";
|
|
16503
16589
|
/*!
|
|
16504
16590
|
* Rollout reading: zstd frame walking, streaming copy-prefix comparison.
|
|
16505
16591
|
*
|
|
@@ -16522,74 +16608,103 @@ import { zstdDecompress } from "node:zlib";
|
|
|
16522
16608
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16523
16609
|
* SOFTWARE.
|
|
16524
16610
|
*/
|
|
16525
|
-
var decompress = promisify(zstdDecompress);
|
|
16526
|
-
var MAX_FRAME = 64 * 1024 * 1024;
|
|
16527
16611
|
var MAX_LINE = 128 * 1024 * 1024;
|
|
16528
|
-
function frameSize(data) {
|
|
16529
|
-
if (data.length < 8)
|
|
16530
|
-
return null;
|
|
16531
|
-
const magic = data.readUInt32LE(0);
|
|
16532
|
-
if ((magic & 4294967280) === 407710288) {
|
|
16533
|
-
const size = 8 + data.readUInt32LE(4);
|
|
16534
|
-
if (size > MAX_FRAME)
|
|
16535
|
-
throw new Error("Codex zstd frame exceeds the safety limit");
|
|
16536
|
-
return data.length >= size ? { size, skip: true } : null;
|
|
16537
|
-
}
|
|
16538
|
-
if (magic !== 4247762216)
|
|
16539
|
-
throw new Error("Invalid Codex zstd frame");
|
|
16540
|
-
const descriptor = data.readUInt8(4);
|
|
16541
|
-
if (descriptor & 8)
|
|
16542
|
-
throw new Error("Reserved Codex zstd frame header");
|
|
16543
|
-
const single = descriptor >> 5 & 1;
|
|
16544
|
-
let offset = 5 + (single ? 0 : 1) + ([0, 1, 2, 4][descriptor & 3] ?? 0) + ([single, 2, 4, 8][descriptor >> 6] ?? 0);
|
|
16545
|
-
for (; ; ) {
|
|
16546
|
-
if (offset + 3 > data.length)
|
|
16547
|
-
return null;
|
|
16548
|
-
const block = data.readUIntLE(offset, 3);
|
|
16549
|
-
const type = block >> 1 & 3;
|
|
16550
|
-
if (type === 3)
|
|
16551
|
-
throw new Error("Reserved Codex zstd block");
|
|
16552
|
-
offset += 3 + (type === 1 ? 1 : block >>> 3);
|
|
16553
|
-
if (offset > MAX_FRAME)
|
|
16554
|
-
throw new Error("Codex zstd frame exceeds the safety limit");
|
|
16555
|
-
if (block & 1)
|
|
16556
|
-
break;
|
|
16557
|
-
}
|
|
16558
|
-
if (descriptor & 4)
|
|
16559
|
-
offset += 4;
|
|
16560
|
-
return data.length >= offset ? { size: offset, skip: false } : null;
|
|
16561
|
-
}
|
|
16562
16612
|
async function* rolloutBytes(file2, signal) {
|
|
16563
16613
|
signal.throwIfAborted();
|
|
16564
16614
|
const stream = createReadStream2(file2, { signal });
|
|
16565
|
-
let pending = Buffer.alloc(0);
|
|
16566
16615
|
try {
|
|
16567
|
-
|
|
16568
|
-
|
|
16569
|
-
|
|
16570
|
-
if (!file2.endsWith(".zst")) {
|
|
16616
|
+
if (!file2.endsWith(".zst")) {
|
|
16617
|
+
for await (const chunk of stream) {
|
|
16618
|
+
signal.throwIfAborted();
|
|
16571
16619
|
yield chunk;
|
|
16620
|
+
}
|
|
16621
|
+
return;
|
|
16622
|
+
}
|
|
16623
|
+
const input = stream[Symbol.asyncIterator]();
|
|
16624
|
+
let pending = Buffer.alloc(0);
|
|
16625
|
+
async function readExact(size, allowEof = false) {
|
|
16626
|
+
const parts = [];
|
|
16627
|
+
let length = 0;
|
|
16628
|
+
while (length < size) {
|
|
16629
|
+
signal.throwIfAborted();
|
|
16630
|
+
if (!pending.length) {
|
|
16631
|
+
const next = await input.next();
|
|
16632
|
+
if (next.done) {
|
|
16633
|
+
if (allowEof && !length)
|
|
16634
|
+
return Buffer.alloc(0);
|
|
16635
|
+
throw new Error("Truncated Codex zstd rollout");
|
|
16636
|
+
}
|
|
16637
|
+
pending = next.value;
|
|
16638
|
+
}
|
|
16639
|
+
const count2 = Math.min(size - length, pending.length);
|
|
16640
|
+
parts.push(pending.subarray(0, count2));
|
|
16641
|
+
pending = pending.subarray(count2);
|
|
16642
|
+
length += count2;
|
|
16643
|
+
}
|
|
16644
|
+
return Buffer.concat(parts, length);
|
|
16645
|
+
}
|
|
16646
|
+
for (; ; ) {
|
|
16647
|
+
const magicBytes = await readExact(4, true);
|
|
16648
|
+
if (!magicBytes.length)
|
|
16649
|
+
break;
|
|
16650
|
+
const magic = magicBytes.readUInt32LE(0);
|
|
16651
|
+
if ((magic & 4294967280) === 407710288) {
|
|
16652
|
+
let size = (await readExact(4)).readUInt32LE(0);
|
|
16653
|
+
while (size) {
|
|
16654
|
+
const count2 = Math.min(size, 64 * 1024);
|
|
16655
|
+
await readExact(count2);
|
|
16656
|
+
size -= count2;
|
|
16657
|
+
}
|
|
16572
16658
|
continue;
|
|
16573
16659
|
}
|
|
16574
|
-
|
|
16575
|
-
|
|
16576
|
-
|
|
16577
|
-
|
|
16578
|
-
|
|
16579
|
-
|
|
16580
|
-
|
|
16581
|
-
|
|
16582
|
-
|
|
16660
|
+
if (magic !== 4247762216)
|
|
16661
|
+
throw new Error("Invalid Codex zstd frame");
|
|
16662
|
+
const descriptorBytes = await readExact(1);
|
|
16663
|
+
const descriptor = descriptorBytes.readUInt8(0);
|
|
16664
|
+
if (descriptor & 8)
|
|
16665
|
+
throw new Error("Reserved Codex zstd frame header");
|
|
16666
|
+
const single = descriptor >> 5 & 1;
|
|
16667
|
+
const headerSize = (single ? 0 : 1) + ([0, 1, 2, 4][descriptor & 3] ?? 0) + ([single, 2, 4, 8][descriptor >> 6] ?? 0);
|
|
16668
|
+
const header = Buffer.concat([magicBytes, descriptorBytes, await readExact(headerSize)]);
|
|
16669
|
+
async function* frameChunks() {
|
|
16670
|
+
yield header;
|
|
16671
|
+
for (; ; ) {
|
|
16672
|
+
const blockBytes = await readExact(3);
|
|
16673
|
+
const block = blockBytes.readUIntLE(0, 3);
|
|
16674
|
+
const type = block >> 1 & 3;
|
|
16675
|
+
if (type === 3)
|
|
16676
|
+
throw new Error("Reserved Codex zstd block");
|
|
16677
|
+
const blockSize = block >>> 3;
|
|
16678
|
+
if (blockSize > 128 * 1024)
|
|
16679
|
+
throw new Error("Invalid Codex zstd block size");
|
|
16680
|
+
yield blockBytes;
|
|
16681
|
+
yield await readExact(type === 1 ? 1 : blockSize);
|
|
16682
|
+
if (block & 1)
|
|
16683
|
+
break;
|
|
16684
|
+
}
|
|
16685
|
+
if (descriptor & 4)
|
|
16686
|
+
yield await readExact(4);
|
|
16687
|
+
}
|
|
16688
|
+
const frame = Readable.from(frameChunks(), { objectMode: false });
|
|
16689
|
+
const decoder = createZstdDecompress({
|
|
16690
|
+
chunkSize: 64 * 1024,
|
|
16691
|
+
params: { [zstdConstants.ZSTD_d_windowLogMax]: 27 }
|
|
16692
|
+
});
|
|
16693
|
+
const completed = pipeline(frame, decoder, { signal }).then(() => null, (error51) => error51);
|
|
16694
|
+
try {
|
|
16695
|
+
for await (const chunk of decoder) {
|
|
16583
16696
|
signal.throwIfAborted();
|
|
16584
|
-
yield
|
|
16697
|
+
yield chunk;
|
|
16585
16698
|
}
|
|
16586
|
-
|
|
16699
|
+
const error51 = await completed;
|
|
16700
|
+
if (error51)
|
|
16701
|
+
throw error51;
|
|
16702
|
+
} finally {
|
|
16703
|
+
frame.destroy();
|
|
16704
|
+
decoder.destroy();
|
|
16705
|
+
await completed;
|
|
16587
16706
|
}
|
|
16588
|
-
if (pending.length > MAX_FRAME)
|
|
16589
|
-
throw new Error("Codex zstd frame exceeds the safety limit");
|
|
16590
16707
|
}
|
|
16591
|
-
if (pending.length)
|
|
16592
|
-
throw new Error("Truncated Codex zstd rollout");
|
|
16593
16708
|
} finally {
|
|
16594
16709
|
stream.destroy();
|
|
16595
16710
|
}
|
|
@@ -16663,12 +16778,17 @@ var ROW_KINDS = /* @__PURE__ */ new Set([
|
|
|
16663
16778
|
]);
|
|
16664
16779
|
var HEAD_TYPE = /"type"\s*:\s*"([^"]+)"/u;
|
|
16665
16780
|
var TAIL_TYPE = /"type"\s*:\s*"([^"]+)"\s*\}\s*$/u;
|
|
16781
|
+
var USER_ROLE = /"role"\s*:\s*"user"/u;
|
|
16782
|
+
var EVENT_OF_INTEREST = /"type"\s*:\s*"(?:token_count|task_started|thread_settings_applied|user_message)"/u;
|
|
16666
16783
|
function rowKind(line) {
|
|
16667
16784
|
const head = HEAD_TYPE.exec(line.slice(0, 1024))?.[1];
|
|
16668
16785
|
if (head && ROW_KINDS.has(head))
|
|
16669
16786
|
return head;
|
|
16670
16787
|
return TAIL_TYPE.exec(line.slice(-1024))?.[1] ?? head;
|
|
16671
16788
|
}
|
|
16789
|
+
function markerIn(pattern, line) {
|
|
16790
|
+
return pattern.test(line.slice(0, 1024)) || pattern.test(line.slice(-1024));
|
|
16791
|
+
}
|
|
16672
16792
|
async function stamp(file2) {
|
|
16673
16793
|
const s = await lstat(file2, { bigint: true });
|
|
16674
16794
|
if (!s.isFile())
|
|
@@ -16732,9 +16852,9 @@ async function readCodexRollouts(files, thread, signal, options = {}) {
|
|
|
16732
16852
|
options.onIncomplete?.();
|
|
16733
16853
|
if (!kind || !ROW_KINDS.has(kind))
|
|
16734
16854
|
continue;
|
|
16735
|
-
if (kind === "response_item" &&
|
|
16855
|
+
if (kind === "response_item" && !markerIn(USER_ROLE, line))
|
|
16736
16856
|
continue;
|
|
16737
|
-
if (kind === "event_msg" &&
|
|
16857
|
+
if (kind === "event_msg" && !markerIn(EVENT_OF_INTEREST, line))
|
|
16738
16858
|
continue;
|
|
16739
16859
|
let row;
|
|
16740
16860
|
try {
|
|
@@ -16785,8 +16905,10 @@ async function readCodexRollouts(files, thread, signal, options = {}) {
|
|
|
16785
16905
|
break;
|
|
16786
16906
|
}
|
|
16787
16907
|
case "response_item":
|
|
16788
|
-
|
|
16789
|
-
|
|
16908
|
+
if (p.type === "message" && p.role === "user") {
|
|
16909
|
+
counters.boundary();
|
|
16910
|
+
firstPrompt ??= userItemPrompt(p);
|
|
16911
|
+
}
|
|
16790
16912
|
break;
|
|
16791
16913
|
case "event_msg":
|
|
16792
16914
|
if (p.type === "task_started") {
|
|
@@ -16916,7 +17038,7 @@ function createCodexUsageStatistics(environment, options = {}) {
|
|
|
16916
17038
|
const entries = await readCodexRollouts(kept.map(({ file: file2 }) => file2), group.thread, signal, options);
|
|
16917
17039
|
for (const file2 of group.files)
|
|
16918
17040
|
if (await stamp(file2.file) !== file2.fingerprint)
|
|
16919
|
-
throw new
|
|
17041
|
+
throw new HarnessUsageSourceChangedError("Codex rollout changed while reading; refresh to retry");
|
|
16920
17042
|
const named = options.sessionId ? void 0 : (await threadNames(signal)).get(group.thread);
|
|
16921
17043
|
return named ? entries.map((entry) => withUsageSession(entry, {
|
|
16922
17044
|
sessionId: entry.sessionId,
|
|
@@ -16957,6 +17079,7 @@ var usageFields = /* @__PURE__ */ new Set([
|
|
|
16957
17079
|
...safeIntegerFields,
|
|
16958
17080
|
...percentFields,
|
|
16959
17081
|
"sessionCacheUsage",
|
|
17082
|
+
"composerIndicators",
|
|
16960
17083
|
"totalCostUsd",
|
|
16961
17084
|
"totalCredits",
|
|
16962
17085
|
"contextUsagePercent",
|
|
@@ -16979,6 +17102,7 @@ function parseHostUsage(value) {
|
|
|
16979
17102
|
throw new Error(`Harness Usage contains unknown field '${key2}'`);
|
|
16980
17103
|
}
|
|
16981
17104
|
}
|
|
17105
|
+
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
16982
17106
|
for (const field of [
|
|
16983
17107
|
"totalCredits",
|
|
16984
17108
|
"contextUsagePercent",
|
|
@@ -17049,9 +17173,9 @@ function parseHostUsage(value) {
|
|
|
17049
17173
|
if (value.costSource !== "publicPrice") {
|
|
17050
17174
|
throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
|
|
17051
17175
|
}
|
|
17052
|
-
return { ...value, unpricedModels: [...models] };
|
|
17176
|
+
return { ...value, ...indicators, unpricedModels: [...models] };
|
|
17053
17177
|
}
|
|
17054
|
-
return { ...value };
|
|
17178
|
+
return { ...value, ...indicators };
|
|
17055
17179
|
}
|
|
17056
17180
|
var requestTokenFields = [
|
|
17057
17181
|
"inputTokens",
|
|
Binary file
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
{
|
|
2
|
+
"manifestVersion": 1,
|
|
3
|
+
"id": "copilot",
|
|
4
|
+
"name": "GitHub Copilot",
|
|
5
|
+
"version": "0.0.0",
|
|
6
|
+
"installation": {
|
|
7
|
+
"commands": [
|
|
8
|
+
{
|
|
9
|
+
"terminal": "npm · macOS / Linux / Windows",
|
|
10
|
+
"command": "npm install -g @github/copilot"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"after": {
|
|
14
|
+
"en": "Run copilot; use /login only if authentication is unavailable. Existing native authentication on the target Host can be reused. CODEXHOST_COPILOT_COMMAND selects an existing CLI installation. Windows npm launchers resolve to that installation's actual JavaScript or executable entrypoint; arbitrary shell wrappers are not supported.",
|
|
15
|
+
"zh-CN": "运行 copilot;若缺少认证,再使用 /login。可复用目标 Host 已有的原生登录;CODEXHOST_COPILOT_COMMAND 可指定已有 CLI 安装。Windows npm 启动器会解析到同一安装的实际 JavaScript 或可执行入口,不支持任意 shell 包装脚本。"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"links": {
|
|
19
|
+
"website": "https://github.com/features/copilot",
|
|
20
|
+
"documentation": "https://docs.github.com/en/copilot/get-started/cli-quickstart",
|
|
21
|
+
"installation": "https://docs.github.com/en/copilot/how-tos/copilot-cli/set-up-copilot-cli/install-copilot-cli"
|
|
22
|
+
},
|
|
23
|
+
"adapterApiVersion": 1,
|
|
24
|
+
"entry": "plugin.mjs",
|
|
25
|
+
"icon": "./assets/icon.png"
|
|
26
|
+
}
|