@codexhost/cli-darwin-x64 0.13.3 → 0.14.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 +58 -5
- package/app/console-web.js +437 -68
- package/app/desktop-controller.mjs +72 -9
- package/app/host-runtime.mjs +766 -214
- package/app/plugins/antigravity/plugin.mjs +91 -13
- package/app/plugins/claude-code/plugin.mjs +407 -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 +34546 -0
- package/app/plugins/cursor-cli/plugin.mjs +20701 -44819
- 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/omp/plugin.mjs +2155 -2000
- package/app/plugins/opencode/plugin.mjs +85 -11
- package/app/plugins/pi/plugin.mjs +2547 -2300
- 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 +834 -163
- 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),
|
|
@@ -14795,6 +14804,8 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
14795
14804
|
"codexhost/harness/display-settings/set",
|
|
14796
14805
|
"codexhost/harness/inspect",
|
|
14797
14806
|
"codexhost/harness/installation",
|
|
14807
|
+
"codexhost/harness/installation/start",
|
|
14808
|
+
"codexhost/harness/installation/status",
|
|
14798
14809
|
"codexhost/harness/launch-settings/get",
|
|
14799
14810
|
"codexhost/harness/launch-settings/set",
|
|
14800
14811
|
"codexhost/harness/web-ui/open",
|
|
@@ -14870,7 +14881,18 @@ var threadManualCompactionStartedSchema = external_exports.strictObject({
|
|
|
14870
14881
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
14871
14882
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
14872
14883
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
14884
|
+
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
|
|
14885
|
+
var composerIndicatorsSchema = external_exports.array(external_exports.object({
|
|
14886
|
+
kind: external_exports.literal("countdown"),
|
|
14887
|
+
id: external_exports.string().min(1).max(64),
|
|
14888
|
+
expiresAtUnix: nonNegativeSafeIntegerSchema,
|
|
14889
|
+
label: indicatorTextSchema(256).optional(),
|
|
14890
|
+
tooltip: indicatorTextSchema(1024).optional()
|
|
14891
|
+
}).strict()).max(2).refine((entries) => new Set(entries.map(({ id }) => id)).size === entries.length, {
|
|
14892
|
+
message: "Composer indicator IDs must be unique"
|
|
14893
|
+
});
|
|
14873
14894
|
var threadUsageSnapshotSchema = external_exports.object({
|
|
14895
|
+
composerIndicators: composerIndicatorsSchema.optional(),
|
|
14874
14896
|
inputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
14875
14897
|
cachedInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
14876
14898
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
@@ -15278,7 +15300,9 @@ var harnessSessionCapabilitiesSchema = external_exports.object({
|
|
|
15278
15300
|
}).strict().optional(),
|
|
15279
15301
|
autonomousTurns: external_exports.object({
|
|
15280
15302
|
observe: external_exports.boolean()
|
|
15281
|
-
}).strict().optional()
|
|
15303
|
+
}).strict().optional(),
|
|
15304
|
+
/** True only when `turn.steer` delivers input into the active Turn through a native primitive. */
|
|
15305
|
+
steer: external_exports.boolean().optional()
|
|
15282
15306
|
}).strict();
|
|
15283
15307
|
var harnessConfigurationStateSchema = external_exports.object({
|
|
15284
15308
|
effectiveModel: harnessModelRefSchema.optional(),
|
|
@@ -15325,7 +15349,9 @@ var harnessInspectionSchema = external_exports.union([
|
|
|
15325
15349
|
var harnessInspectParamsSchema = external_exports.object({
|
|
15326
15350
|
harnessId: harnessIdSchema,
|
|
15327
15351
|
cwd: nonBlankTextSchema2.max(16384).optional(),
|
|
15328
|
-
refresh: external_exports.boolean().optional()
|
|
15352
|
+
refresh: external_exports.boolean().optional(),
|
|
15353
|
+
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
15354
|
+
purpose: external_exports.literal("availability").optional()
|
|
15329
15355
|
}).strict();
|
|
15330
15356
|
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
15331
15357
|
harnessId: harnessIdSchema
|
|
@@ -15408,6 +15434,15 @@ var threadOwnershipListResultSchema = external_exports.object({
|
|
|
15408
15434
|
seen.add(thread.threadId);
|
|
15409
15435
|
}
|
|
15410
15436
|
});
|
|
15437
|
+
var threadSteeringInspectParamsSchema = external_exports.object({
|
|
15438
|
+
threadId: hostThreadIdSchema,
|
|
15439
|
+
/** The text about to be steered; a Harness command always stops and restarts. */
|
|
15440
|
+
text: external_exports.string().optional()
|
|
15441
|
+
}).strict();
|
|
15442
|
+
var threadSteerDeliverySchema = external_exports.enum(["activeTurn", "newTurn"]);
|
|
15443
|
+
var threadSteeringInspectResultSchema = external_exports.object({
|
|
15444
|
+
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
15445
|
+
}).strict();
|
|
15411
15446
|
|
|
15412
15447
|
// ../../shared-contracts/dist/harness-plugins.js
|
|
15413
15448
|
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
@@ -15509,6 +15544,10 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
15509
15544
|
latestVersion: external_exports.string().min(1).max(128),
|
|
15510
15545
|
updateAvailable: external_exports.boolean(),
|
|
15511
15546
|
canUpdate: external_exports.boolean(),
|
|
15547
|
+
/** Defaults to CLI; some Harnesses ship only inside a desktop application. */
|
|
15548
|
+
versionKind: external_exports.enum(["cli", "application"]).optional(),
|
|
15549
|
+
/** Official download opened by the user; does not imply an automatic installation. */
|
|
15550
|
+
manualUpdateUrl: external_exports.url().max(2048).refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Manual updates require a credential-free HTTPS URL").optional(),
|
|
15512
15551
|
// Adapter-owned diagnostic text; UI uses messageCode rather than displaying it verbatim.
|
|
15513
15552
|
message: external_exports.string().max(2048).optional(),
|
|
15514
15553
|
messageCode: external_exports.string().min(1).max(128).optional(),
|
|
@@ -15516,6 +15555,20 @@ var harnessInstallationStateSchema = external_exports.object({
|
|
|
15516
15555
|
notice: harnessLocalizedTextSchema.optional(),
|
|
15517
15556
|
latestVersionKind: external_exports.enum(["unknown", "tracking-branch"]).optional()
|
|
15518
15557
|
}).strict();
|
|
15558
|
+
var harnessInstallationTaskParamsSchema = external_exports.object({ taskId: external_exports.string().uuid() }).strict();
|
|
15559
|
+
var harnessInstallationTaskSchema = external_exports.discriminatedUnion("status", [
|
|
15560
|
+
external_exports.object({ taskId: external_exports.string().uuid(), status: external_exports.literal("running") }).strict(),
|
|
15561
|
+
external_exports.object({
|
|
15562
|
+
taskId: external_exports.string().uuid(),
|
|
15563
|
+
status: external_exports.literal("succeeded"),
|
|
15564
|
+
result: harnessInstallationStateSchema
|
|
15565
|
+
}).strict(),
|
|
15566
|
+
external_exports.object({
|
|
15567
|
+
taskId: external_exports.string().uuid(),
|
|
15568
|
+
status: external_exports.literal("failed"),
|
|
15569
|
+
error: external_exports.object({ code: external_exports.number().int(), message: external_exports.string().min(1).max(2048) }).strict()
|
|
15570
|
+
}).strict()
|
|
15571
|
+
]);
|
|
15519
15572
|
|
|
15520
15573
|
// ../../shared-contracts/dist/codex-accounts.js
|
|
15521
15574
|
var accountIdSchema = external_exports.string().min(1).max(256).regex(/^[A-Za-z0-9._~-]+$/u);
|
|
@@ -15904,6 +15957,13 @@ import { setImmediate as yieldToEventLoop } from "node:timers/promises";
|
|
|
15904
15957
|
// ../../harness-adapter/dist/usage-statistics.js
|
|
15905
15958
|
import { createReadStream } from "node:fs";
|
|
15906
15959
|
import { createInterface } from "node:readline";
|
|
15960
|
+
var HarnessUsageSourceChangedError = class extends Error {
|
|
15961
|
+
code = "HARNESS_USAGE_SOURCE_CHANGED";
|
|
15962
|
+
/** Plugins may bundle their own copy of this contract, so instanceof is insufficient. */
|
|
15963
|
+
static is(error51) {
|
|
15964
|
+
return typeof error51 === "object" && error51 !== null && "code" in error51 && error51.code === "HARNESS_USAGE_SOURCE_CHANGED";
|
|
15965
|
+
}
|
|
15966
|
+
};
|
|
15907
15967
|
var MAX_SESSION_ID_LENGTH = 512;
|
|
15908
15968
|
var MAX_CWD_LENGTH = 4096;
|
|
15909
15969
|
var MAX_SESSION_TITLE_LENGTH = 200;
|
|
@@ -15915,10 +15975,13 @@ function usageSessionTitle(value) {
|
|
|
15915
15975
|
return void 0;
|
|
15916
15976
|
if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
|
|
15917
15977
|
return normalized;
|
|
15918
|
-
|
|
15919
|
-
|
|
15920
|
-
|
|
15921
|
-
|
|
15978
|
+
let title = "";
|
|
15979
|
+
for (const character of normalized) {
|
|
15980
|
+
if (title.length + character.length >= MAX_SESSION_TITLE_LENGTH)
|
|
15981
|
+
break;
|
|
15982
|
+
title += character;
|
|
15983
|
+
}
|
|
15984
|
+
return `${title.trimEnd()}…`;
|
|
15922
15985
|
}
|
|
15923
15986
|
function sessionIdOk(value) {
|
|
15924
15987
|
return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
|
|
@@ -16421,8 +16484,9 @@ var CodexCounters = class {
|
|
|
16421
16484
|
// dist/rollout-io.js
|
|
16422
16485
|
import { createReadStream as createReadStream2 } from "node:fs";
|
|
16423
16486
|
import { StringDecoder } from "node:string_decoder";
|
|
16424
|
-
import {
|
|
16425
|
-
import {
|
|
16487
|
+
import { pipeline } from "node:stream/promises";
|
|
16488
|
+
import { Readable } from "node:stream";
|
|
16489
|
+
import { constants as zstdConstants, createZstdDecompress } from "node:zlib";
|
|
16426
16490
|
/*!
|
|
16427
16491
|
* Rollout reading: zstd frame walking, streaming copy-prefix comparison.
|
|
16428
16492
|
*
|
|
@@ -16445,74 +16509,103 @@ import { zstdDecompress } from "node:zlib";
|
|
|
16445
16509
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16446
16510
|
* SOFTWARE.
|
|
16447
16511
|
*/
|
|
16448
|
-
var decompress = promisify(zstdDecompress);
|
|
16449
|
-
var MAX_FRAME = 64 * 1024 * 1024;
|
|
16450
16512
|
var MAX_LINE = 128 * 1024 * 1024;
|
|
16451
|
-
function frameSize(data) {
|
|
16452
|
-
if (data.length < 8)
|
|
16453
|
-
return null;
|
|
16454
|
-
const magic = data.readUInt32LE(0);
|
|
16455
|
-
if ((magic & 4294967280) === 407710288) {
|
|
16456
|
-
const size = 8 + data.readUInt32LE(4);
|
|
16457
|
-
if (size > MAX_FRAME)
|
|
16458
|
-
throw new Error("Codex zstd frame exceeds the safety limit");
|
|
16459
|
-
return data.length >= size ? { size, skip: true } : null;
|
|
16460
|
-
}
|
|
16461
|
-
if (magic !== 4247762216)
|
|
16462
|
-
throw new Error("Invalid Codex zstd frame");
|
|
16463
|
-
const descriptor = data.readUInt8(4);
|
|
16464
|
-
if (descriptor & 8)
|
|
16465
|
-
throw new Error("Reserved Codex zstd frame header");
|
|
16466
|
-
const single = descriptor >> 5 & 1;
|
|
16467
|
-
let offset = 5 + (single ? 0 : 1) + ([0, 1, 2, 4][descriptor & 3] ?? 0) + ([single, 2, 4, 8][descriptor >> 6] ?? 0);
|
|
16468
|
-
for (; ; ) {
|
|
16469
|
-
if (offset + 3 > data.length)
|
|
16470
|
-
return null;
|
|
16471
|
-
const block = data.readUIntLE(offset, 3);
|
|
16472
|
-
const type = block >> 1 & 3;
|
|
16473
|
-
if (type === 3)
|
|
16474
|
-
throw new Error("Reserved Codex zstd block");
|
|
16475
|
-
offset += 3 + (type === 1 ? 1 : block >>> 3);
|
|
16476
|
-
if (offset > MAX_FRAME)
|
|
16477
|
-
throw new Error("Codex zstd frame exceeds the safety limit");
|
|
16478
|
-
if (block & 1)
|
|
16479
|
-
break;
|
|
16480
|
-
}
|
|
16481
|
-
if (descriptor & 4)
|
|
16482
|
-
offset += 4;
|
|
16483
|
-
return data.length >= offset ? { size: offset, skip: false } : null;
|
|
16484
|
-
}
|
|
16485
16513
|
async function* rolloutBytes(file2, signal) {
|
|
16486
16514
|
signal.throwIfAborted();
|
|
16487
16515
|
const stream = createReadStream2(file2, { signal });
|
|
16488
|
-
let pending = Buffer.alloc(0);
|
|
16489
16516
|
try {
|
|
16490
|
-
|
|
16491
|
-
|
|
16492
|
-
|
|
16493
|
-
if (!file2.endsWith(".zst")) {
|
|
16517
|
+
if (!file2.endsWith(".zst")) {
|
|
16518
|
+
for await (const chunk of stream) {
|
|
16519
|
+
signal.throwIfAborted();
|
|
16494
16520
|
yield chunk;
|
|
16521
|
+
}
|
|
16522
|
+
return;
|
|
16523
|
+
}
|
|
16524
|
+
const input = stream[Symbol.asyncIterator]();
|
|
16525
|
+
let pending = Buffer.alloc(0);
|
|
16526
|
+
async function readExact(size, allowEof = false) {
|
|
16527
|
+
const parts = [];
|
|
16528
|
+
let length = 0;
|
|
16529
|
+
while (length < size) {
|
|
16530
|
+
signal.throwIfAborted();
|
|
16531
|
+
if (!pending.length) {
|
|
16532
|
+
const next = await input.next();
|
|
16533
|
+
if (next.done) {
|
|
16534
|
+
if (allowEof && !length)
|
|
16535
|
+
return Buffer.alloc(0);
|
|
16536
|
+
throw new Error("Truncated Codex zstd rollout");
|
|
16537
|
+
}
|
|
16538
|
+
pending = next.value;
|
|
16539
|
+
}
|
|
16540
|
+
const count2 = Math.min(size - length, pending.length);
|
|
16541
|
+
parts.push(pending.subarray(0, count2));
|
|
16542
|
+
pending = pending.subarray(count2);
|
|
16543
|
+
length += count2;
|
|
16544
|
+
}
|
|
16545
|
+
return Buffer.concat(parts, length);
|
|
16546
|
+
}
|
|
16547
|
+
for (; ; ) {
|
|
16548
|
+
const magicBytes = await readExact(4, true);
|
|
16549
|
+
if (!magicBytes.length)
|
|
16550
|
+
break;
|
|
16551
|
+
const magic = magicBytes.readUInt32LE(0);
|
|
16552
|
+
if ((magic & 4294967280) === 407710288) {
|
|
16553
|
+
let size = (await readExact(4)).readUInt32LE(0);
|
|
16554
|
+
while (size) {
|
|
16555
|
+
const count2 = Math.min(size, 64 * 1024);
|
|
16556
|
+
await readExact(count2);
|
|
16557
|
+
size -= count2;
|
|
16558
|
+
}
|
|
16495
16559
|
continue;
|
|
16496
16560
|
}
|
|
16497
|
-
|
|
16498
|
-
|
|
16499
|
-
|
|
16500
|
-
|
|
16501
|
-
|
|
16502
|
-
|
|
16503
|
-
|
|
16504
|
-
|
|
16505
|
-
|
|
16561
|
+
if (magic !== 4247762216)
|
|
16562
|
+
throw new Error("Invalid Codex zstd frame");
|
|
16563
|
+
const descriptorBytes = await readExact(1);
|
|
16564
|
+
const descriptor = descriptorBytes.readUInt8(0);
|
|
16565
|
+
if (descriptor & 8)
|
|
16566
|
+
throw new Error("Reserved Codex zstd frame header");
|
|
16567
|
+
const single = descriptor >> 5 & 1;
|
|
16568
|
+
const headerSize = (single ? 0 : 1) + ([0, 1, 2, 4][descriptor & 3] ?? 0) + ([single, 2, 4, 8][descriptor >> 6] ?? 0);
|
|
16569
|
+
const header = Buffer.concat([magicBytes, descriptorBytes, await readExact(headerSize)]);
|
|
16570
|
+
async function* frameChunks() {
|
|
16571
|
+
yield header;
|
|
16572
|
+
for (; ; ) {
|
|
16573
|
+
const blockBytes = await readExact(3);
|
|
16574
|
+
const block = blockBytes.readUIntLE(0, 3);
|
|
16575
|
+
const type = block >> 1 & 3;
|
|
16576
|
+
if (type === 3)
|
|
16577
|
+
throw new Error("Reserved Codex zstd block");
|
|
16578
|
+
const blockSize = block >>> 3;
|
|
16579
|
+
if (blockSize > 128 * 1024)
|
|
16580
|
+
throw new Error("Invalid Codex zstd block size");
|
|
16581
|
+
yield blockBytes;
|
|
16582
|
+
yield await readExact(type === 1 ? 1 : blockSize);
|
|
16583
|
+
if (block & 1)
|
|
16584
|
+
break;
|
|
16585
|
+
}
|
|
16586
|
+
if (descriptor & 4)
|
|
16587
|
+
yield await readExact(4);
|
|
16588
|
+
}
|
|
16589
|
+
const frame = Readable.from(frameChunks(), { objectMode: false });
|
|
16590
|
+
const decoder = createZstdDecompress({
|
|
16591
|
+
chunkSize: 64 * 1024,
|
|
16592
|
+
params: { [zstdConstants.ZSTD_d_windowLogMax]: 27 }
|
|
16593
|
+
});
|
|
16594
|
+
const completed = pipeline(frame, decoder, { signal }).then(() => null, (error51) => error51);
|
|
16595
|
+
try {
|
|
16596
|
+
for await (const chunk of decoder) {
|
|
16506
16597
|
signal.throwIfAborted();
|
|
16507
|
-
yield
|
|
16598
|
+
yield chunk;
|
|
16508
16599
|
}
|
|
16509
|
-
|
|
16600
|
+
const error51 = await completed;
|
|
16601
|
+
if (error51)
|
|
16602
|
+
throw error51;
|
|
16603
|
+
} finally {
|
|
16604
|
+
frame.destroy();
|
|
16605
|
+
decoder.destroy();
|
|
16606
|
+
await completed;
|
|
16510
16607
|
}
|
|
16511
|
-
if (pending.length > MAX_FRAME)
|
|
16512
|
-
throw new Error("Codex zstd frame exceeds the safety limit");
|
|
16513
16608
|
}
|
|
16514
|
-
if (pending.length)
|
|
16515
|
-
throw new Error("Truncated Codex zstd rollout");
|
|
16516
16609
|
} finally {
|
|
16517
16610
|
stream.destroy();
|
|
16518
16611
|
}
|
|
@@ -16586,12 +16679,17 @@ var ROW_KINDS = /* @__PURE__ */ new Set([
|
|
|
16586
16679
|
]);
|
|
16587
16680
|
var HEAD_TYPE = /"type"\s*:\s*"([^"]+)"/u;
|
|
16588
16681
|
var TAIL_TYPE = /"type"\s*:\s*"([^"]+)"\s*\}\s*$/u;
|
|
16682
|
+
var USER_ROLE = /"role"\s*:\s*"user"/u;
|
|
16683
|
+
var EVENT_OF_INTEREST = /"type"\s*:\s*"(?:token_count|task_started|thread_settings_applied|user_message)"/u;
|
|
16589
16684
|
function rowKind(line) {
|
|
16590
16685
|
const head = HEAD_TYPE.exec(line.slice(0, 1024))?.[1];
|
|
16591
16686
|
if (head && ROW_KINDS.has(head))
|
|
16592
16687
|
return head;
|
|
16593
16688
|
return TAIL_TYPE.exec(line.slice(-1024))?.[1] ?? head;
|
|
16594
16689
|
}
|
|
16690
|
+
function markerIn(pattern, line) {
|
|
16691
|
+
return pattern.test(line.slice(0, 1024)) || pattern.test(line.slice(-1024));
|
|
16692
|
+
}
|
|
16595
16693
|
async function stamp(file2) {
|
|
16596
16694
|
const s = await lstat(file2, { bigint: true });
|
|
16597
16695
|
if (!s.isFile())
|
|
@@ -16655,9 +16753,9 @@ async function readCodexRollouts(files, thread, signal, options = {}) {
|
|
|
16655
16753
|
options.onIncomplete?.();
|
|
16656
16754
|
if (!kind || !ROW_KINDS.has(kind))
|
|
16657
16755
|
continue;
|
|
16658
|
-
if (kind === "response_item" &&
|
|
16756
|
+
if (kind === "response_item" && !markerIn(USER_ROLE, line))
|
|
16659
16757
|
continue;
|
|
16660
|
-
if (kind === "event_msg" &&
|
|
16758
|
+
if (kind === "event_msg" && !markerIn(EVENT_OF_INTEREST, line))
|
|
16661
16759
|
continue;
|
|
16662
16760
|
let row;
|
|
16663
16761
|
try {
|
|
@@ -16708,8 +16806,10 @@ async function readCodexRollouts(files, thread, signal, options = {}) {
|
|
|
16708
16806
|
break;
|
|
16709
16807
|
}
|
|
16710
16808
|
case "response_item":
|
|
16711
|
-
|
|
16712
|
-
|
|
16809
|
+
if (p.type === "message" && p.role === "user") {
|
|
16810
|
+
counters.boundary();
|
|
16811
|
+
firstPrompt ??= userItemPrompt(p);
|
|
16812
|
+
}
|
|
16713
16813
|
break;
|
|
16714
16814
|
case "event_msg":
|
|
16715
16815
|
if (p.type === "task_started") {
|
|
@@ -16839,7 +16939,7 @@ function createCodexUsageStatistics(environment, options = {}) {
|
|
|
16839
16939
|
const entries = await readCodexRollouts(kept.map(({ file: file2 }) => file2), group.thread, signal, options);
|
|
16840
16940
|
for (const file2 of group.files)
|
|
16841
16941
|
if (await stamp(file2.file) !== file2.fingerprint)
|
|
16842
|
-
throw new
|
|
16942
|
+
throw new HarnessUsageSourceChangedError("Codex rollout changed while reading; refresh to retry");
|
|
16843
16943
|
const named = options.sessionId ? void 0 : (await threadNames(signal)).get(group.thread);
|
|
16844
16944
|
return named ? entries.map((entry) => withUsageSession(entry, {
|
|
16845
16945
|
sessionId: entry.sessionId,
|
|
@@ -16880,6 +16980,7 @@ var usageFields = /* @__PURE__ */ new Set([
|
|
|
16880
16980
|
...safeIntegerFields,
|
|
16881
16981
|
...percentFields,
|
|
16882
16982
|
"sessionCacheUsage",
|
|
16983
|
+
"composerIndicators",
|
|
16883
16984
|
"totalCostUsd",
|
|
16884
16985
|
"totalCredits",
|
|
16885
16986
|
"contextUsagePercent",
|
|
@@ -16902,6 +17003,7 @@ function parseHostUsage(value) {
|
|
|
16902
17003
|
throw new Error(`Harness Usage contains unknown field '${key2}'`);
|
|
16903
17004
|
}
|
|
16904
17005
|
}
|
|
17006
|
+
const indicators = value.composerIndicators === void 0 ? {} : { composerIndicators: composerIndicatorsSchema.parse(value.composerIndicators) };
|
|
16905
17007
|
for (const field of [
|
|
16906
17008
|
"totalCredits",
|
|
16907
17009
|
"contextUsagePercent",
|
|
@@ -16972,9 +17074,9 @@ function parseHostUsage(value) {
|
|
|
16972
17074
|
if (value.costSource !== "publicPrice") {
|
|
16973
17075
|
throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
|
|
16974
17076
|
}
|
|
16975
|
-
return { ...value, unpricedModels: [...models] };
|
|
17077
|
+
return { ...value, ...indicators, unpricedModels: [...models] };
|
|
16976
17078
|
}
|
|
16977
|
-
return { ...value };
|
|
17079
|
+
return { ...value, ...indicators };
|
|
16978
17080
|
}
|
|
16979
17081
|
var requestTokenFields = [
|
|
16980
17082
|
"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
|
+
}
|