@liberseek/boft-cli-linux-x64 0.7.8 → 0.8.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/THIRD_PARTY_NOTICES.txt +8 -0
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +16801 -16440
- package/app/console-web.js +9774 -3685
- package/app/desktop-controller.mjs +16475 -374
- package/app/host-runtime.mjs +9052 -1793
- package/app/plugins/antigravity/manifest.json +18 -1
- package/app/plugins/antigravity/plugin.mjs +357 -42
- package/app/plugins/claude-code/manifest.json +28 -0
- package/app/plugins/claude-code/plugin.mjs +1448 -491
- package/app/plugins/codebuddy/manifest.json +17 -0
- package/app/plugins/codebuddy/plugin.mjs +6589 -5423
- package/app/plugins/codex-usage/manifest.json +9 -0
- package/app/plugins/codex-usage/plugin.mjs +16750 -0
- package/app/plugins/cursor-cli/manifest.json +18 -1
- package/app/plugins/cursor-cli/plugin.mjs +782 -197
- package/app/plugins/deepseek-harness/assets/icon.svg +1 -0
- package/app/plugins/deepseek-harness/manifest.json +35 -2
- package/app/plugins/deepseek-harness/plugin.mjs +879 -242
- package/app/plugins/enabled.json +3 -1
- package/app/plugins/grok/manifest.json +21 -1
- package/app/plugins/grok/plugin.mjs +1274 -241
- package/app/plugins/hermes/assets/icon.png +0 -0
- package/app/plugins/hermes/manifest.json +30 -2
- package/app/plugins/hermes/plugin.mjs +3493 -7686
- package/app/plugins/kimi-code/assets/icon.svg +5 -0
- package/app/plugins/kimi-code/manifest.json +25 -2
- package/app/plugins/kimi-code/plugin.mjs +922 -76
- package/app/plugins/kiro-cli/assets/kiro-agent.svg +11 -0
- package/app/plugins/kiro-cli/manifest.json +18 -1
- package/app/plugins/kiro-cli/plugin.mjs +658 -57
- package/app/plugins/muse/manifest.json +18 -1
- package/app/plugins/muse/plugin.mjs +332 -17
- package/app/plugins/omp/manifest.json +21 -1
- package/app/plugins/omp/plugin.mjs +2320 -1131
- package/app/plugins/opencode/manifest.json +18 -1
- package/app/plugins/opencode/plugin.mjs +979 -184
- package/app/plugins/pi/manifest.json +32 -0
- package/app/plugins/pi/plugin.mjs +2785 -2090
- package/app/plugins/qoder/manifest.json +18 -1
- package/app/plugins/qoder/plugin.mjs +832 -82
- package/app/plugins/qoder-cn/manifest.json +18 -1
- package/app/plugins/qoder-cn/plugin.mjs +832 -82
- package/app/plugins/workbuddy/manifest.json +18 -0
- package/app/plugins/workbuddy/plugin.mjs +6947 -5773
- package/app/plugins/zcode/assets/icon.svg +8 -0
- package/app/plugins/zcode/manifest.json +32 -0
- package/app/plugins/zcode/plugin.mjs +20110 -0
- package/app/renderer-extension.js +4762 -2470
- package/bin/boft +0 -0
- package/libexec/boft-shim +0 -0
- package/libexec/boft-updater +0 -0
- package/licenses/Cordis-LICENSE.txt +21 -0
- package/licenses/Cosmokit-LICENSE.txt +21 -0
- package/package.json +1 -1
- package/app/plugins/kiro-cli/assets/icon.svg +0 -5
|
@@ -6,6 +6,7 @@ var __export = (target, all) => {
|
|
|
6
6
|
};
|
|
7
7
|
|
|
8
8
|
// ../../harness-broker/dist/client.js
|
|
9
|
+
import { execFile } from "node:child_process";
|
|
9
10
|
import { randomUUID } from "node:crypto";
|
|
10
11
|
import { lstat, readFile } from "node:fs/promises";
|
|
11
12
|
import net, {} from "node:net";
|
|
@@ -776,10 +777,10 @@ function mergeDefs(...defs) {
|
|
|
776
777
|
function cloneDef(schema) {
|
|
777
778
|
return mergeDefs(schema._zod.def);
|
|
778
779
|
}
|
|
779
|
-
function getElementAtPath(obj,
|
|
780
|
-
if (!
|
|
780
|
+
function getElementAtPath(obj, path21) {
|
|
781
|
+
if (!path21)
|
|
781
782
|
return obj;
|
|
782
|
-
return
|
|
783
|
+
return path21.reduce((acc, key) => acc?.[key], obj);
|
|
783
784
|
}
|
|
784
785
|
function promiseAllObject(promisesObj) {
|
|
785
786
|
const keys = Object.keys(promisesObj);
|
|
@@ -1188,11 +1189,11 @@ function explicitlyAborted(x2, startIndex = 0) {
|
|
|
1188
1189
|
}
|
|
1189
1190
|
return false;
|
|
1190
1191
|
}
|
|
1191
|
-
function prefixIssues(
|
|
1192
|
+
function prefixIssues(path21, issues) {
|
|
1192
1193
|
return issues.map((iss) => {
|
|
1193
1194
|
var _a4;
|
|
1194
1195
|
(_a4 = iss).path ?? (_a4.path = []);
|
|
1195
|
-
iss.path.unshift(
|
|
1196
|
+
iss.path.unshift(path21);
|
|
1196
1197
|
return iss;
|
|
1197
1198
|
});
|
|
1198
1199
|
}
|
|
@@ -1339,16 +1340,16 @@ function flattenError(error52, mapper = (issue2) => issue2.message) {
|
|
|
1339
1340
|
}
|
|
1340
1341
|
function formatError(error52, mapper = (issue2) => issue2.message) {
|
|
1341
1342
|
const fieldErrors = { _errors: [] };
|
|
1342
|
-
const processError = (error53,
|
|
1343
|
+
const processError = (error53, path21 = []) => {
|
|
1343
1344
|
for (const issue2 of error53.issues) {
|
|
1344
1345
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1345
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1346
|
+
issue2.errors.map((issues) => processError({ issues }, [...path21, ...issue2.path]));
|
|
1346
1347
|
} else if (issue2.code === "invalid_key") {
|
|
1347
|
-
processError({ issues: issue2.issues }, [...
|
|
1348
|
+
processError({ issues: issue2.issues }, [...path21, ...issue2.path]);
|
|
1348
1349
|
} else if (issue2.code === "invalid_element") {
|
|
1349
|
-
processError({ issues: issue2.issues }, [...
|
|
1350
|
+
processError({ issues: issue2.issues }, [...path21, ...issue2.path]);
|
|
1350
1351
|
} else {
|
|
1351
|
-
const fullpath = [...
|
|
1352
|
+
const fullpath = [...path21, ...issue2.path];
|
|
1352
1353
|
if (fullpath.length === 0) {
|
|
1353
1354
|
fieldErrors._errors.push(mapper(issue2));
|
|
1354
1355
|
} else {
|
|
@@ -1375,17 +1376,17 @@ function formatError(error52, mapper = (issue2) => issue2.message) {
|
|
|
1375
1376
|
}
|
|
1376
1377
|
function treeifyError(error52, mapper = (issue2) => issue2.message) {
|
|
1377
1378
|
const result = { errors: [] };
|
|
1378
|
-
const processError = (error53,
|
|
1379
|
+
const processError = (error53, path21 = []) => {
|
|
1379
1380
|
var _a4, _b2;
|
|
1380
1381
|
for (const issue2 of error53.issues) {
|
|
1381
1382
|
if (issue2.code === "invalid_union" && issue2.errors.length) {
|
|
1382
|
-
issue2.errors.map((issues) => processError({ issues }, [...
|
|
1383
|
+
issue2.errors.map((issues) => processError({ issues }, [...path21, ...issue2.path]));
|
|
1383
1384
|
} else if (issue2.code === "invalid_key") {
|
|
1384
|
-
processError({ issues: issue2.issues }, [...
|
|
1385
|
+
processError({ issues: issue2.issues }, [...path21, ...issue2.path]);
|
|
1385
1386
|
} else if (issue2.code === "invalid_element") {
|
|
1386
|
-
processError({ issues: issue2.issues }, [...
|
|
1387
|
+
processError({ issues: issue2.issues }, [...path21, ...issue2.path]);
|
|
1387
1388
|
} else {
|
|
1388
|
-
const fullpath = [...
|
|
1389
|
+
const fullpath = [...path21, ...issue2.path];
|
|
1389
1390
|
if (fullpath.length === 0) {
|
|
1390
1391
|
result.errors.push(mapper(issue2));
|
|
1391
1392
|
continue;
|
|
@@ -1417,8 +1418,8 @@ function treeifyError(error52, mapper = (issue2) => issue2.message) {
|
|
|
1417
1418
|
}
|
|
1418
1419
|
function toDotPath(_path) {
|
|
1419
1420
|
const segs = [];
|
|
1420
|
-
const
|
|
1421
|
-
for (const seg of
|
|
1421
|
+
const path21 = _path.map((seg) => typeof seg === "object" ? seg.key : seg);
|
|
1422
|
+
for (const seg of path21) {
|
|
1422
1423
|
if (typeof seg === "number")
|
|
1423
1424
|
segs.push(`[${seg}]`);
|
|
1424
1425
|
else if (typeof seg === "symbol")
|
|
@@ -4646,8 +4647,8 @@ function az_default() {
|
|
|
4646
4647
|
}
|
|
4647
4648
|
|
|
4648
4649
|
// ../../../node_modules/zod/v4/locales/be.js
|
|
4649
|
-
function getBelarusianPlural(
|
|
4650
|
-
const absCount = Math.abs(
|
|
4650
|
+
function getBelarusianPlural(count3, one, few, many) {
|
|
4651
|
+
const absCount = Math.abs(count3);
|
|
4651
4652
|
const lastDigit = absCount % 10;
|
|
4652
4653
|
const lastTwoDigits = absCount % 100;
|
|
4653
4654
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -6725,8 +6726,8 @@ function hu_default() {
|
|
|
6725
6726
|
}
|
|
6726
6727
|
|
|
6727
6728
|
// ../../../node_modules/zod/v4/locales/hy.js
|
|
6728
|
-
function getArmenianPlural(
|
|
6729
|
-
return Math.abs(
|
|
6729
|
+
function getArmenianPlural(count3, one, many) {
|
|
6730
|
+
return Math.abs(count3) === 1 ? one : many;
|
|
6730
6731
|
}
|
|
6731
6732
|
function withDefiniteArticle(word) {
|
|
6732
6733
|
if (!word)
|
|
@@ -7648,8 +7649,8 @@ function ko_default() {
|
|
|
7648
7649
|
}
|
|
7649
7650
|
|
|
7650
7651
|
// ../../../node_modules/zod/v4/locales/lt.js
|
|
7651
|
-
var capitalizeFirstCharacter = (
|
|
7652
|
-
return
|
|
7652
|
+
var capitalizeFirstCharacter = (text2) => {
|
|
7653
|
+
return text2.charAt(0).toUpperCase() + text2.slice(1);
|
|
7653
7654
|
};
|
|
7654
7655
|
function getUnitTypeFromNumber(number4) {
|
|
7655
7656
|
const abs = Math.abs(number4);
|
|
@@ -8854,8 +8855,8 @@ function ro_default() {
|
|
|
8854
8855
|
}
|
|
8855
8856
|
|
|
8856
8857
|
// ../../../node_modules/zod/v4/locales/ru.js
|
|
8857
|
-
function getRussianPlural(
|
|
8858
|
-
const absCount = Math.abs(
|
|
8858
|
+
function getRussianPlural(count3, one, few, many) {
|
|
8859
|
+
const absCount = Math.abs(count3);
|
|
8859
8860
|
const lastDigit = absCount % 10;
|
|
8860
8861
|
const lastTwoDigits = absCount % 100;
|
|
8861
8862
|
if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
|
|
@@ -14110,13 +14111,13 @@ function resolveRef(ref, ctx) {
|
|
|
14110
14111
|
if (!ref.startsWith("#")) {
|
|
14111
14112
|
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
14112
14113
|
}
|
|
14113
|
-
const
|
|
14114
|
-
if (
|
|
14114
|
+
const path21 = ref.slice(1).split("/").filter(Boolean);
|
|
14115
|
+
if (path21.length === 0) {
|
|
14115
14116
|
return ctx.rootSchema;
|
|
14116
14117
|
}
|
|
14117
14118
|
const defsKey = ctx.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
14118
|
-
if (
|
|
14119
|
-
const key =
|
|
14119
|
+
if (path21[0] === defsKey) {
|
|
14120
|
+
const key = path21[1];
|
|
14120
14121
|
if (!key || !ctx.defs[key]) {
|
|
14121
14122
|
throw new Error(`Reference not found: ${ref}`);
|
|
14122
14123
|
}
|
|
@@ -14524,6 +14525,15 @@ function date4(params) {
|
|
|
14524
14525
|
// ../../../node_modules/zod/v4/classic/external.js
|
|
14525
14526
|
config(en_default());
|
|
14526
14527
|
|
|
14528
|
+
// ../../shared-contracts/dist/delegation-read.js
|
|
14529
|
+
var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
14530
|
+
var delegationReadParamsSchema = external_exports.strictObject({
|
|
14531
|
+
threadId: external_exports.string().min(1).max(1024),
|
|
14532
|
+
view: external_exports.enum(["result", "messages"]),
|
|
14533
|
+
cursor: external_exports.string().min(1).max(8192).optional(),
|
|
14534
|
+
limit: external_exports.number().int().min(1).max(100).optional()
|
|
14535
|
+
});
|
|
14536
|
+
|
|
14527
14537
|
// ../../shared-contracts/dist/credential-imports.js
|
|
14528
14538
|
var credentialSourceSchema = external_exports.object({
|
|
14529
14539
|
id: external_exports.string().min(1).max(256),
|
|
@@ -14594,6 +14604,153 @@ var harnessDisplaySetSchema = external_exports.strictObject({
|
|
|
14594
14604
|
initializeOnly: external_exports.boolean().optional()
|
|
14595
14605
|
});
|
|
14596
14606
|
|
|
14607
|
+
// ../../shared-contracts/dist/model-price-overrides.js
|
|
14608
|
+
var usdPerMillionTokens = external_exports.number().finite().nonnegative();
|
|
14609
|
+
var modelPriceOverrideSchema = external_exports.strictObject({
|
|
14610
|
+
input: usdPerMillionTokens,
|
|
14611
|
+
output: usdPerMillionTokens,
|
|
14612
|
+
cacheRead: usdPerMillionTokens.optional(),
|
|
14613
|
+
cacheWrite: usdPerMillionTokens.optional(),
|
|
14614
|
+
cacheWrite1h: usdPerMillionTokens.optional()
|
|
14615
|
+
});
|
|
14616
|
+
var modelPriceKeySchema = external_exports.string().max(512).refine((key) => key.trim() === key && key.length > 0, "Model ID is required");
|
|
14617
|
+
var modelPriceOverridesSchema = external_exports.strictObject({
|
|
14618
|
+
/** Absolute path of the Host's `pricing.json`. */
|
|
14619
|
+
path: external_exports.string(),
|
|
14620
|
+
entries: external_exports.array(external_exports.strictObject({ key: external_exports.string(), price: modelPriceOverrideSchema })),
|
|
14621
|
+
/** Why the existing file is unusable; the Host then ignores it and refuses to overwrite it. */
|
|
14622
|
+
error: external_exports.string().nullable()
|
|
14623
|
+
});
|
|
14624
|
+
var modelPriceOverridesGetSchema = external_exports.strictObject({});
|
|
14625
|
+
var modelPriceOverridesSetSchema = external_exports.strictObject({
|
|
14626
|
+
key: modelPriceKeySchema,
|
|
14627
|
+
price: modelPriceOverrideSchema.nullable(),
|
|
14628
|
+
previousKey: modelPriceKeySchema.optional()
|
|
14629
|
+
});
|
|
14630
|
+
var modelPriceDefaultParamsSchema = external_exports.strictObject({
|
|
14631
|
+
model: modelPriceKeySchema
|
|
14632
|
+
});
|
|
14633
|
+
var modelPriceSuggestionSchema = external_exports.strictObject({
|
|
14634
|
+
/** Verified from catalog canonical links, not inferred from names or equal prices. */
|
|
14635
|
+
official: external_exports.boolean().optional(),
|
|
14636
|
+
canonicalModelId: external_exports.string().min(1).optional(),
|
|
14637
|
+
provider: external_exports.string().min(1).max(512),
|
|
14638
|
+
model: external_exports.string().min(1).max(512),
|
|
14639
|
+
price: modelPriceOverrideSchema
|
|
14640
|
+
});
|
|
14641
|
+
var modelPriceDefaultResultSchema = external_exports.strictObject({
|
|
14642
|
+
price: modelPriceOverrideSchema.nullable(),
|
|
14643
|
+
/** Local catalog suggestions only; never used automatically for pricing. */
|
|
14644
|
+
suggestions: external_exports.array(modelPriceSuggestionSchema).max(6).optional()
|
|
14645
|
+
});
|
|
14646
|
+
|
|
14647
|
+
// ../../shared-contracts/dist/usage-statistics.js
|
|
14648
|
+
var USAGE_STATISTICS_RANGES = ["today", "7d", "30d", "90d", "all"];
|
|
14649
|
+
var count = external_exports.number().int().min(0).max(Number.MAX_SAFE_INTEGER);
|
|
14650
|
+
var localDate = external_exports.string().regex(/^\d{4}-\d{2}-\d{2}$/u);
|
|
14651
|
+
var harness = external_exports.string().min(1).max(128);
|
|
14652
|
+
var model = external_exports.string().min(1).max(512);
|
|
14653
|
+
var project = external_exports.string().min(1).max(4096);
|
|
14654
|
+
var usageStatisticsParamsSchema = external_exports.strictObject({
|
|
14655
|
+
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
14656
|
+
harness: harness.optional(),
|
|
14657
|
+
model: model.nullable().optional(),
|
|
14658
|
+
project: project.nullable().optional(),
|
|
14659
|
+
/** One local date inside the range. */
|
|
14660
|
+
date: localDate.optional()
|
|
14661
|
+
});
|
|
14662
|
+
var usageStatisticsTotalsSchema = external_exports.strictObject({
|
|
14663
|
+
requests: count,
|
|
14664
|
+
inputTokens: count,
|
|
14665
|
+
cachedInputTokens: count,
|
|
14666
|
+
cacheWriteInputTokens: count,
|
|
14667
|
+
cacheKnownInputTokens: count,
|
|
14668
|
+
outputTokens: count,
|
|
14669
|
+
reasoningOutputTokens: count,
|
|
14670
|
+
/** USD at the public price, summed over the priced requests only. */
|
|
14671
|
+
costUsd: external_exports.number().finite().min(0),
|
|
14672
|
+
/** Requests without a price (or the cache data the price needs); not in `costUsd`. */
|
|
14673
|
+
unpricedRequests: count,
|
|
14674
|
+
/**
|
|
14675
|
+
* Requests whose storage gave no token counts: counted as requests, with neither tokens nor
|
|
14676
|
+
* cost, and not as unpriced.
|
|
14677
|
+
*/
|
|
14678
|
+
unmeteredRequests: count
|
|
14679
|
+
});
|
|
14680
|
+
var totals = usageStatisticsTotalsSchema.shape;
|
|
14681
|
+
var usageStatisticsSessionSchema = external_exports.strictObject({
|
|
14682
|
+
harness,
|
|
14683
|
+
sessionId: external_exports.string().min(1).max(512),
|
|
14684
|
+
project: project.nullable(),
|
|
14685
|
+
/** Models the session used, most requests first. */
|
|
14686
|
+
models: external_exports.array(model).max(16),
|
|
14687
|
+
firstAtMs: count,
|
|
14688
|
+
lastAtMs: count,
|
|
14689
|
+
...totals
|
|
14690
|
+
});
|
|
14691
|
+
var usageStatisticsResultSchema = external_exports.strictObject({
|
|
14692
|
+
range: external_exports.enum(USAGE_STATISTICS_RANGES),
|
|
14693
|
+
/** First local date of the range; null for all time. */
|
|
14694
|
+
from: localDate.nullable(),
|
|
14695
|
+
to: localDate,
|
|
14696
|
+
/** The filters these figures apply, echoed so a late answer to older filters is recognised. */
|
|
14697
|
+
filters: external_exports.strictObject({
|
|
14698
|
+
harness: harness.nullable(),
|
|
14699
|
+
model: model.nullable(),
|
|
14700
|
+
unknownModel: external_exports.boolean(),
|
|
14701
|
+
project: project.nullable(),
|
|
14702
|
+
unknownProject: external_exports.boolean(),
|
|
14703
|
+
date: localDate.nullable()
|
|
14704
|
+
}),
|
|
14705
|
+
/** Reading of native storage: incomplete while the first read, or a refresh, is under way. */
|
|
14706
|
+
reading: external_exports.strictObject({ complete: external_exports.boolean(), sources: count, read: count }),
|
|
14707
|
+
/** Harnesses whose storage could not be read; their part is missing, the rest is complete. */
|
|
14708
|
+
failures: external_exports.array(external_exports.strictObject({ harness, message: external_exports.string().max(2048) })).max(256),
|
|
14709
|
+
/** Every value seen in the range, ignoring the filters, to choose filters from. */
|
|
14710
|
+
options: external_exports.strictObject({
|
|
14711
|
+
harnesses: external_exports.array(harness).max(256),
|
|
14712
|
+
models: external_exports.array(model.nullable()).max(4096),
|
|
14713
|
+
projects: external_exports.array(project.nullable()).max(4096)
|
|
14714
|
+
}),
|
|
14715
|
+
/** Current display metadata, scoped by Harness. Never a pricing or filter identity.
|
|
14716
|
+
* Optional for older Hosts; missing/conflicting labels fall back to the native model ID.
|
|
14717
|
+
*/
|
|
14718
|
+
modelLabels: external_exports.array(external_exports.strictObject({ harness, model, label: model })).max(4096).optional(),
|
|
14719
|
+
/** Native credits, all filters applied, never combined across Harnesses or treated as USD.
|
|
14720
|
+
* Only groups with at least one reported value appear; reportedRequests exposes partial data.
|
|
14721
|
+
*/
|
|
14722
|
+
credits: external_exports.array(external_exports.strictObject({
|
|
14723
|
+
harness,
|
|
14724
|
+
model: model.nullable(),
|
|
14725
|
+
credits: external_exports.number().finite().min(0),
|
|
14726
|
+
reportedRequests: count,
|
|
14727
|
+
requests: count
|
|
14728
|
+
})).max(4096).optional(),
|
|
14729
|
+
/** All filters applied. */
|
|
14730
|
+
totals: usageStatisticsTotalsSchema,
|
|
14731
|
+
/** Each date and Harness of the range: every filter except the day. */
|
|
14732
|
+
daily: external_exports.array(external_exports.strictObject({ date: localDate, harness, ...totals })).max(2e5),
|
|
14733
|
+
/** Local weekday (0 = Sunday) and hour, all filters applied. */
|
|
14734
|
+
hourly: external_exports.array(external_exports.strictObject({
|
|
14735
|
+
weekday: external_exports.number().int().min(0).max(6),
|
|
14736
|
+
hour: external_exports.number().int().min(0).max(23),
|
|
14737
|
+
...totals
|
|
14738
|
+
})).max(168),
|
|
14739
|
+
byHarness: external_exports.array(external_exports.strictObject({ harness, ...totals })).max(256),
|
|
14740
|
+
byModel: external_exports.array(external_exports.strictObject({
|
|
14741
|
+
model: model.nullable(),
|
|
14742
|
+
...totals,
|
|
14743
|
+
/** Requests priced by what the Harness recorded they cost, not by a price list. */
|
|
14744
|
+
harnessPricedRequests: count
|
|
14745
|
+
})).max(4096),
|
|
14746
|
+
byProject: external_exports.array(external_exports.strictObject({ project: project.nullable(), ...totals })).max(4096),
|
|
14747
|
+
/**
|
|
14748
|
+
* The sessions that spent the most, by cost and by tokens without cache, all filters applied;
|
|
14749
|
+
* requests without a native session are not listed here but count everywhere else.
|
|
14750
|
+
*/
|
|
14751
|
+
sessions: external_exports.array(usageStatisticsSessionSchema).max(100)
|
|
14752
|
+
});
|
|
14753
|
+
|
|
14597
14754
|
// ../../shared-contracts/dist/ids.js
|
|
14598
14755
|
var opaqueIdSchema = external_exports.string().refine((value) => value.trim().length > 0, {
|
|
14599
14756
|
message: "Identifier must not be empty or whitespace"
|
|
@@ -14604,6 +14761,10 @@ var hostTurnIdSchema = opaqueIdSchema.brand();
|
|
|
14604
14761
|
var hostItemIdSchema = opaqueIdSchema.brand();
|
|
14605
14762
|
var hostInteractionIdSchema = opaqueIdSchema.brand();
|
|
14606
14763
|
|
|
14764
|
+
// ../../shared-contracts/dist/thread-prewarm.js
|
|
14765
|
+
var threadPrewarmDiscardParamsSchema = external_exports.object({ threadId: hostThreadIdSchema });
|
|
14766
|
+
var threadPrewarmDiscardResultSchema = external_exports.object({ discarded: external_exports.boolean() });
|
|
14767
|
+
|
|
14607
14768
|
// ../../shared-contracts/dist/harness-plugins.js
|
|
14608
14769
|
var HARNESS_PLUGIN_MANIFEST_MAX_BYTES = 32 * 1024;
|
|
14609
14770
|
var HARNESS_PLUGIN_ICON_MAX_BYTES = 128 * 1024;
|
|
@@ -14611,13 +14772,40 @@ var HARNESS_PLUGIN_LIMIT = 128;
|
|
|
14611
14772
|
var harnessPluginIdSchema = external_exports.string().min(1).max(128).regex(/^[a-z][a-z0-9]*(?:[._-][a-z0-9]+)*$/u).refine((id) => id !== "codex", "The official Codex identity is reserved").pipe(harnessIdSchema);
|
|
14612
14773
|
var relativeResourceSchema = external_exports.string().min(1).max(512).refine((value) => !/[\\\u0000:#?]/u.test(value) && !value.startsWith("/") && !value.split("/").some((part) => part === ".." || part === ""), "Plugin resources must be relative paths inside the plugin");
|
|
14613
14774
|
var documentationUrlSchema = external_exports.url().refine((value) => /^https:\/\/[^/?#@]+(?:[/?#]|$)/iu.test(value), "Plugin documentation links must be credential-free HTTPS URLs");
|
|
14775
|
+
var localizedTextSchema = external_exports.object({ en: external_exports.string().max(4096), "zh-CN": external_exports.string().max(4096).optional() }).strict();
|
|
14776
|
+
var harnessInstallationGuideSchema = external_exports.object({
|
|
14777
|
+
commands: external_exports.array(external_exports.object({ terminal: external_exports.string().max(256), command: external_exports.string().max(4096) }).strict()).max(8),
|
|
14778
|
+
before: localizedTextSchema.optional(),
|
|
14779
|
+
after: localizedTextSchema.optional(),
|
|
14780
|
+
downloads: external_exports.array(external_exports.object({ label: external_exports.string().max(128), url: documentationUrlSchema }).strict()).max(8).optional()
|
|
14781
|
+
}).strict();
|
|
14614
14782
|
var pluginPresentationShape = {
|
|
14615
14783
|
id: harnessPluginIdSchema,
|
|
14616
14784
|
name: external_exports.string().trim().min(1).max(128),
|
|
14617
14785
|
version: external_exports.string().min(1).max(128),
|
|
14786
|
+
/** Capability-only plugin; omitted for existing session-capable plugins. */
|
|
14787
|
+
kind: external_exports.literal("usage").optional(),
|
|
14788
|
+
/** Original image styling or bounded vector paths; never arbitrary CSS/SVG markup. */
|
|
14789
|
+
iconStyle: external_exports.object({
|
|
14790
|
+
vector: external_exports.object({
|
|
14791
|
+
viewBox: external_exports.string().max(128).regex(/^-?\d+(?:\.\d+)?(?: +-?\d+(?:\.\d+)?){3}$/u),
|
|
14792
|
+
color: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu),
|
|
14793
|
+
paths: external_exports.array(external_exports.object({
|
|
14794
|
+
d: external_exports.string().min(1).max(32768).regex(/^[MmLlHhVvCcSsQqTtAaZz\d.,+eE\s-]+$/u),
|
|
14795
|
+
fillRule: external_exports.enum(["evenodd", "nonzero"]).optional(),
|
|
14796
|
+
fill: external_exports.string().regex(/^(?:currentColor|#[a-f0-9]{6})$/iu).optional()
|
|
14797
|
+
}).strict()).min(1).max(32)
|
|
14798
|
+
}).strict().optional(),
|
|
14799
|
+
background: external_exports.string().regex(/^#[a-f0-9]{6}$/iu).optional(),
|
|
14800
|
+
borderRadius: external_exports.number().min(0).max(50).optional(),
|
|
14801
|
+
paddingRatio: external_exports.number().min(0).max(0.25).optional()
|
|
14802
|
+
}).strict().optional(),
|
|
14803
|
+
installation: harnessInstallationGuideSchema.optional(),
|
|
14804
|
+
notice: localizedTextSchema.optional(),
|
|
14618
14805
|
/** The factory accepts a persisted local entrypoint through its construction context. */
|
|
14619
14806
|
launchCommand: external_exports.literal(true).optional(),
|
|
14620
14807
|
links: external_exports.object({
|
|
14808
|
+
website: documentationUrlSchema.optional(),
|
|
14621
14809
|
documentation: documentationUrlSchema.optional(),
|
|
14622
14810
|
installation: documentationUrlSchema.optional()
|
|
14623
14811
|
}).strict().optional()
|
|
@@ -14671,6 +14859,9 @@ var consoleOpenResultSchema = external_exports.strictObject({
|
|
|
14671
14859
|
url: external_exports.string().max(2048).regex(/^http:\/\/(?:127\.0\.0\.1|localhost):\d{1,5}\/(?:\?.*)?$/u)
|
|
14672
14860
|
});
|
|
14673
14861
|
var CONSOLE_HOST_METHODS = Object.freeze([
|
|
14862
|
+
"codexhost/console/remote-connections",
|
|
14863
|
+
"codexhost/runtime/status",
|
|
14864
|
+
"codexhost/remote/ssh-setup",
|
|
14674
14865
|
"codexhost/harness/plugins/list",
|
|
14675
14866
|
"codexhost/harness/display-settings/get",
|
|
14676
14867
|
"codexhost/harness/display-settings/set",
|
|
@@ -14691,6 +14882,10 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
14691
14882
|
"codexhost/account/list",
|
|
14692
14883
|
"codexhost/account/refresh",
|
|
14693
14884
|
"codexhost/account/usage/inspect",
|
|
14885
|
+
"codexhost/usage/model-prices/get",
|
|
14886
|
+
"codexhost/usage/model-prices/set",
|
|
14887
|
+
"codexhost/usage/model-prices/default",
|
|
14888
|
+
"codexhost/usage/statistics/get",
|
|
14694
14889
|
"codexhost/update/check",
|
|
14695
14890
|
"codexhost/update/start",
|
|
14696
14891
|
"codexhost/update/status"
|
|
@@ -14755,6 +14950,7 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
14755
14950
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
14756
14951
|
outputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
14757
14952
|
outputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
14953
|
+
apiOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
14758
14954
|
reasoningOutputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
14759
14955
|
totalTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
14760
14956
|
totalCostUsd: finiteNonNegativeNumberSchema.optional(),
|
|
@@ -14766,7 +14962,11 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
14766
14962
|
planFiveHourUsedPercent: cacheHitRatePercentSchema.optional(),
|
|
14767
14963
|
planFiveHourResetsAtUnix: nonNegativeSafeIntegerSchema.optional(),
|
|
14768
14964
|
planSevenDayUsedPercent: cacheHitRatePercentSchema.optional(),
|
|
14769
|
-
planSevenDayResetsAtUnix: nonNegativeSafeIntegerSchema.optional()
|
|
14965
|
+
planSevenDayResetsAtUnix: nonNegativeSafeIntegerSchema.optional(),
|
|
14966
|
+
sessionCacheHitRatePercent: cacheHitRatePercentSchema.optional(),
|
|
14967
|
+
timeToFirstOutputMs: nonNegativeSafeIntegerSchema.optional(),
|
|
14968
|
+
costSource: external_exports.enum(["publicPrice", "native"]).optional(),
|
|
14969
|
+
unpricedModels: external_exports.array(external_exports.string().min(1)).min(1).optional()
|
|
14770
14970
|
}).strict().superRefine((usage, context) => {
|
|
14771
14971
|
if (Object.keys(usage).length === 0) {
|
|
14772
14972
|
context.addIssue({ code: "custom", message: "Thread Usage must contain a reliable field" });
|
|
@@ -14787,6 +14987,20 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
14787
14987
|
path: ["contextWindowTokens"]
|
|
14788
14988
|
});
|
|
14789
14989
|
}
|
|
14990
|
+
if (usage.costSource !== void 0 && usage.totalCostUsd === void 0) {
|
|
14991
|
+
context.addIssue({
|
|
14992
|
+
code: "custom",
|
|
14993
|
+
message: "Thread Usage costSource must be provided with totalCostUsd",
|
|
14994
|
+
path: ["costSource"]
|
|
14995
|
+
});
|
|
14996
|
+
}
|
|
14997
|
+
if (usage.unpricedModels !== void 0 && usage.costSource !== "publicPrice") {
|
|
14998
|
+
context.addIssue({
|
|
14999
|
+
code: "custom",
|
|
15000
|
+
message: "Thread Usage unpricedModels must be provided with a publicPrice cost",
|
|
15001
|
+
path: ["unpricedModels"]
|
|
15002
|
+
});
|
|
15003
|
+
}
|
|
14790
15004
|
if (usage.planFiveHourResetsAtUnix !== void 0 && usage.planFiveHourUsedPercent === void 0) {
|
|
14791
15005
|
context.addIssue({
|
|
14792
15006
|
code: "custom",
|
|
@@ -15056,27 +15270,27 @@ var harnessModelCatalogSchema = external_exports.object({
|
|
|
15056
15270
|
}).strict().superRefine((catalog, context) => {
|
|
15057
15271
|
const refs = /* @__PURE__ */ new Set();
|
|
15058
15272
|
const thinkingIds = new Set(catalog.thinkingOptions.map(({ id }) => id));
|
|
15059
|
-
for (const [index,
|
|
15060
|
-
if (refs.has(
|
|
15273
|
+
for (const [index, model2] of catalog.models.entries()) {
|
|
15274
|
+
if (refs.has(model2.ref.id)) {
|
|
15061
15275
|
context.addIssue({
|
|
15062
15276
|
code: "custom",
|
|
15063
15277
|
message: "Model Catalog refs must be unique",
|
|
15064
15278
|
path: ["models", index, "ref", "id"]
|
|
15065
15279
|
});
|
|
15066
15280
|
}
|
|
15067
|
-
refs.add(
|
|
15068
|
-
if (
|
|
15069
|
-
if (refs.has(
|
|
15281
|
+
refs.add(model2.ref.id);
|
|
15282
|
+
if (model2.fastModel) {
|
|
15283
|
+
if (refs.has(model2.fastModel.id) || catalog.models.some((entry) => entry.ref.id === model2.fastModel?.id)) {
|
|
15070
15284
|
context.addIssue({
|
|
15071
15285
|
code: "custom",
|
|
15072
15286
|
message: "Fast Model refs must be distinct and unique",
|
|
15073
15287
|
path: ["models", index, "fastModel"]
|
|
15074
15288
|
});
|
|
15075
15289
|
}
|
|
15076
|
-
refs.add(
|
|
15290
|
+
refs.add(model2.fastModel.id);
|
|
15077
15291
|
}
|
|
15078
15292
|
const supportedThinkingIds = /* @__PURE__ */ new Set();
|
|
15079
|
-
for (const [optionIndex, optionId] of (
|
|
15293
|
+
for (const [optionIndex, optionId] of (model2.supportedThinkingOptionIds ?? []).entries()) {
|
|
15080
15294
|
if (supportedThinkingIds.has(optionId)) {
|
|
15081
15295
|
context.addIssue({
|
|
15082
15296
|
code: "custom",
|
|
@@ -15616,6 +15830,85 @@ var updateStatusResultSchema = external_exports.strictObject({
|
|
|
15616
15830
|
status: updateStatusSchema.nullable()
|
|
15617
15831
|
});
|
|
15618
15832
|
|
|
15833
|
+
// ../../shared-contracts/dist/remote-runtime.js
|
|
15834
|
+
var remoteUpdatePhaseSchema = external_exports.enum([
|
|
15835
|
+
"idle",
|
|
15836
|
+
"installing",
|
|
15837
|
+
"restarting",
|
|
15838
|
+
"succeeded",
|
|
15839
|
+
"failed"
|
|
15840
|
+
]);
|
|
15841
|
+
var runtimeStatusSchema = external_exports.object({
|
|
15842
|
+
runningVersion: external_exports.string().nullable(),
|
|
15843
|
+
installedVersion: external_exports.string().nullable(),
|
|
15844
|
+
restartRequired: external_exports.boolean(),
|
|
15845
|
+
remote: external_exports.boolean(),
|
|
15846
|
+
updateSupported: external_exports.boolean(),
|
|
15847
|
+
update: external_exports.object({
|
|
15848
|
+
phase: remoteUpdatePhaseSchema,
|
|
15849
|
+
targetVersion: external_exports.string().nullable(),
|
|
15850
|
+
error: external_exports.string().nullable()
|
|
15851
|
+
})
|
|
15852
|
+
});
|
|
15853
|
+
var remoteUpdateParamsSchema = external_exports.object({
|
|
15854
|
+
version: external_exports.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/u)
|
|
15855
|
+
}).strict();
|
|
15856
|
+
var remoteSshSetupParamsSchema = external_exports.object({
|
|
15857
|
+
hostname: external_exports.string().min(1).max(1024).refine((value) => !value.startsWith("-") && !/\s/u.test(value)),
|
|
15858
|
+
port: external_exports.number().int().min(1).max(65535).nullable(),
|
|
15859
|
+
identity: external_exports.string().max(4096).nullable(),
|
|
15860
|
+
action: external_exports.enum(["inspect", "install", "update", "repair", "uninstall"]),
|
|
15861
|
+
uninstallPackage: external_exports.boolean().optional(),
|
|
15862
|
+
version: external_exports.string().regex(/^\d+\.\d+\.\d+$/u).nullable()
|
|
15863
|
+
}).strict();
|
|
15864
|
+
var remoteSshSetupResultSchema = external_exports.object({ state: external_exports.enum(["installed", "not-installed"]) }).strict();
|
|
15865
|
+
|
|
15866
|
+
// ../../shared-contracts/dist/remote-connections.js
|
|
15867
|
+
var hostId = external_exports.string().min(1).max(1024);
|
|
15868
|
+
var codexSshConnectionSchema = external_exports.object({
|
|
15869
|
+
hostId,
|
|
15870
|
+
displayName: external_exports.string().min(1).max(1024),
|
|
15871
|
+
source: external_exports.enum(["codex-managed", "discovered"]),
|
|
15872
|
+
sshAlias: external_exports.string().max(1024).nullable(),
|
|
15873
|
+
sshHost: external_exports.string().min(1).max(1024),
|
|
15874
|
+
sshPort: external_exports.number().int().min(1).max(65535).nullable(),
|
|
15875
|
+
identity: external_exports.string().max(4096).nullable(),
|
|
15876
|
+
autoConnect: external_exports.boolean(),
|
|
15877
|
+
connectionAnalyticsId: external_exports.string().max(1024).optional()
|
|
15878
|
+
});
|
|
15879
|
+
var codexSshDraftSchema = external_exports.strictObject({
|
|
15880
|
+
displayName: external_exports.string().min(1).max(1024),
|
|
15881
|
+
hostname: external_exports.string().min(1).max(1024),
|
|
15882
|
+
sshPort: external_exports.number().int().min(1).max(65535).nullable(),
|
|
15883
|
+
identity: external_exports.string().max(4096).nullable()
|
|
15884
|
+
});
|
|
15885
|
+
var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action", [
|
|
15886
|
+
external_exports.strictObject({ action: external_exports.literal("list") }),
|
|
15887
|
+
external_exports.strictObject({
|
|
15888
|
+
action: external_exports.literal("read-thread"),
|
|
15889
|
+
hostId: hostId.refine((id) => id !== "local"),
|
|
15890
|
+
input: delegationReadParamsSchema
|
|
15891
|
+
}),
|
|
15892
|
+
external_exports.strictObject({
|
|
15893
|
+
action: external_exports.literal("save"),
|
|
15894
|
+
draft: codexSshDraftSchema,
|
|
15895
|
+
previous: codexSshConnectionSchema.nullable()
|
|
15896
|
+
}),
|
|
15897
|
+
external_exports.strictObject({ action: external_exports.literal("remove"), previous: codexSshConnectionSchema }),
|
|
15898
|
+
external_exports.strictObject({ action: external_exports.literal("connect"), hostId, enabled: external_exports.boolean() }),
|
|
15899
|
+
external_exports.strictObject({ action: external_exports.literal("state"), hostId }),
|
|
15900
|
+
external_exports.strictObject({ action: external_exports.literal("runtime"), hostId }),
|
|
15901
|
+
external_exports.strictObject({
|
|
15902
|
+
action: external_exports.literal("update"),
|
|
15903
|
+
hostId: hostId.refine((id) => id !== "local"),
|
|
15904
|
+
version: remoteUpdateParamsSchema.shape.version
|
|
15905
|
+
})
|
|
15906
|
+
]);
|
|
15907
|
+
var remoteConnectionsReplySchema = external_exports.union([
|
|
15908
|
+
external_exports.strictObject({ result: jsonValueSchema }),
|
|
15909
|
+
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
15910
|
+
]);
|
|
15911
|
+
|
|
15619
15912
|
// ../../shared-contracts/dist/index.js
|
|
15620
15913
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
15621
15914
|
|
|
@@ -15727,7 +16020,6 @@ var tokenFields = [
|
|
|
15727
16020
|
"cachedInputTokens",
|
|
15728
16021
|
"cacheWriteInputTokens",
|
|
15729
16022
|
"outputTokens",
|
|
15730
|
-
"outputTokensPerSecond",
|
|
15731
16023
|
"reasoningOutputTokens",
|
|
15732
16024
|
"totalTokens",
|
|
15733
16025
|
"contextWindowTokens",
|
|
@@ -15735,10 +16027,12 @@ var tokenFields = [
|
|
|
15735
16027
|
];
|
|
15736
16028
|
var safeIntegerFields = [
|
|
15737
16029
|
"planFiveHourResetsAtUnix",
|
|
15738
|
-
"planSevenDayResetsAtUnix"
|
|
16030
|
+
"planSevenDayResetsAtUnix",
|
|
16031
|
+
"timeToFirstOutputMs"
|
|
15739
16032
|
];
|
|
15740
16033
|
var percentFields = [
|
|
15741
16034
|
"cacheHitRatePercent",
|
|
16035
|
+
"sessionCacheHitRatePercent",
|
|
15742
16036
|
"planFiveHourUsedPercent",
|
|
15743
16037
|
"planSevenDayUsedPercent"
|
|
15744
16038
|
];
|
|
@@ -15746,9 +16040,14 @@ var usageFields = /* @__PURE__ */ new Set([
|
|
|
15746
16040
|
...tokenFields,
|
|
15747
16041
|
...safeIntegerFields,
|
|
15748
16042
|
...percentFields,
|
|
16043
|
+
"sessionCacheUsage",
|
|
15749
16044
|
"totalCostUsd",
|
|
15750
16045
|
"totalCredits",
|
|
15751
|
-
"contextUsagePercent"
|
|
16046
|
+
"contextUsagePercent",
|
|
16047
|
+
"outputTokensPerSecond",
|
|
16048
|
+
"apiOutputTokensPerSecond",
|
|
16049
|
+
"costSource",
|
|
16050
|
+
"unpricedModels"
|
|
15752
16051
|
]);
|
|
15753
16052
|
function isRecord(value) {
|
|
15754
16053
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -15764,7 +16063,11 @@ function parseHostUsage(value) {
|
|
|
15764
16063
|
throw new Error(`Harness Usage contains unknown field '${key}'`);
|
|
15765
16064
|
}
|
|
15766
16065
|
}
|
|
15767
|
-
for (const field of [
|
|
16066
|
+
for (const field of [
|
|
16067
|
+
"totalCredits",
|
|
16068
|
+
"contextUsagePercent",
|
|
16069
|
+
"apiOutputTokensPerSecond"
|
|
16070
|
+
]) {
|
|
15768
16071
|
const candidate = value[field];
|
|
15769
16072
|
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isFinite(candidate) || candidate < 0)) {
|
|
15770
16073
|
throw new Error(`Harness Usage '${field}' must be a finite non-negative number`);
|
|
@@ -15800,6 +16103,12 @@ function parseHostUsage(value) {
|
|
|
15800
16103
|
throw new Error(`Harness Usage '${field}' must be between 0 and 100`);
|
|
15801
16104
|
}
|
|
15802
16105
|
}
|
|
16106
|
+
if (value.sessionCacheUsage !== void 0) {
|
|
16107
|
+
const totals2 = value.sessionCacheUsage;
|
|
16108
|
+
if (!isRecord(totals2) || Object.keys(totals2).some((key) => key !== "inputTokens" && key !== "cachedInputTokens") || typeof totals2.inputTokens !== "number" || !Number.isSafeInteger(totals2.inputTokens) || totals2.inputTokens < 0 || typeof totals2.cachedInputTokens !== "number" || !Number.isSafeInteger(totals2.cachedInputTokens) || totals2.cachedInputTokens < 0 || totals2.cachedInputTokens > totals2.inputTokens) {
|
|
16109
|
+
throw new Error("Harness Usage 'sessionCacheUsage' must contain complete bounded token totals");
|
|
16110
|
+
}
|
|
16111
|
+
}
|
|
15803
16112
|
const hasContextUsed = value.contextUsedTokens !== void 0;
|
|
15804
16113
|
const hasContextWindow = value.contextWindowTokens !== void 0;
|
|
15805
16114
|
if (hasContextUsed !== hasContextWindow) {
|
|
@@ -15814,8 +16123,90 @@ function parseHostUsage(value) {
|
|
|
15814
16123
|
if (value.planSevenDayResetsAtUnix !== void 0 && value.planSevenDayUsedPercent === void 0) {
|
|
15815
16124
|
throw new Error("Harness Usage 'planSevenDayResetsAtUnix' must be provided with 'planSevenDayUsedPercent'");
|
|
15816
16125
|
}
|
|
16126
|
+
if (value.costSource !== void 0) {
|
|
16127
|
+
if (value.costSource !== "publicPrice" && value.costSource !== "native") {
|
|
16128
|
+
throw new Error("Harness Usage 'costSource' must be 'publicPrice' or 'native'");
|
|
16129
|
+
}
|
|
16130
|
+
if (value.totalCostUsd === void 0) {
|
|
16131
|
+
throw new Error("Harness Usage 'costSource' must be provided with 'totalCostUsd'");
|
|
16132
|
+
}
|
|
16133
|
+
}
|
|
16134
|
+
if (value.unpricedModels !== void 0) {
|
|
16135
|
+
const models = value.unpricedModels;
|
|
16136
|
+
if (!Array.isArray(models) || models.length === 0 || !models.every((model2) => typeof model2 === "string" && model2.length > 0)) {
|
|
16137
|
+
throw new Error("Harness Usage 'unpricedModels' must be a non-empty list of Model IDs");
|
|
16138
|
+
}
|
|
16139
|
+
if (value.costSource !== "publicPrice") {
|
|
16140
|
+
throw new Error("Harness Usage 'unpricedModels' must be provided with a 'publicPrice' cost");
|
|
16141
|
+
}
|
|
16142
|
+
return { ...value, unpricedModels: [...models] };
|
|
16143
|
+
}
|
|
15817
16144
|
return { ...value };
|
|
15818
16145
|
}
|
|
16146
|
+
var requestTokenFields = [
|
|
16147
|
+
"inputTokens",
|
|
16148
|
+
"cachedInputTokens",
|
|
16149
|
+
"cacheWriteInputTokens",
|
|
16150
|
+
"cacheWrite1hInputTokens",
|
|
16151
|
+
"outputTokens",
|
|
16152
|
+
"reasoningOutputTokens",
|
|
16153
|
+
"startedAtMs",
|
|
16154
|
+
"completedAtMs"
|
|
16155
|
+
];
|
|
16156
|
+
var requestFields = /* @__PURE__ */ new Set([
|
|
16157
|
+
...requestTokenFields,
|
|
16158
|
+
"requestId",
|
|
16159
|
+
"historical",
|
|
16160
|
+
"model",
|
|
16161
|
+
"provider"
|
|
16162
|
+
]);
|
|
16163
|
+
function parseHostUsageRequest(value) {
|
|
16164
|
+
if (!isRecord(value))
|
|
16165
|
+
throw new Error("Harness Usage request must be an object");
|
|
16166
|
+
for (const key of Object.keys(value)) {
|
|
16167
|
+
if (!requestFields.has(key)) {
|
|
16168
|
+
throw new Error(`Harness Usage request contains unknown field '${key}'`);
|
|
16169
|
+
}
|
|
16170
|
+
}
|
|
16171
|
+
if (typeof value.requestId !== "string" || value.requestId.length === 0) {
|
|
16172
|
+
throw new Error("Harness Usage request 'requestId' must be a non-empty string");
|
|
16173
|
+
}
|
|
16174
|
+
for (const field of ["model", "provider"]) {
|
|
16175
|
+
const candidate = value[field];
|
|
16176
|
+
if (candidate !== void 0 && (typeof candidate !== "string" || candidate.length === 0)) {
|
|
16177
|
+
throw new Error(`Harness Usage request '${field}' must be a non-empty string`);
|
|
16178
|
+
}
|
|
16179
|
+
}
|
|
16180
|
+
if (value.historical !== void 0 && typeof value.historical !== "boolean") {
|
|
16181
|
+
throw new Error("Harness Usage request 'historical' must be a boolean");
|
|
16182
|
+
}
|
|
16183
|
+
for (const field of requestTokenFields) {
|
|
16184
|
+
const candidate = value[field];
|
|
16185
|
+
if (candidate !== void 0 && (typeof candidate !== "number" || !Number.isSafeInteger(candidate) || candidate < 0)) {
|
|
16186
|
+
throw new Error(`Harness Usage request '${field}' must be a non-negative safe integer`);
|
|
16187
|
+
}
|
|
16188
|
+
}
|
|
16189
|
+
if (value.inputTokens === void 0 || value.outputTokens === void 0) {
|
|
16190
|
+
throw new Error("Harness Usage request must contain 'inputTokens' and 'outputTokens'");
|
|
16191
|
+
}
|
|
16192
|
+
const request = value;
|
|
16193
|
+
if ((request.cachedInputTokens ?? 0) + (request.cacheWriteInputTokens ?? 0) > request.inputTokens) {
|
|
16194
|
+
throw new Error("Harness Usage request cache Tokens must not exceed 'inputTokens'");
|
|
16195
|
+
}
|
|
16196
|
+
if ((request.reasoningOutputTokens ?? 0) > request.outputTokens) {
|
|
16197
|
+
throw new Error("Harness Usage request 'reasoningOutputTokens' must not exceed 'outputTokens'");
|
|
16198
|
+
}
|
|
16199
|
+
if (request.cacheWrite1hInputTokens !== void 0 && request.cacheWrite1hInputTokens > (request.cacheWriteInputTokens ?? -1)) {
|
|
16200
|
+
throw new Error("Harness Usage request 'cacheWrite1hInputTokens' must not exceed 'cacheWriteInputTokens'");
|
|
16201
|
+
}
|
|
16202
|
+
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
16203
|
+
throw new Error("Harness Usage request timing fields must be provided together");
|
|
16204
|
+
}
|
|
16205
|
+
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
16206
|
+
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
16207
|
+
}
|
|
16208
|
+
return { ...request };
|
|
16209
|
+
}
|
|
15819
16210
|
|
|
15820
16211
|
// ../../harness-adapter/dist/live-command-catalog.js
|
|
15821
16212
|
var COMMON_EXCLUDED_LIVE_COMMANDS = /* @__PURE__ */ new Set([
|
|
@@ -15898,8 +16289,8 @@ function liveHarnessCommandPrompt(catalog, idPrefix, commandId, argumentText) {
|
|
|
15898
16289
|
const descriptor = catalog.commands.find(({ id }) => id === commandId);
|
|
15899
16290
|
if (!descriptor)
|
|
15900
16291
|
return null;
|
|
15901
|
-
const
|
|
15902
|
-
return
|
|
16292
|
+
const text2 = typeof argumentText === "string" ? argumentText.trim() : "";
|
|
16293
|
+
return text2 ? `${descriptor.invocation} ${text2}` : descriptor.invocation;
|
|
15903
16294
|
}
|
|
15904
16295
|
function mergeLiveHarnessCommands(builtIns, idPrefix, live, exclusions = {}) {
|
|
15905
16296
|
if (!live)
|
|
@@ -15941,9 +16332,12 @@ var HARNESS_BROKER_MAX_FRAME_BYTES = 8 * 1024 * 1024;
|
|
|
15941
16332
|
var HARNESS_BROKER_MAX_PENDING_REQUESTS = 32;
|
|
15942
16333
|
var HARNESS_BROKER_REQUEST_TIMEOUT_MS = 15e3;
|
|
15943
16334
|
var HARNESS_BROKER_SESSION_IMPORT_PAGE_SIZE = 100;
|
|
16335
|
+
var HARNESS_BROKER_IDLE_TIMEOUT_MS = 60 * 60 * 1e3;
|
|
16336
|
+
var HARNESS_BROKER_RETIRING_ERROR_CODE = "brokerRetiring";
|
|
15944
16337
|
var harnessBrokerMethodSchema = external_exports.enum([
|
|
15945
16338
|
"adapter.inspect",
|
|
15946
16339
|
"adapter.inspectAccount",
|
|
16340
|
+
"adapter.credits",
|
|
15947
16341
|
"adapter.open",
|
|
15948
16342
|
"adapter.sessionImport.list",
|
|
15949
16343
|
"adapter.sessionImport.resolve",
|
|
@@ -16063,6 +16457,14 @@ function defaultHarnessBrokerDescriptorPath(environment = process.env, harnessId
|
|
|
16063
16457
|
return path.join(defaultHarnessBrokerDirectory(environment), `${harnessId}-broker-v1.json`);
|
|
16064
16458
|
return environment[HARNESS_BROKER_DESCRIPTOR_ENV] ?? path.join(defaultHarnessBrokerDirectory(environment), HARNESS_BROKER_DESCRIPTOR_FILE);
|
|
16065
16459
|
}
|
|
16460
|
+
function harnessBrokerLaunchAgentLabel(harnessId = "claude-code") {
|
|
16461
|
+
harnessPluginIdSchema.parse(harnessId);
|
|
16462
|
+
return harnessId === "claude-code" ? "ai.bytepioneer.codexhost.native-harness-broker" : `ai.bytepioneer.codexhost.${harnessId}-broker`;
|
|
16463
|
+
}
|
|
16464
|
+
function harnessBrokerLaunchAgentPlistPath(environment = process.env, harnessId = "claude-code") {
|
|
16465
|
+
const home = environment.HOME || os.homedir();
|
|
16466
|
+
return path.join(home, "Library", "LaunchAgents", `${harnessBrokerLaunchAgentLabel(harnessId)}.plist`);
|
|
16467
|
+
}
|
|
16066
16468
|
|
|
16067
16469
|
// ../../harness-broker/dist/validation.js
|
|
16068
16470
|
var cwdSchema = external_exports.string().min(1).max(16384);
|
|
@@ -16237,6 +16639,8 @@ var harnessSessionStateSchema = external_exports.custom((value) => {
|
|
|
16237
16639
|
var eventKeys = /* @__PURE__ */ new Map([
|
|
16238
16640
|
["session.state.changed", /* @__PURE__ */ new Set(["type", "state"])],
|
|
16239
16641
|
["session.usage.changed", /* @__PURE__ */ new Set(["type", "usage", "observedForTurnId"])],
|
|
16642
|
+
["usage.request", /* @__PURE__ */ new Set(["type", "request"])],
|
|
16643
|
+
["usage.history", /* @__PURE__ */ new Set(["type", "complete"])],
|
|
16240
16644
|
["subagent.state.changed", /* @__PURE__ */ new Set(["type", "nativeSubagentId", "status", "resultSummary"])],
|
|
16241
16645
|
["subagent.transcript.changed", /* @__PURE__ */ new Set(["type", "nativeSubagentId"])],
|
|
16242
16646
|
["turn.started", /* @__PURE__ */ new Set(["type", "turnId"])],
|
|
@@ -16285,6 +16689,8 @@ var harnessOutputSchema = external_exports.custom((value) => {
|
|
|
16285
16689
|
return harnessSessionStateSchema.safeParse(event.state).success;
|
|
16286
16690
|
if (event.type === "session.faulted")
|
|
16287
16691
|
return harnessErrorSchema.safeParse(event.error).success;
|
|
16692
|
+
if (event.type === "usage.history")
|
|
16693
|
+
return typeof event.complete === "boolean";
|
|
16288
16694
|
return true;
|
|
16289
16695
|
}
|
|
16290
16696
|
if (output.kind === "interaction") {
|
|
@@ -16389,10 +16795,55 @@ async function readDescriptor(descriptorPath) {
|
|
|
16389
16795
|
try {
|
|
16390
16796
|
process.kill(descriptor.ownerPid, 0);
|
|
16391
16797
|
} catch {
|
|
16392
|
-
throw new
|
|
16798
|
+
throw new BrokerNotRunningError("its owner process has exited");
|
|
16393
16799
|
}
|
|
16394
16800
|
return descriptor;
|
|
16395
16801
|
}
|
|
16802
|
+
var BrokerNotRunningError = class extends Error {
|
|
16803
|
+
};
|
|
16804
|
+
var BrokerRetiringError = class extends Error {
|
|
16805
|
+
};
|
|
16806
|
+
var BrokerRequestNotDeliveredError = class extends Error {
|
|
16807
|
+
};
|
|
16808
|
+
var HarnessNotInstalledError = class extends Error {
|
|
16809
|
+
};
|
|
16810
|
+
var BROKER_NOT_RUNNING_CODES = /* @__PURE__ */ new Set(["ENOENT", "ECONNREFUSED"]);
|
|
16811
|
+
var BROKER_START_TIMEOUT_MS = 15e3;
|
|
16812
|
+
var BROKER_START_POLL_MS = 250;
|
|
16813
|
+
function classifyConnectFailure(error52) {
|
|
16814
|
+
if (error52 instanceof BrokerNotRunningError)
|
|
16815
|
+
return error52;
|
|
16816
|
+
const code = error52?.code;
|
|
16817
|
+
if (code && BROKER_NOT_RUNNING_CODES.has(code)) {
|
|
16818
|
+
return new BrokerNotRunningError(code === "ENOENT" ? "its descriptor or socket is missing" : "its socket refused the connection");
|
|
16819
|
+
}
|
|
16820
|
+
return error52 instanceof Error ? error52 : new Error(String(error52));
|
|
16821
|
+
}
|
|
16822
|
+
function describeBrokerFailure(error52, harnessId) {
|
|
16823
|
+
if (error52 instanceof BrokerNotRunningError) {
|
|
16824
|
+
return `The ${harnessId} Aqua Harness broker on this Mac could not be started (${error52.message}). Keep the desktop user logged in, then repair the remote service or run on this Mac: codexhost broker install --harness ${harnessId}`;
|
|
16825
|
+
}
|
|
16826
|
+
return error52 instanceof Error ? error52.message : String(error52);
|
|
16827
|
+
}
|
|
16828
|
+
function runLaunchctl(arguments_) {
|
|
16829
|
+
return new Promise((resolve2) => {
|
|
16830
|
+
execFile("/bin/launchctl", arguments_, { timeout: 1e4 }, (error52) => resolve2(!error52));
|
|
16831
|
+
});
|
|
16832
|
+
}
|
|
16833
|
+
async function startBrokerLaunchAgent(harnessId, environment) {
|
|
16834
|
+
const uid = process.getuid?.();
|
|
16835
|
+
if (uid === void 0)
|
|
16836
|
+
return;
|
|
16837
|
+
const target = `gui/${uid}/${harnessBrokerLaunchAgentLabel(harnessId)}`;
|
|
16838
|
+
if (await runLaunchctl(["kickstart", target]))
|
|
16839
|
+
return;
|
|
16840
|
+
await runLaunchctl([
|
|
16841
|
+
"bootstrap",
|
|
16842
|
+
`gui/${uid}`,
|
|
16843
|
+
harnessBrokerLaunchAgentPlistPath(environment, harnessId)
|
|
16844
|
+
]);
|
|
16845
|
+
await runLaunchctl(["kickstart", target]);
|
|
16846
|
+
}
|
|
16396
16847
|
var BrokerConnection = class _BrokerConnection {
|
|
16397
16848
|
#onClose;
|
|
16398
16849
|
onClose(callback) {
|
|
@@ -16416,21 +16867,31 @@ var BrokerConnection = class _BrokerConnection {
|
|
|
16416
16867
|
socket.once("error", (error52) => this.#fail(error52));
|
|
16417
16868
|
}
|
|
16418
16869
|
static async connect(descriptorPath, harnessId) {
|
|
16419
|
-
|
|
16420
|
-
|
|
16421
|
-
|
|
16422
|
-
|
|
16423
|
-
|
|
16424
|
-
|
|
16425
|
-
|
|
16426
|
-
|
|
16427
|
-
|
|
16428
|
-
|
|
16429
|
-
|
|
16430
|
-
|
|
16431
|
-
|
|
16870
|
+
let descriptor;
|
|
16871
|
+
let socket;
|
|
16872
|
+
let connecting;
|
|
16873
|
+
try {
|
|
16874
|
+
descriptor = await readDescriptor(descriptorPath);
|
|
16875
|
+
if (descriptor.harnessId !== harnessId)
|
|
16876
|
+
throw new Error("Aqua broker belongs to another Harness");
|
|
16877
|
+
connecting = net.createConnection(descriptor.socketPath);
|
|
16878
|
+
const pending = connecting;
|
|
16879
|
+
await new Promise((resolve2, reject) => {
|
|
16880
|
+
const timeout = setTimeout(() => reject(new Error("Timed out connecting to Aqua Harness broker")), HARNESS_BROKER_REQUEST_TIMEOUT_MS);
|
|
16881
|
+
pending.once("connect", () => {
|
|
16882
|
+
clearTimeout(timeout);
|
|
16883
|
+
resolve2();
|
|
16884
|
+
});
|
|
16885
|
+
pending.once("error", (error52) => {
|
|
16886
|
+
clearTimeout(timeout);
|
|
16887
|
+
reject(error52);
|
|
16888
|
+
});
|
|
16432
16889
|
});
|
|
16433
|
-
|
|
16890
|
+
socket = pending;
|
|
16891
|
+
} catch (error52) {
|
|
16892
|
+
connecting?.destroy();
|
|
16893
|
+
throw classifyConnectFailure(error52);
|
|
16894
|
+
}
|
|
16434
16895
|
const connection = new _BrokerConnection(descriptor, socket);
|
|
16435
16896
|
const hello = connection.#waitForHello();
|
|
16436
16897
|
await writeBrokerFrame(socket, {
|
|
@@ -16483,15 +16944,24 @@ var BrokerConnection = class _BrokerConnection {
|
|
|
16483
16944
|
}, HARNESS_BROKER_REQUEST_TIMEOUT_MS);
|
|
16484
16945
|
this.#pending.set(id, { resolve: resolve2, reject, timeout });
|
|
16485
16946
|
});
|
|
16486
|
-
|
|
16487
|
-
|
|
16488
|
-
|
|
16489
|
-
|
|
16490
|
-
|
|
16491
|
-
|
|
16492
|
-
|
|
16493
|
-
|
|
16494
|
-
|
|
16947
|
+
try {
|
|
16948
|
+
await writeBrokerFrame(this.#socket, {
|
|
16949
|
+
version: HARNESS_BROKER_PROTOCOL_VERSION,
|
|
16950
|
+
generation: this.#descriptor.generation,
|
|
16951
|
+
sequence: this.#inputSequence,
|
|
16952
|
+
kind: "request",
|
|
16953
|
+
id,
|
|
16954
|
+
method,
|
|
16955
|
+
params
|
|
16956
|
+
});
|
|
16957
|
+
} catch (error52) {
|
|
16958
|
+
const pending = this.#pending.get(id);
|
|
16959
|
+
if (pending)
|
|
16960
|
+
clearTimeout(pending.timeout);
|
|
16961
|
+
this.#pending.delete(id);
|
|
16962
|
+
response.catch(() => void 0);
|
|
16963
|
+
throw new BrokerRequestNotDeliveredError(error52 instanceof Error ? error52.message : String(error52));
|
|
16964
|
+
}
|
|
16495
16965
|
return response;
|
|
16496
16966
|
}
|
|
16497
16967
|
close() {
|
|
@@ -16535,6 +17005,8 @@ var BrokerConnection = class _BrokerConnection {
|
|
|
16535
17005
|
this.#pending.delete(frame.id);
|
|
16536
17006
|
if (frame.ok)
|
|
16537
17007
|
pending.resolve(frame.value);
|
|
17008
|
+
else if (frame.error?.code === HARNESS_BROKER_RETIRING_ERROR_CODE)
|
|
17009
|
+
pending.reject(new BrokerRetiringError(frame.error.message));
|
|
16538
17010
|
else
|
|
16539
17011
|
pending.reject(new Error(frame.error?.message ?? "Broker request failed"));
|
|
16540
17012
|
}
|
|
@@ -16760,18 +17232,20 @@ var BrokeredHarnessAdapter = class {
|
|
|
16760
17232
|
harnessId;
|
|
16761
17233
|
#descriptorPath;
|
|
16762
17234
|
#forwardEnvironment;
|
|
17235
|
+
#isInstalled;
|
|
17236
|
+
#startBroker;
|
|
17237
|
+
#startTimeoutMs;
|
|
16763
17238
|
#connection = null;
|
|
16764
17239
|
#closed = false;
|
|
16765
17240
|
#sessionImportListing = null;
|
|
17241
|
+
#credits = null;
|
|
17242
|
+
#creditsRefresh = null;
|
|
16766
17243
|
subagents = {
|
|
16767
17244
|
readSnapshot: async (input) => {
|
|
16768
17245
|
try {
|
|
16769
|
-
return parseHarnessResult(await
|
|
17246
|
+
return parseHarnessResult(await this.#request("adapter.subagent.readSnapshot", input));
|
|
16770
17247
|
} catch (error52) {
|
|
16771
|
-
return {
|
|
16772
|
-
ok: false,
|
|
16773
|
-
error: unavailable(error52 instanceof Error ? error52.message : String(error52))
|
|
16774
|
-
};
|
|
17248
|
+
return { ok: false, error: this.#error(error52) };
|
|
16775
17249
|
}
|
|
16776
17250
|
}
|
|
16777
17251
|
};
|
|
@@ -16861,12 +17335,39 @@ var BrokeredHarnessAdapter = class {
|
|
|
16861
17335
|
if (input.liveCommandCatalog)
|
|
16862
17336
|
this.liveCommandCatalog = true;
|
|
16863
17337
|
this.#descriptorPath = input.descriptorPath ?? defaultHarnessBrokerDescriptorPath(input.environment, this.harnessId);
|
|
17338
|
+
this.#isInstalled = input.isInstalled;
|
|
17339
|
+
const environment = input.environment ?? process.env;
|
|
17340
|
+
this.#startBroker = input.startBroker === false ? void 0 : input.startBroker ?? (process.platform === "darwin" && !input.descriptorPath ? () => startBrokerLaunchAgent(this.harnessId, environment) : void 0);
|
|
17341
|
+
this.#startTimeoutMs = input.startTimeoutMs ?? BROKER_START_TIMEOUT_MS;
|
|
17342
|
+
}
|
|
17343
|
+
credits() {
|
|
17344
|
+
return this.#credits;
|
|
17345
|
+
}
|
|
17346
|
+
refreshCredits() {
|
|
17347
|
+
if (this.#closed)
|
|
17348
|
+
return Promise.resolve(null);
|
|
17349
|
+
if (this.#creditsRefresh)
|
|
17350
|
+
return this.#creditsRefresh;
|
|
17351
|
+
this.#creditsRefresh = this.#readCredits().finally(() => {
|
|
17352
|
+
this.#creditsRefresh = null;
|
|
17353
|
+
});
|
|
17354
|
+
return this.#creditsRefresh;
|
|
17355
|
+
}
|
|
17356
|
+
async #readCredits() {
|
|
17357
|
+
try {
|
|
17358
|
+
const value = await this.#request("adapter.credits", {}, true);
|
|
17359
|
+
const credits = accountCreditsSnapshotSchema.nullable().parse(value);
|
|
17360
|
+
if (!this.#closed)
|
|
17361
|
+
this.#credits = credits;
|
|
17362
|
+
} catch {
|
|
17363
|
+
}
|
|
17364
|
+
return this.#credits;
|
|
16864
17365
|
}
|
|
16865
17366
|
async inspectAccount() {
|
|
16866
17367
|
if (this.#closed)
|
|
16867
17368
|
return null;
|
|
16868
17369
|
try {
|
|
16869
|
-
const value = await
|
|
17370
|
+
const value = await this.#request("adapter.inspectAccount", {}, true);
|
|
16870
17371
|
return harnessAccountSnapshotSchema.nullable().parse(value);
|
|
16871
17372
|
} catch {
|
|
16872
17373
|
return null;
|
|
@@ -16876,33 +17377,46 @@ var BrokeredHarnessAdapter = class {
|
|
|
16876
17377
|
if (this.#closed)
|
|
16877
17378
|
return failedInspection("Aqua Harness broker adapter is closed");
|
|
16878
17379
|
try {
|
|
16879
|
-
return harnessInspectionSchema.parse(await
|
|
17380
|
+
return harnessInspectionSchema.parse(await this.#request("adapter.inspect", input, true));
|
|
16880
17381
|
} catch (error52) {
|
|
16881
17382
|
this.#connection = null;
|
|
16882
|
-
|
|
17383
|
+
if (error52 instanceof HarnessNotInstalledError)
|
|
17384
|
+
return { status: "notInstalled", error: this.#error(error52) };
|
|
17385
|
+
return failedInspection(describeBrokerFailure(error52, this.harnessId));
|
|
16883
17386
|
}
|
|
16884
17387
|
}
|
|
16885
17388
|
async open(input) {
|
|
16886
17389
|
if (this.#closed)
|
|
16887
17390
|
return { ok: false, error: unavailable("Aqua Harness broker adapter is closed", false) };
|
|
17391
|
+
const safeInput = { ...input };
|
|
17392
|
+
delete safeInput.environment;
|
|
17393
|
+
if (this.#forwardEnvironment && input.environment) {
|
|
17394
|
+
const allowed2 = [
|
|
17395
|
+
"CODEXHOST_CLI_PATH",
|
|
17396
|
+
"CODEXHOST_CLI_NODE_PATH",
|
|
17397
|
+
"CODEXHOST_RUNTIME_ENDPOINT",
|
|
17398
|
+
"CODEXHOST_RUNTIME_TOKEN",
|
|
17399
|
+
"CODEXHOST_THREAD_ID"
|
|
17400
|
+
];
|
|
17401
|
+
const environment = Object.fromEntries(Object.entries(input.environment).filter(([key, value]) => allowed2.includes(key) && value !== void 0));
|
|
17402
|
+
if (Object.keys(environment).length)
|
|
17403
|
+
safeInput.environment = environment;
|
|
17404
|
+
}
|
|
16888
17405
|
let connection;
|
|
16889
17406
|
try {
|
|
16890
|
-
|
|
16891
|
-
|
|
16892
|
-
|
|
16893
|
-
|
|
16894
|
-
"
|
|
16895
|
-
|
|
16896
|
-
|
|
16897
|
-
|
|
16898
|
-
|
|
16899
|
-
|
|
16900
|
-
|
|
16901
|
-
|
|
16902
|
-
|
|
16903
|
-
}
|
|
16904
|
-
connection = await this.#connect();
|
|
16905
|
-
const result = parseHarnessResult(await connection.request("adapter.open", safeInput));
|
|
17407
|
+
let value;
|
|
17408
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
17409
|
+
connection = await this.#connect();
|
|
17410
|
+
try {
|
|
17411
|
+
value = await connection.request("adapter.open", safeInput);
|
|
17412
|
+
break;
|
|
17413
|
+
} catch (error52) {
|
|
17414
|
+
if (attempt > 0 || !(error52 instanceof BrokerRetiringError || error52 instanceof BrokerRequestNotDeliveredError))
|
|
17415
|
+
throw error52;
|
|
17416
|
+
this.#connection = null;
|
|
17417
|
+
}
|
|
17418
|
+
}
|
|
17419
|
+
const result = parseHarnessResult(value);
|
|
16906
17420
|
if (!result.ok)
|
|
16907
17421
|
return result;
|
|
16908
17422
|
const session = new BrokeredHarnessSession(connection, parseSessionMetadata(result.value), this.harnessId, safeInput, () => this.#connect(), () => {
|
|
@@ -16913,25 +17427,51 @@ var BrokeredHarnessAdapter = class {
|
|
|
16913
17427
|
} catch (error52) {
|
|
16914
17428
|
connection?.close();
|
|
16915
17429
|
this.#connection = null;
|
|
16916
|
-
return {
|
|
16917
|
-
ok: false,
|
|
16918
|
-
error: unavailable(error52 instanceof Error ? error52.message : String(error52))
|
|
16919
|
-
};
|
|
17430
|
+
return { ok: false, error: this.#error(error52) };
|
|
16920
17431
|
}
|
|
16921
17432
|
}
|
|
16922
17433
|
async close() {
|
|
16923
17434
|
this.#closed = true;
|
|
17435
|
+
this.#credits = null;
|
|
16924
17436
|
await Promise.allSettled([...this.#sessions].map((session) => session.close()));
|
|
16925
17437
|
this.#sessions.clear();
|
|
16926
17438
|
const connection = await this.#connection?.catch(() => null);
|
|
16927
17439
|
await connection?.dispose();
|
|
16928
17440
|
this.#connection = null;
|
|
16929
17441
|
}
|
|
17442
|
+
#error(error52) {
|
|
17443
|
+
if (error52 instanceof HarnessNotInstalledError)
|
|
17444
|
+
return {
|
|
17445
|
+
code: "notInstalled",
|
|
17446
|
+
message: error52.message,
|
|
17447
|
+
retryable: false,
|
|
17448
|
+
stage: "harnessBroker"
|
|
17449
|
+
};
|
|
17450
|
+
return unavailable(describeBrokerFailure(error52, this.harnessId));
|
|
17451
|
+
}
|
|
17452
|
+
/**
|
|
17453
|
+
* Sends one adapter-level request. A broker that retired between requests refuses it
|
|
17454
|
+
* unprocessed, so it is retried once on a fresh broker. Idempotent reads also retry
|
|
17455
|
+
* once after a plain disconnect.
|
|
17456
|
+
*/
|
|
17457
|
+
async #request(method, params, idempotent = false) {
|
|
17458
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
17459
|
+
const connection = await this.#connect();
|
|
17460
|
+
try {
|
|
17461
|
+
return await connection.request(method, params);
|
|
17462
|
+
} catch (error52) {
|
|
17463
|
+
const retryable = error52 instanceof BrokerRetiringError || error52 instanceof BrokerRequestNotDeliveredError || idempotent && connection.closed;
|
|
17464
|
+
if (attempt > 0 || !retryable)
|
|
17465
|
+
throw error52;
|
|
17466
|
+
this.#connection = null;
|
|
17467
|
+
}
|
|
17468
|
+
}
|
|
17469
|
+
}
|
|
16930
17470
|
#connect() {
|
|
16931
17471
|
if (this.#closed)
|
|
16932
17472
|
return Promise.reject(new Error("Aqua Harness broker adapter is closed"));
|
|
16933
17473
|
if (!this.#connection) {
|
|
16934
|
-
const pending =
|
|
17474
|
+
const pending = this.#establish().then((connection) => {
|
|
16935
17475
|
connection.onClose(() => {
|
|
16936
17476
|
if (this.#connection === pending)
|
|
16937
17477
|
this.#connection = null;
|
|
@@ -16946,11 +17486,245 @@ var BrokeredHarnessAdapter = class {
|
|
|
16946
17486
|
}
|
|
16947
17487
|
return this.#connection;
|
|
16948
17488
|
}
|
|
17489
|
+
async #establish() {
|
|
17490
|
+
try {
|
|
17491
|
+
return await BrokerConnection.connect(this.#descriptorPath, this.harnessId);
|
|
17492
|
+
} catch (error52) {
|
|
17493
|
+
if (!(error52 instanceof BrokerNotRunningError) || !this.#startBroker)
|
|
17494
|
+
throw error52;
|
|
17495
|
+
}
|
|
17496
|
+
if (this.#isInstalled && !this.#isInstalled()) {
|
|
17497
|
+
throw new HarnessNotInstalledError(`${this.harnessId} is not installed on this Mac`);
|
|
17498
|
+
}
|
|
17499
|
+
const deadline = Date.now() + this.#startTimeoutMs;
|
|
17500
|
+
for (; ; ) {
|
|
17501
|
+
await this.#startBroker();
|
|
17502
|
+
try {
|
|
17503
|
+
return await BrokerConnection.connect(this.#descriptorPath, this.harnessId);
|
|
17504
|
+
} catch (error52) {
|
|
17505
|
+
if (!(error52 instanceof BrokerNotRunningError) || Date.now() >= deadline)
|
|
17506
|
+
throw error52;
|
|
17507
|
+
}
|
|
17508
|
+
await new Promise((resolve2) => setTimeout(resolve2, BROKER_START_POLL_MS));
|
|
17509
|
+
}
|
|
17510
|
+
}
|
|
16949
17511
|
};
|
|
16950
17512
|
|
|
17513
|
+
// dist/claude-usage.js
|
|
17514
|
+
var SYNTHETIC_MODEL = "<synthetic>";
|
|
17515
|
+
function isRecord2(value) {
|
|
17516
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17517
|
+
}
|
|
17518
|
+
function count2(value) {
|
|
17519
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : null;
|
|
17520
|
+
}
|
|
17521
|
+
function isClaudeModelRequest(model2) {
|
|
17522
|
+
return typeof model2 === "string" && model2.length > 0 && model2 !== SYNTHETIC_MODEL;
|
|
17523
|
+
}
|
|
17524
|
+
function claudeUsageRecord(requestId, model2, usage, extra = {}) {
|
|
17525
|
+
if (!isRecord2(usage))
|
|
17526
|
+
return { kind: "missing" };
|
|
17527
|
+
const input = count2(usage.input_tokens);
|
|
17528
|
+
const output = count2(usage.output_tokens);
|
|
17529
|
+
const cacheRead = count2(usage.cache_read_input_tokens ?? 0);
|
|
17530
|
+
const cacheWrite = count2(usage.cache_creation_input_tokens ?? 0);
|
|
17531
|
+
if (input === null || output === null || cacheRead === null || cacheWrite === null) {
|
|
17532
|
+
return { kind: "missing" };
|
|
17533
|
+
}
|
|
17534
|
+
const split = isRecord2(usage.cache_creation) ? usage.cache_creation : null;
|
|
17535
|
+
const oneHour = split ? count2(split.ephemeral_1h_input_tokens) : null;
|
|
17536
|
+
const details = isRecord2(usage.output_tokens_details) ? usage.output_tokens_details : null;
|
|
17537
|
+
const thinking = details ? count2(details.thinking_tokens) : null;
|
|
17538
|
+
const timed = extra.startedAtMs !== void 0 && extra.startedAtMs !== null && extra.completedAtMs !== void 0;
|
|
17539
|
+
try {
|
|
17540
|
+
return {
|
|
17541
|
+
kind: "request",
|
|
17542
|
+
request: parseHostUsageRequest({
|
|
17543
|
+
requestId,
|
|
17544
|
+
...extra.historical ? { historical: true } : {},
|
|
17545
|
+
model: model2,
|
|
17546
|
+
// Claude Code's providers (first-party, Bedrock, Vertex, gateways) differ in model IDs,
|
|
17547
|
+
// not in list prices; the model ID alone resolves the price.
|
|
17548
|
+
inputTokens: input + cacheRead + cacheWrite,
|
|
17549
|
+
cachedInputTokens: cacheRead,
|
|
17550
|
+
cacheWriteInputTokens: cacheWrite,
|
|
17551
|
+
// Mirrors Claude Code's own pricing: one-hour writes are capped by the total writes.
|
|
17552
|
+
...oneHour !== null ? { cacheWrite1hInputTokens: Math.min(oneHour, cacheWrite) } : {},
|
|
17553
|
+
outputTokens: output,
|
|
17554
|
+
...thinking !== null && thinking <= output ? { reasoningOutputTokens: thinking } : {},
|
|
17555
|
+
...timed ? { startedAtMs: extra.startedAtMs, completedAtMs: extra.completedAtMs } : {}
|
|
17556
|
+
})
|
|
17557
|
+
};
|
|
17558
|
+
} catch {
|
|
17559
|
+
return { kind: "missing" };
|
|
17560
|
+
}
|
|
17561
|
+
}
|
|
17562
|
+
function claudeUsageHistory(entries) {
|
|
17563
|
+
const usages = /* @__PURE__ */ new Map();
|
|
17564
|
+
let complete = true;
|
|
17565
|
+
for (const entry of entries) {
|
|
17566
|
+
if (!isRecord2(entry) || entry.type !== "assistant" || entry.isSidechain === true)
|
|
17567
|
+
continue;
|
|
17568
|
+
const message = entry.message;
|
|
17569
|
+
if (!isRecord2(message) || !isClaudeModelRequest(message.model))
|
|
17570
|
+
continue;
|
|
17571
|
+
if (typeof message.id !== "string" || message.id.length === 0) {
|
|
17572
|
+
complete = false;
|
|
17573
|
+
continue;
|
|
17574
|
+
}
|
|
17575
|
+
usages.set(message.id, { model: message.model, usage: message.usage });
|
|
17576
|
+
}
|
|
17577
|
+
const requests = [];
|
|
17578
|
+
for (const [id, { model: model2, usage }] of usages) {
|
|
17579
|
+
const record2 = claudeUsageRecord(id, model2, usage, { historical: true });
|
|
17580
|
+
if (record2.kind === "request")
|
|
17581
|
+
requests.push(record2.request);
|
|
17582
|
+
else
|
|
17583
|
+
complete = false;
|
|
17584
|
+
}
|
|
17585
|
+
return { requests, complete };
|
|
17586
|
+
}
|
|
17587
|
+
|
|
17588
|
+
// dist/claude-usage-statistics.js
|
|
17589
|
+
import os2 from "node:os";
|
|
17590
|
+
import path3 from "node:path";
|
|
17591
|
+
|
|
17592
|
+
// ../../harness-adapter/dist/usage-statistics.js
|
|
17593
|
+
import { createReadStream } from "node:fs";
|
|
17594
|
+
import { lstat as lstat2, opendir } from "node:fs/promises";
|
|
17595
|
+
import path2 from "node:path";
|
|
17596
|
+
import { createInterface } from "node:readline";
|
|
17597
|
+
var MAX_SESSION_ID_LENGTH = 512;
|
|
17598
|
+
var MAX_CWD_LENGTH = 4096;
|
|
17599
|
+
function sessionIdOk(value) {
|
|
17600
|
+
return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
|
|
17601
|
+
}
|
|
17602
|
+
function cwdOk(value) {
|
|
17603
|
+
return typeof value === "string" && value.length > 0 && value.length <= MAX_CWD_LENGTH && !value.includes("\0") && (value.startsWith("/") || /^[A-Za-z]:[\\/]/u.test(value) || value.startsWith("\\\\"));
|
|
17604
|
+
}
|
|
17605
|
+
function withUsageSession(entry, session) {
|
|
17606
|
+
const sessionId = sessionIdOk(session.sessionId) ? session.sessionId : void 0;
|
|
17607
|
+
const cwd = cwdOk(session.cwd) ? session.cwd : void 0;
|
|
17608
|
+
if (sessionId === void 0 && cwd === void 0)
|
|
17609
|
+
return entry;
|
|
17610
|
+
return {
|
|
17611
|
+
...entry,
|
|
17612
|
+
...sessionId !== void 0 ? { sessionId } : {},
|
|
17613
|
+
...cwd !== void 0 ? { cwd } : {}
|
|
17614
|
+
};
|
|
17615
|
+
}
|
|
17616
|
+
function usageEntryFromRequest(request, occurredAtMs) {
|
|
17617
|
+
if (!Number.isSafeInteger(occurredAtMs) || occurredAtMs <= 0)
|
|
17618
|
+
return null;
|
|
17619
|
+
return {
|
|
17620
|
+
id: request.requestId,
|
|
17621
|
+
occurredAtMs,
|
|
17622
|
+
...request.model !== void 0 ? { model: request.model } : {},
|
|
17623
|
+
inputTokens: request.inputTokens,
|
|
17624
|
+
...request.cachedInputTokens !== void 0 ? { cachedInputTokens: request.cachedInputTokens } : {},
|
|
17625
|
+
...request.cacheWriteInputTokens !== void 0 ? { cacheWriteInputTokens: request.cacheWriteInputTokens } : {},
|
|
17626
|
+
...request.cacheWrite1hInputTokens !== void 0 ? { cacheWrite1hInputTokens: request.cacheWrite1hInputTokens } : {},
|
|
17627
|
+
outputTokens: request.outputTokens,
|
|
17628
|
+
...request.reasoningOutputTokens !== void 0 ? { reasoningOutputTokens: request.reasoningOutputTokens } : {}
|
|
17629
|
+
};
|
|
17630
|
+
}
|
|
17631
|
+
async function jsonlUsageSources(root, maxDepth, signal) {
|
|
17632
|
+
const sources = [];
|
|
17633
|
+
const visit = async (directory, depth) => {
|
|
17634
|
+
signal.throwIfAborted();
|
|
17635
|
+
const entries = await opendir(directory).catch((error52) => {
|
|
17636
|
+
if (error52.code === "ENOENT")
|
|
17637
|
+
return null;
|
|
17638
|
+
throw error52;
|
|
17639
|
+
});
|
|
17640
|
+
if (!entries)
|
|
17641
|
+
return;
|
|
17642
|
+
for await (const entry of entries) {
|
|
17643
|
+
signal.throwIfAborted();
|
|
17644
|
+
const file2 = path2.join(directory, entry.name);
|
|
17645
|
+
if (entry.isDirectory()) {
|
|
17646
|
+
if (depth < maxDepth)
|
|
17647
|
+
await visit(file2, depth + 1);
|
|
17648
|
+
} else if (entry.isFile() && entry.name.endsWith(".jsonl")) {
|
|
17649
|
+
const info = await lstat2(file2).catch(() => null);
|
|
17650
|
+
if (info?.isFile() && info.size > 0) {
|
|
17651
|
+
sources.push({ id: file2, fingerprint: `${info.ino}:${info.size}:${info.mtimeMs}` });
|
|
17652
|
+
}
|
|
17653
|
+
}
|
|
17654
|
+
}
|
|
17655
|
+
};
|
|
17656
|
+
await visit(root, 0);
|
|
17657
|
+
return sources;
|
|
17658
|
+
}
|
|
17659
|
+
async function* jsonlRecords(file2, marker, signal) {
|
|
17660
|
+
const lines = createInterface({
|
|
17661
|
+
input: createReadStream(file2, { encoding: "utf8", signal }),
|
|
17662
|
+
crlfDelay: Infinity
|
|
17663
|
+
});
|
|
17664
|
+
for await (const line of lines) {
|
|
17665
|
+
if (!line.includes(marker))
|
|
17666
|
+
continue;
|
|
17667
|
+
let value;
|
|
17668
|
+
try {
|
|
17669
|
+
value = JSON.parse(line);
|
|
17670
|
+
} catch {
|
|
17671
|
+
continue;
|
|
17672
|
+
}
|
|
17673
|
+
if (typeof value === "object" && value !== null && !Array.isArray(value)) {
|
|
17674
|
+
yield value;
|
|
17675
|
+
}
|
|
17676
|
+
}
|
|
17677
|
+
}
|
|
17678
|
+
function nativeTimeMs(value) {
|
|
17679
|
+
const time3 = typeof value === "number" ? value : typeof value === "string" ? Date.parse(value) : Number.NaN;
|
|
17680
|
+
return Number.isFinite(time3) && time3 > 0 ? Math.floor(time3) : null;
|
|
17681
|
+
}
|
|
17682
|
+
|
|
17683
|
+
// dist/claude-usage-statistics.js
|
|
17684
|
+
function isRecord3(value) {
|
|
17685
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
17686
|
+
}
|
|
17687
|
+
function claudeProjectsDirectory(environment) {
|
|
17688
|
+
return path3.join(path3.resolve(environment.CLAUDE_CONFIG_DIR ?? path3.join(os2.homedir(), ".claude")), "projects");
|
|
17689
|
+
}
|
|
17690
|
+
async function readClaudeUsage(file2, signal) {
|
|
17691
|
+
const messages = /* @__PURE__ */ new Map();
|
|
17692
|
+
let sessionId;
|
|
17693
|
+
let cwd;
|
|
17694
|
+
for await (const line of jsonlRecords(file2, '"assistant"', signal)) {
|
|
17695
|
+
if (line.type !== "assistant" || !isRecord3(line.message))
|
|
17696
|
+
continue;
|
|
17697
|
+
sessionId ??= line.sessionId;
|
|
17698
|
+
cwd ??= line.cwd;
|
|
17699
|
+
const { id, model: model2, usage } = line.message;
|
|
17700
|
+
if (typeof id !== "string" || id.length === 0 || !isClaudeModelRequest(model2))
|
|
17701
|
+
continue;
|
|
17702
|
+
const at2 = messages.get(id)?.at ?? nativeTimeMs(line.timestamp);
|
|
17703
|
+
messages.set(id, { model: model2, usage, at: at2 });
|
|
17704
|
+
}
|
|
17705
|
+
const entries = [];
|
|
17706
|
+
for (const [id, { model: model2, usage, at: at2 }] of messages) {
|
|
17707
|
+
const record2 = claudeUsageRecord(id, model2, usage);
|
|
17708
|
+
const entry = record2.kind === "request" && at2 !== null && usageEntryFromRequest(record2.request, at2);
|
|
17709
|
+
if (entry)
|
|
17710
|
+
entries.push(withUsageSession(entry, { sessionId: text(sessionId), cwd: text(cwd) }));
|
|
17711
|
+
}
|
|
17712
|
+
return entries;
|
|
17713
|
+
}
|
|
17714
|
+
function text(value) {
|
|
17715
|
+
return typeof value === "string" ? value : void 0;
|
|
17716
|
+
}
|
|
17717
|
+
function createClaudeUsageStatistics(environment) {
|
|
17718
|
+
return Object.freeze({
|
|
17719
|
+
// projects/<project>/<id>.jsonl, <id>/subagents/*.jsonl, <id>/subagents/workflows/wf_*/*.jsonl
|
|
17720
|
+
listSources: (signal) => jsonlUsageSources(claudeProjectsDirectory(environment), 4, signal),
|
|
17721
|
+
readSource: (id, signal) => readClaudeUsage(id, signal)
|
|
17722
|
+
});
|
|
17723
|
+
}
|
|
17724
|
+
|
|
16951
17725
|
// dist/claude-code-adapter.js
|
|
16952
17726
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
16953
|
-
import
|
|
17727
|
+
import path18 from "node:path";
|
|
16954
17728
|
|
|
16955
17729
|
// ../../../node_modules/@anthropic-ai/claude-agent-sdk/sdk.mjs
|
|
16956
17730
|
import { createRequire as DW } from "node:module";
|
|
@@ -17544,6 +18318,12 @@ var E0 = v(function(Dot, Ore) {
|
|
|
17544
18318
|
Ore.exports = { "application/1d-interleaved-parityfec": { source: "iana" }, "application/3gpdash-qoe-report+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/3gpp-ims+xml": { source: "iana", compressible: true }, "application/3gpphal+json": { source: "iana", compressible: true }, "application/3gpphalforms+json": { source: "iana", compressible: true }, "application/a2l": { source: "iana" }, "application/ace+cbor": { source: "iana" }, "application/activemessage": { source: "iana" }, "application/activity+json": { source: "iana", compressible: true }, "application/alto-costmap+json": { source: "iana", compressible: true }, "application/alto-costmapfilter+json": { source: "iana", compressible: true }, "application/alto-directory+json": { source: "iana", compressible: true }, "application/alto-endpointcost+json": { source: "iana", compressible: true }, "application/alto-endpointcostparams+json": { source: "iana", compressible: true }, "application/alto-endpointprop+json": { source: "iana", compressible: true }, "application/alto-endpointpropparams+json": { source: "iana", compressible: true }, "application/alto-error+json": { source: "iana", compressible: true }, "application/alto-networkmap+json": { source: "iana", compressible: true }, "application/alto-networkmapfilter+json": { source: "iana", compressible: true }, "application/alto-updatestreamcontrol+json": { source: "iana", compressible: true }, "application/alto-updatestreamparams+json": { source: "iana", compressible: true }, "application/aml": { source: "iana" }, "application/andrew-inset": { source: "iana", extensions: ["ez"] }, "application/applefile": { source: "iana" }, "application/applixware": { source: "apache", extensions: ["aw"] }, "application/at+jwt": { source: "iana" }, "application/atf": { source: "iana" }, "application/atfx": { source: "iana" }, "application/atom+xml": { source: "iana", compressible: true, extensions: ["atom"] }, "application/atomcat+xml": { source: "iana", compressible: true, extensions: ["atomcat"] }, "application/atomdeleted+xml": { source: "iana", compressible: true, extensions: ["atomdeleted"] }, "application/atomicmail": { source: "iana" }, "application/atomsvc+xml": { source: "iana", compressible: true, extensions: ["atomsvc"] }, "application/atsc-dwd+xml": { source: "iana", compressible: true, extensions: ["dwd"] }, "application/atsc-dynamic-event-message": { source: "iana" }, "application/atsc-held+xml": { source: "iana", compressible: true, extensions: ["held"] }, "application/atsc-rdt+json": { source: "iana", compressible: true }, "application/atsc-rsat+xml": { source: "iana", compressible: true, extensions: ["rsat"] }, "application/atxml": { source: "iana" }, "application/auth-policy+xml": { source: "iana", compressible: true }, "application/bacnet-xdd+zip": { source: "iana", compressible: false }, "application/batch-smtp": { source: "iana" }, "application/bdoc": { compressible: false, extensions: ["bdoc"] }, "application/beep+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/calendar+json": { source: "iana", compressible: true }, "application/calendar+xml": { source: "iana", compressible: true, extensions: ["xcs"] }, "application/call-completion": { source: "iana" }, "application/cals-1840": { source: "iana" }, "application/captive+json": { source: "iana", compressible: true }, "application/cbor": { source: "iana" }, "application/cbor-seq": { source: "iana" }, "application/cccex": { source: "iana" }, "application/ccmp+xml": { source: "iana", compressible: true }, "application/ccxml+xml": { source: "iana", compressible: true, extensions: ["ccxml"] }, "application/cdfx+xml": { source: "iana", compressible: true, extensions: ["cdfx"] }, "application/cdmi-capability": { source: "iana", extensions: ["cdmia"] }, "application/cdmi-container": { source: "iana", extensions: ["cdmic"] }, "application/cdmi-domain": { source: "iana", extensions: ["cdmid"] }, "application/cdmi-object": { source: "iana", extensions: ["cdmio"] }, "application/cdmi-queue": { source: "iana", extensions: ["cdmiq"] }, "application/cdni": { source: "iana" }, "application/cea": { source: "iana" }, "application/cea-2018+xml": { source: "iana", compressible: true }, "application/cellml+xml": { source: "iana", compressible: true }, "application/cfw": { source: "iana" }, "application/city+json": { source: "iana", compressible: true }, "application/clr": { source: "iana" }, "application/clue+xml": { source: "iana", compressible: true }, "application/clue_info+xml": { source: "iana", compressible: true }, "application/cms": { source: "iana" }, "application/cnrp+xml": { source: "iana", compressible: true }, "application/coap-group+json": { source: "iana", compressible: true }, "application/coap-payload": { source: "iana" }, "application/commonground": { source: "iana" }, "application/conference-info+xml": { source: "iana", compressible: true }, "application/cose": { source: "iana" }, "application/cose-key": { source: "iana" }, "application/cose-key-set": { source: "iana" }, "application/cpl+xml": { source: "iana", compressible: true, extensions: ["cpl"] }, "application/csrattrs": { source: "iana" }, "application/csta+xml": { source: "iana", compressible: true }, "application/cstadata+xml": { source: "iana", compressible: true }, "application/csvm+json": { source: "iana", compressible: true }, "application/cu-seeme": { source: "apache", extensions: ["cu"] }, "application/cwt": { source: "iana" }, "application/cybercash": { source: "iana" }, "application/dart": { compressible: true }, "application/dash+xml": { source: "iana", compressible: true, extensions: ["mpd"] }, "application/dash-patch+xml": { source: "iana", compressible: true, extensions: ["mpp"] }, "application/dashdelta": { source: "iana" }, "application/davmount+xml": { source: "iana", compressible: true, extensions: ["davmount"] }, "application/dca-rft": { source: "iana" }, "application/dcd": { source: "iana" }, "application/dec-dx": { source: "iana" }, "application/dialog-info+xml": { source: "iana", compressible: true }, "application/dicom": { source: "iana" }, "application/dicom+json": { source: "iana", compressible: true }, "application/dicom+xml": { source: "iana", compressible: true }, "application/dii": { source: "iana" }, "application/dit": { source: "iana" }, "application/dns": { source: "iana" }, "application/dns+json": { source: "iana", compressible: true }, "application/dns-message": { source: "iana" }, "application/docbook+xml": { source: "apache", compressible: true, extensions: ["dbk"] }, "application/dots+cbor": { source: "iana" }, "application/dskpp+xml": { source: "iana", compressible: true }, "application/dssc+der": { source: "iana", extensions: ["dssc"] }, "application/dssc+xml": { source: "iana", compressible: true, extensions: ["xdssc"] }, "application/dvcs": { source: "iana" }, "application/ecmascript": { source: "iana", compressible: true, extensions: ["es", "ecma"] }, "application/edi-consent": { source: "iana" }, "application/edi-x12": { source: "iana", compressible: false }, "application/edifact": { source: "iana", compressible: false }, "application/efi": { source: "iana" }, "application/elm+json": { source: "iana", charset: "UTF-8", compressible: true }, "application/elm+xml": { source: "iana", compressible: true }, "application/emergencycalldata.cap+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/emergencycalldata.comment+xml": { source: "iana", compressible: true }, "application/emergencycalldata.control+xml": { source: "iana", compressible: true }, "application/emergencycalldata.deviceinfo+xml": { source: "iana", compressible: true }, "application/emergencycalldata.ecall.msd": { source: "iana" }, "application/emergencycalldata.providerinfo+xml": { source: "iana", compressible: true }, "application/emergencycalldata.serviceinfo+xml": { source: "iana", compressible: true }, "application/emergencycalldata.subscriberinfo+xml": { source: "iana", compressible: true }, "application/emergencycalldata.veds+xml": { source: "iana", compressible: true }, "application/emma+xml": { source: "iana", compressible: true, extensions: ["emma"] }, "application/emotionml+xml": { source: "iana", compressible: true, extensions: ["emotionml"] }, "application/encaprtp": { source: "iana" }, "application/epp+xml": { source: "iana", compressible: true }, "application/epub+zip": { source: "iana", compressible: false, extensions: ["epub"] }, "application/eshop": { source: "iana" }, "application/exi": { source: "iana", extensions: ["exi"] }, "application/expect-ct-report+json": { source: "iana", compressible: true }, "application/express": { source: "iana", extensions: ["exp"] }, "application/fastinfoset": { source: "iana" }, "application/fastsoap": { source: "iana" }, "application/fdt+xml": { source: "iana", compressible: true, extensions: ["fdt"] }, "application/fhir+json": { source: "iana", charset: "UTF-8", compressible: true }, "application/fhir+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/fido.trusted-apps+json": { compressible: true }, "application/fits": { source: "iana" }, "application/flexfec": { source: "iana" }, "application/font-sfnt": { source: "iana" }, "application/font-tdpfr": { source: "iana", extensions: ["pfr"] }, "application/font-woff": { source: "iana", compressible: false }, "application/framework-attributes+xml": { source: "iana", compressible: true }, "application/geo+json": { source: "iana", compressible: true, extensions: ["geojson"] }, "application/geo+json-seq": { source: "iana" }, "application/geopackage+sqlite3": { source: "iana" }, "application/geoxacml+xml": { source: "iana", compressible: true }, "application/gltf-buffer": { source: "iana" }, "application/gml+xml": { source: "iana", compressible: true, extensions: ["gml"] }, "application/gpx+xml": { source: "apache", compressible: true, extensions: ["gpx"] }, "application/gxf": { source: "apache", extensions: ["gxf"] }, "application/gzip": { source: "iana", compressible: false, extensions: ["gz"] }, "application/h224": { source: "iana" }, "application/held+xml": { source: "iana", compressible: true }, "application/hjson": { extensions: ["hjson"] }, "application/http": { source: "iana" }, "application/hyperstudio": { source: "iana", extensions: ["stk"] }, "application/ibe-key-request+xml": { source: "iana", compressible: true }, "application/ibe-pkg-reply+xml": { source: "iana", compressible: true }, "application/ibe-pp-data": { source: "iana" }, "application/iges": { source: "iana" }, "application/im-iscomposing+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/index": { source: "iana" }, "application/index.cmd": { source: "iana" }, "application/index.obj": { source: "iana" }, "application/index.response": { source: "iana" }, "application/index.vnd": { source: "iana" }, "application/inkml+xml": { source: "iana", compressible: true, extensions: ["ink", "inkml"] }, "application/iotp": { source: "iana" }, "application/ipfix": { source: "iana", extensions: ["ipfix"] }, "application/ipp": { source: "iana" }, "application/isup": { source: "iana" }, "application/its+xml": { source: "iana", compressible: true, extensions: ["its"] }, "application/java-archive": { source: "apache", compressible: false, extensions: ["jar", "war", "ear"] }, "application/java-serialized-object": { source: "apache", compressible: false, extensions: ["ser"] }, "application/java-vm": { source: "apache", compressible: false, extensions: ["class"] }, "application/javascript": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["js", "mjs"] }, "application/jf2feed+json": { source: "iana", compressible: true }, "application/jose": { source: "iana" }, "application/jose+json": { source: "iana", compressible: true }, "application/jrd+json": { source: "iana", compressible: true }, "application/jscalendar+json": { source: "iana", compressible: true }, "application/json": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["json", "map"] }, "application/json-patch+json": { source: "iana", compressible: true }, "application/json-seq": { source: "iana" }, "application/json5": { extensions: ["json5"] }, "application/jsonml+json": { source: "apache", compressible: true, extensions: ["jsonml"] }, "application/jwk+json": { source: "iana", compressible: true }, "application/jwk-set+json": { source: "iana", compressible: true }, "application/jwt": { source: "iana" }, "application/kpml-request+xml": { source: "iana", compressible: true }, "application/kpml-response+xml": { source: "iana", compressible: true }, "application/ld+json": { source: "iana", compressible: true, extensions: ["jsonld"] }, "application/lgr+xml": { source: "iana", compressible: true, extensions: ["lgr"] }, "application/link-format": { source: "iana" }, "application/load-control+xml": { source: "iana", compressible: true }, "application/lost+xml": { source: "iana", compressible: true, extensions: ["lostxml"] }, "application/lostsync+xml": { source: "iana", compressible: true }, "application/lpf+zip": { source: "iana", compressible: false }, "application/lxf": { source: "iana" }, "application/mac-binhex40": { source: "iana", extensions: ["hqx"] }, "application/mac-compactpro": { source: "apache", extensions: ["cpt"] }, "application/macwriteii": { source: "iana" }, "application/mads+xml": { source: "iana", compressible: true, extensions: ["mads"] }, "application/manifest+json": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["webmanifest"] }, "application/marc": { source: "iana", extensions: ["mrc"] }, "application/marcxml+xml": { source: "iana", compressible: true, extensions: ["mrcx"] }, "application/mathematica": { source: "iana", extensions: ["ma", "nb", "mb"] }, "application/mathml+xml": { source: "iana", compressible: true, extensions: ["mathml"] }, "application/mathml-content+xml": { source: "iana", compressible: true }, "application/mathml-presentation+xml": { source: "iana", compressible: true }, "application/mbms-associated-procedure-description+xml": { source: "iana", compressible: true }, "application/mbms-deregister+xml": { source: "iana", compressible: true }, "application/mbms-envelope+xml": { source: "iana", compressible: true }, "application/mbms-msk+xml": { source: "iana", compressible: true }, "application/mbms-msk-response+xml": { source: "iana", compressible: true }, "application/mbms-protection-description+xml": { source: "iana", compressible: true }, "application/mbms-reception-report+xml": { source: "iana", compressible: true }, "application/mbms-register+xml": { source: "iana", compressible: true }, "application/mbms-register-response+xml": { source: "iana", compressible: true }, "application/mbms-schedule+xml": { source: "iana", compressible: true }, "application/mbms-user-service-description+xml": { source: "iana", compressible: true }, "application/mbox": { source: "iana", extensions: ["mbox"] }, "application/media-policy-dataset+xml": { source: "iana", compressible: true, extensions: ["mpf"] }, "application/media_control+xml": { source: "iana", compressible: true }, "application/mediaservercontrol+xml": { source: "iana", compressible: true, extensions: ["mscml"] }, "application/merge-patch+json": { source: "iana", compressible: true }, "application/metalink+xml": { source: "apache", compressible: true, extensions: ["metalink"] }, "application/metalink4+xml": { source: "iana", compressible: true, extensions: ["meta4"] }, "application/mets+xml": { source: "iana", compressible: true, extensions: ["mets"] }, "application/mf4": { source: "iana" }, "application/mikey": { source: "iana" }, "application/mipc": { source: "iana" }, "application/missing-blocks+cbor-seq": { source: "iana" }, "application/mmt-aei+xml": { source: "iana", compressible: true, extensions: ["maei"] }, "application/mmt-usd+xml": { source: "iana", compressible: true, extensions: ["musd"] }, "application/mods+xml": { source: "iana", compressible: true, extensions: ["mods"] }, "application/moss-keys": { source: "iana" }, "application/moss-signature": { source: "iana" }, "application/mosskey-data": { source: "iana" }, "application/mosskey-request": { source: "iana" }, "application/mp21": { source: "iana", extensions: ["m21", "mp21"] }, "application/mp4": { source: "iana", extensions: ["mp4s", "m4p"] }, "application/mpeg4-generic": { source: "iana" }, "application/mpeg4-iod": { source: "iana" }, "application/mpeg4-iod-xmt": { source: "iana" }, "application/mrb-consumer+xml": { source: "iana", compressible: true }, "application/mrb-publish+xml": { source: "iana", compressible: true }, "application/msc-ivr+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/msc-mixer+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/msword": { source: "iana", compressible: false, extensions: ["doc", "dot"] }, "application/mud+json": { source: "iana", compressible: true }, "application/multipart-core": { source: "iana" }, "application/mxf": { source: "iana", extensions: ["mxf"] }, "application/n-quads": { source: "iana", extensions: ["nq"] }, "application/n-triples": { source: "iana", extensions: ["nt"] }, "application/nasdata": { source: "iana" }, "application/news-checkgroups": { source: "iana", charset: "US-ASCII" }, "application/news-groupinfo": { source: "iana", charset: "US-ASCII" }, "application/news-transmission": { source: "iana" }, "application/nlsml+xml": { source: "iana", compressible: true }, "application/node": { source: "iana", extensions: ["cjs"] }, "application/nss": { source: "iana" }, "application/oauth-authz-req+jwt": { source: "iana" }, "application/oblivious-dns-message": { source: "iana" }, "application/ocsp-request": { source: "iana" }, "application/ocsp-response": { source: "iana" }, "application/octet-stream": { source: "iana", compressible: false, extensions: ["bin", "dms", "lrf", "mar", "so", "dist", "distz", "pkg", "bpk", "dump", "elc", "deploy", "exe", "dll", "deb", "dmg", "iso", "img", "msi", "msp", "msm", "buffer"] }, "application/oda": { source: "iana", extensions: ["oda"] }, "application/odm+xml": { source: "iana", compressible: true }, "application/odx": { source: "iana" }, "application/oebps-package+xml": { source: "iana", compressible: true, extensions: ["opf"] }, "application/ogg": { source: "iana", compressible: false, extensions: ["ogx"] }, "application/omdoc+xml": { source: "apache", compressible: true, extensions: ["omdoc"] }, "application/onenote": { source: "apache", extensions: ["onetoc", "onetoc2", "onetmp", "onepkg"] }, "application/opc-nodeset+xml": { source: "iana", compressible: true }, "application/oscore": { source: "iana" }, "application/oxps": { source: "iana", extensions: ["oxps"] }, "application/p21": { source: "iana" }, "application/p21+zip": { source: "iana", compressible: false }, "application/p2p-overlay+xml": { source: "iana", compressible: true, extensions: ["relo"] }, "application/parityfec": { source: "iana" }, "application/passport": { source: "iana" }, "application/patch-ops-error+xml": { source: "iana", compressible: true, extensions: ["xer"] }, "application/pdf": { source: "iana", compressible: false, extensions: ["pdf"] }, "application/pdx": { source: "iana" }, "application/pem-certificate-chain": { source: "iana" }, "application/pgp-encrypted": { source: "iana", compressible: false, extensions: ["pgp"] }, "application/pgp-keys": { source: "iana", extensions: ["asc"] }, "application/pgp-signature": { source: "iana", extensions: ["asc", "sig"] }, "application/pics-rules": { source: "apache", extensions: ["prf"] }, "application/pidf+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/pidf-diff+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/pkcs10": { source: "iana", extensions: ["p10"] }, "application/pkcs12": { source: "iana" }, "application/pkcs7-mime": { source: "iana", extensions: ["p7m", "p7c"] }, "application/pkcs7-signature": { source: "iana", extensions: ["p7s"] }, "application/pkcs8": { source: "iana", extensions: ["p8"] }, "application/pkcs8-encrypted": { source: "iana" }, "application/pkix-attr-cert": { source: "iana", extensions: ["ac"] }, "application/pkix-cert": { source: "iana", extensions: ["cer"] }, "application/pkix-crl": { source: "iana", extensions: ["crl"] }, "application/pkix-pkipath": { source: "iana", extensions: ["pkipath"] }, "application/pkixcmp": { source: "iana", extensions: ["pki"] }, "application/pls+xml": { source: "iana", compressible: true, extensions: ["pls"] }, "application/poc-settings+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/postscript": { source: "iana", compressible: true, extensions: ["ai", "eps", "ps"] }, "application/ppsp-tracker+json": { source: "iana", compressible: true }, "application/problem+json": { source: "iana", compressible: true }, "application/problem+xml": { source: "iana", compressible: true }, "application/provenance+xml": { source: "iana", compressible: true, extensions: ["provx"] }, "application/prs.alvestrand.titrax-sheet": { source: "iana" }, "application/prs.cww": { source: "iana", extensions: ["cww"] }, "application/prs.cyn": { source: "iana", charset: "7-BIT" }, "application/prs.hpub+zip": { source: "iana", compressible: false }, "application/prs.nprend": { source: "iana" }, "application/prs.plucker": { source: "iana" }, "application/prs.rdf-xml-crypt": { source: "iana" }, "application/prs.xsf+xml": { source: "iana", compressible: true }, "application/pskc+xml": { source: "iana", compressible: true, extensions: ["pskcxml"] }, "application/pvd+json": { source: "iana", compressible: true }, "application/qsig": { source: "iana" }, "application/raml+yaml": { compressible: true, extensions: ["raml"] }, "application/raptorfec": { source: "iana" }, "application/rdap+json": { source: "iana", compressible: true }, "application/rdf+xml": { source: "iana", compressible: true, extensions: ["rdf", "owl"] }, "application/reginfo+xml": { source: "iana", compressible: true, extensions: ["rif"] }, "application/relax-ng-compact-syntax": { source: "iana", extensions: ["rnc"] }, "application/remote-printing": { source: "iana" }, "application/reputon+json": { source: "iana", compressible: true }, "application/resource-lists+xml": { source: "iana", compressible: true, extensions: ["rl"] }, "application/resource-lists-diff+xml": { source: "iana", compressible: true, extensions: ["rld"] }, "application/rfc+xml": { source: "iana", compressible: true }, "application/riscos": { source: "iana" }, "application/rlmi+xml": { source: "iana", compressible: true }, "application/rls-services+xml": { source: "iana", compressible: true, extensions: ["rs"] }, "application/route-apd+xml": { source: "iana", compressible: true, extensions: ["rapd"] }, "application/route-s-tsid+xml": { source: "iana", compressible: true, extensions: ["sls"] }, "application/route-usd+xml": { source: "iana", compressible: true, extensions: ["rusd"] }, "application/rpki-ghostbusters": { source: "iana", extensions: ["gbr"] }, "application/rpki-manifest": { source: "iana", extensions: ["mft"] }, "application/rpki-publication": { source: "iana" }, "application/rpki-roa": { source: "iana", extensions: ["roa"] }, "application/rpki-updown": { source: "iana" }, "application/rsd+xml": { source: "apache", compressible: true, extensions: ["rsd"] }, "application/rss+xml": { source: "apache", compressible: true, extensions: ["rss"] }, "application/rtf": { source: "iana", compressible: true, extensions: ["rtf"] }, "application/rtploopback": { source: "iana" }, "application/rtx": { source: "iana" }, "application/samlassertion+xml": { source: "iana", compressible: true }, "application/samlmetadata+xml": { source: "iana", compressible: true }, "application/sarif+json": { source: "iana", compressible: true }, "application/sarif-external-properties+json": { source: "iana", compressible: true }, "application/sbe": { source: "iana" }, "application/sbml+xml": { source: "iana", compressible: true, extensions: ["sbml"] }, "application/scaip+xml": { source: "iana", compressible: true }, "application/scim+json": { source: "iana", compressible: true }, "application/scvp-cv-request": { source: "iana", extensions: ["scq"] }, "application/scvp-cv-response": { source: "iana", extensions: ["scs"] }, "application/scvp-vp-request": { source: "iana", extensions: ["spq"] }, "application/scvp-vp-response": { source: "iana", extensions: ["spp"] }, "application/sdp": { source: "iana", extensions: ["sdp"] }, "application/secevent+jwt": { source: "iana" }, "application/senml+cbor": { source: "iana" }, "application/senml+json": { source: "iana", compressible: true }, "application/senml+xml": { source: "iana", compressible: true, extensions: ["senmlx"] }, "application/senml-etch+cbor": { source: "iana" }, "application/senml-etch+json": { source: "iana", compressible: true }, "application/senml-exi": { source: "iana" }, "application/sensml+cbor": { source: "iana" }, "application/sensml+json": { source: "iana", compressible: true }, "application/sensml+xml": { source: "iana", compressible: true, extensions: ["sensmlx"] }, "application/sensml-exi": { source: "iana" }, "application/sep+xml": { source: "iana", compressible: true }, "application/sep-exi": { source: "iana" }, "application/session-info": { source: "iana" }, "application/set-payment": { source: "iana" }, "application/set-payment-initiation": { source: "iana", extensions: ["setpay"] }, "application/set-registration": { source: "iana" }, "application/set-registration-initiation": { source: "iana", extensions: ["setreg"] }, "application/sgml": { source: "iana" }, "application/sgml-open-catalog": { source: "iana" }, "application/shf+xml": { source: "iana", compressible: true, extensions: ["shf"] }, "application/sieve": { source: "iana", extensions: ["siv", "sieve"] }, "application/simple-filter+xml": { source: "iana", compressible: true }, "application/simple-message-summary": { source: "iana" }, "application/simplesymbolcontainer": { source: "iana" }, "application/sipc": { source: "iana" }, "application/slate": { source: "iana" }, "application/smil": { source: "iana" }, "application/smil+xml": { source: "iana", compressible: true, extensions: ["smi", "smil"] }, "application/smpte336m": { source: "iana" }, "application/soap+fastinfoset": { source: "iana" }, "application/soap+xml": { source: "iana", compressible: true }, "application/sparql-query": { source: "iana", extensions: ["rq"] }, "application/sparql-results+xml": { source: "iana", compressible: true, extensions: ["srx"] }, "application/spdx+json": { source: "iana", compressible: true }, "application/spirits-event+xml": { source: "iana", compressible: true }, "application/sql": { source: "iana" }, "application/srgs": { source: "iana", extensions: ["gram"] }, "application/srgs+xml": { source: "iana", compressible: true, extensions: ["grxml"] }, "application/sru+xml": { source: "iana", compressible: true, extensions: ["sru"] }, "application/ssdl+xml": { source: "apache", compressible: true, extensions: ["ssdl"] }, "application/ssml+xml": { source: "iana", compressible: true, extensions: ["ssml"] }, "application/stix+json": { source: "iana", compressible: true }, "application/swid+xml": { source: "iana", compressible: true, extensions: ["swidtag"] }, "application/tamp-apex-update": { source: "iana" }, "application/tamp-apex-update-confirm": { source: "iana" }, "application/tamp-community-update": { source: "iana" }, "application/tamp-community-update-confirm": { source: "iana" }, "application/tamp-error": { source: "iana" }, "application/tamp-sequence-adjust": { source: "iana" }, "application/tamp-sequence-adjust-confirm": { source: "iana" }, "application/tamp-status-query": { source: "iana" }, "application/tamp-status-response": { source: "iana" }, "application/tamp-update": { source: "iana" }, "application/tamp-update-confirm": { source: "iana" }, "application/tar": { compressible: true }, "application/taxii+json": { source: "iana", compressible: true }, "application/td+json": { source: "iana", compressible: true }, "application/tei+xml": { source: "iana", compressible: true, extensions: ["tei", "teicorpus"] }, "application/tetra_isi": { source: "iana" }, "application/thraud+xml": { source: "iana", compressible: true, extensions: ["tfi"] }, "application/timestamp-query": { source: "iana" }, "application/timestamp-reply": { source: "iana" }, "application/timestamped-data": { source: "iana", extensions: ["tsd"] }, "application/tlsrpt+gzip": { source: "iana" }, "application/tlsrpt+json": { source: "iana", compressible: true }, "application/tnauthlist": { source: "iana" }, "application/token-introspection+jwt": { source: "iana" }, "application/toml": { compressible: true, extensions: ["toml"] }, "application/trickle-ice-sdpfrag": { source: "iana" }, "application/trig": { source: "iana", extensions: ["trig"] }, "application/ttml+xml": { source: "iana", compressible: true, extensions: ["ttml"] }, "application/tve-trigger": { source: "iana" }, "application/tzif": { source: "iana" }, "application/tzif-leap": { source: "iana" }, "application/ubjson": { compressible: false, extensions: ["ubj"] }, "application/ulpfec": { source: "iana" }, "application/urc-grpsheet+xml": { source: "iana", compressible: true }, "application/urc-ressheet+xml": { source: "iana", compressible: true, extensions: ["rsheet"] }, "application/urc-targetdesc+xml": { source: "iana", compressible: true, extensions: ["td"] }, "application/urc-uisocketdesc+xml": { source: "iana", compressible: true }, "application/vcard+json": { source: "iana", compressible: true }, "application/vcard+xml": { source: "iana", compressible: true }, "application/vemmi": { source: "iana" }, "application/vividence.scriptfile": { source: "apache" }, "application/vnd.1000minds.decision-model+xml": { source: "iana", compressible: true, extensions: ["1km"] }, "application/vnd.3gpp-prose+xml": { source: "iana", compressible: true }, "application/vnd.3gpp-prose-pc3ch+xml": { source: "iana", compressible: true }, "application/vnd.3gpp-v2x-local-service-information": { source: "iana" }, "application/vnd.3gpp.5gnas": { source: "iana" }, "application/vnd.3gpp.access-transfer-events+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.bsf+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.gmop+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.gtpc": { source: "iana" }, "application/vnd.3gpp.interworking-data": { source: "iana" }, "application/vnd.3gpp.lpp": { source: "iana" }, "application/vnd.3gpp.mc-signalling-ear": { source: "iana" }, "application/vnd.3gpp.mcdata-affiliation-command+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcdata-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcdata-payload": { source: "iana" }, "application/vnd.3gpp.mcdata-service-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcdata-signalling": { source: "iana" }, "application/vnd.3gpp.mcdata-ue-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcdata-user-profile+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-affiliation-command+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-floor-request+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-location-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-mbms-usage-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-service-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-signed+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-ue-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-ue-init-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcptt-user-profile+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-affiliation-command+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-affiliation-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-location-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-mbms-usage-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-service-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-transmission-request+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-ue-config+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mcvideo-user-profile+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.mid-call+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.ngap": { source: "iana" }, "application/vnd.3gpp.pfcp": { source: "iana" }, "application/vnd.3gpp.pic-bw-large": { source: "iana", extensions: ["plb"] }, "application/vnd.3gpp.pic-bw-small": { source: "iana", extensions: ["psb"] }, "application/vnd.3gpp.pic-bw-var": { source: "iana", extensions: ["pvb"] }, "application/vnd.3gpp.s1ap": { source: "iana" }, "application/vnd.3gpp.sms": { source: "iana" }, "application/vnd.3gpp.sms+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.srvcc-ext+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.srvcc-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.state-and-event-info+xml": { source: "iana", compressible: true }, "application/vnd.3gpp.ussd+xml": { source: "iana", compressible: true }, "application/vnd.3gpp2.bcmcsinfo+xml": { source: "iana", compressible: true }, "application/vnd.3gpp2.sms": { source: "iana" }, "application/vnd.3gpp2.tcap": { source: "iana", extensions: ["tcap"] }, "application/vnd.3lightssoftware.imagescal": { source: "iana" }, "application/vnd.3m.post-it-notes": { source: "iana", extensions: ["pwn"] }, "application/vnd.accpac.simply.aso": { source: "iana", extensions: ["aso"] }, "application/vnd.accpac.simply.imp": { source: "iana", extensions: ["imp"] }, "application/vnd.acucobol": { source: "iana", extensions: ["acu"] }, "application/vnd.acucorp": { source: "iana", extensions: ["atc", "acutc"] }, "application/vnd.adobe.air-application-installer-package+zip": { source: "apache", compressible: false, extensions: ["air"] }, "application/vnd.adobe.flash.movie": { source: "iana" }, "application/vnd.adobe.formscentral.fcdt": { source: "iana", extensions: ["fcdt"] }, "application/vnd.adobe.fxp": { source: "iana", extensions: ["fxp", "fxpl"] }, "application/vnd.adobe.partial-upload": { source: "iana" }, "application/vnd.adobe.xdp+xml": { source: "iana", compressible: true, extensions: ["xdp"] }, "application/vnd.adobe.xfdf": { source: "iana", extensions: ["xfdf"] }, "application/vnd.aether.imp": { source: "iana" }, "application/vnd.afpc.afplinedata": { source: "iana" }, "application/vnd.afpc.afplinedata-pagedef": { source: "iana" }, "application/vnd.afpc.cmoca-cmresource": { source: "iana" }, "application/vnd.afpc.foca-charset": { source: "iana" }, "application/vnd.afpc.foca-codedfont": { source: "iana" }, "application/vnd.afpc.foca-codepage": { source: "iana" }, "application/vnd.afpc.modca": { source: "iana" }, "application/vnd.afpc.modca-cmtable": { source: "iana" }, "application/vnd.afpc.modca-formdef": { source: "iana" }, "application/vnd.afpc.modca-mediummap": { source: "iana" }, "application/vnd.afpc.modca-objectcontainer": { source: "iana" }, "application/vnd.afpc.modca-overlay": { source: "iana" }, "application/vnd.afpc.modca-pagesegment": { source: "iana" }, "application/vnd.age": { source: "iana", extensions: ["age"] }, "application/vnd.ah-barcode": { source: "iana" }, "application/vnd.ahead.space": { source: "iana", extensions: ["ahead"] }, "application/vnd.airzip.filesecure.azf": { source: "iana", extensions: ["azf"] }, "application/vnd.airzip.filesecure.azs": { source: "iana", extensions: ["azs"] }, "application/vnd.amadeus+json": { source: "iana", compressible: true }, "application/vnd.amazon.ebook": { source: "apache", extensions: ["azw"] }, "application/vnd.amazon.mobi8-ebook": { source: "iana" }, "application/vnd.americandynamics.acc": { source: "iana", extensions: ["acc"] }, "application/vnd.amiga.ami": { source: "iana", extensions: ["ami"] }, "application/vnd.amundsen.maze+xml": { source: "iana", compressible: true }, "application/vnd.android.ota": { source: "iana" }, "application/vnd.android.package-archive": { source: "apache", compressible: false, extensions: ["apk"] }, "application/vnd.anki": { source: "iana" }, "application/vnd.anser-web-certificate-issue-initiation": { source: "iana", extensions: ["cii"] }, "application/vnd.anser-web-funds-transfer-initiation": { source: "apache", extensions: ["fti"] }, "application/vnd.antix.game-component": { source: "iana", extensions: ["atx"] }, "application/vnd.apache.arrow.file": { source: "iana" }, "application/vnd.apache.arrow.stream": { source: "iana" }, "application/vnd.apache.thrift.binary": { source: "iana" }, "application/vnd.apache.thrift.compact": { source: "iana" }, "application/vnd.apache.thrift.json": { source: "iana" }, "application/vnd.api+json": { source: "iana", compressible: true }, "application/vnd.aplextor.warrp+json": { source: "iana", compressible: true }, "application/vnd.apothekende.reservation+json": { source: "iana", compressible: true }, "application/vnd.apple.installer+xml": { source: "iana", compressible: true, extensions: ["mpkg"] }, "application/vnd.apple.keynote": { source: "iana", extensions: ["key"] }, "application/vnd.apple.mpegurl": { source: "iana", extensions: ["m3u8"] }, "application/vnd.apple.numbers": { source: "iana", extensions: ["numbers"] }, "application/vnd.apple.pages": { source: "iana", extensions: ["pages"] }, "application/vnd.apple.pkpass": { compressible: false, extensions: ["pkpass"] }, "application/vnd.arastra.swi": { source: "iana" }, "application/vnd.aristanetworks.swi": { source: "iana", extensions: ["swi"] }, "application/vnd.artisan+json": { source: "iana", compressible: true }, "application/vnd.artsquare": { source: "iana" }, "application/vnd.astraea-software.iota": { source: "iana", extensions: ["iota"] }, "application/vnd.audiograph": { source: "iana", extensions: ["aep"] }, "application/vnd.autopackage": { source: "iana" }, "application/vnd.avalon+json": { source: "iana", compressible: true }, "application/vnd.avistar+xml": { source: "iana", compressible: true }, "application/vnd.balsamiq.bmml+xml": { source: "iana", compressible: true, extensions: ["bmml"] }, "application/vnd.balsamiq.bmpr": { source: "iana" }, "application/vnd.banana-accounting": { source: "iana" }, "application/vnd.bbf.usp.error": { source: "iana" }, "application/vnd.bbf.usp.msg": { source: "iana" }, "application/vnd.bbf.usp.msg+json": { source: "iana", compressible: true }, "application/vnd.bekitzur-stech+json": { source: "iana", compressible: true }, "application/vnd.bint.med-content": { source: "iana" }, "application/vnd.biopax.rdf+xml": { source: "iana", compressible: true }, "application/vnd.blink-idb-value-wrapper": { source: "iana" }, "application/vnd.blueice.multipass": { source: "iana", extensions: ["mpm"] }, "application/vnd.bluetooth.ep.oob": { source: "iana" }, "application/vnd.bluetooth.le.oob": { source: "iana" }, "application/vnd.bmi": { source: "iana", extensions: ["bmi"] }, "application/vnd.bpf": { source: "iana" }, "application/vnd.bpf3": { source: "iana" }, "application/vnd.businessobjects": { source: "iana", extensions: ["rep"] }, "application/vnd.byu.uapi+json": { source: "iana", compressible: true }, "application/vnd.cab-jscript": { source: "iana" }, "application/vnd.canon-cpdl": { source: "iana" }, "application/vnd.canon-lips": { source: "iana" }, "application/vnd.capasystems-pg+json": { source: "iana", compressible: true }, "application/vnd.cendio.thinlinc.clientconf": { source: "iana" }, "application/vnd.century-systems.tcp_stream": { source: "iana" }, "application/vnd.chemdraw+xml": { source: "iana", compressible: true, extensions: ["cdxml"] }, "application/vnd.chess-pgn": { source: "iana" }, "application/vnd.chipnuts.karaoke-mmd": { source: "iana", extensions: ["mmd"] }, "application/vnd.ciedi": { source: "iana" }, "application/vnd.cinderella": { source: "iana", extensions: ["cdy"] }, "application/vnd.cirpack.isdn-ext": { source: "iana" }, "application/vnd.citationstyles.style+xml": { source: "iana", compressible: true, extensions: ["csl"] }, "application/vnd.claymore": { source: "iana", extensions: ["cla"] }, "application/vnd.cloanto.rp9": { source: "iana", extensions: ["rp9"] }, "application/vnd.clonk.c4group": { source: "iana", extensions: ["c4g", "c4d", "c4f", "c4p", "c4u"] }, "application/vnd.cluetrust.cartomobile-config": { source: "iana", extensions: ["c11amc"] }, "application/vnd.cluetrust.cartomobile-config-pkg": { source: "iana", extensions: ["c11amz"] }, "application/vnd.coffeescript": { source: "iana" }, "application/vnd.collabio.xodocuments.document": { source: "iana" }, "application/vnd.collabio.xodocuments.document-template": { source: "iana" }, "application/vnd.collabio.xodocuments.presentation": { source: "iana" }, "application/vnd.collabio.xodocuments.presentation-template": { source: "iana" }, "application/vnd.collabio.xodocuments.spreadsheet": { source: "iana" }, "application/vnd.collabio.xodocuments.spreadsheet-template": { source: "iana" }, "application/vnd.collection+json": { source: "iana", compressible: true }, "application/vnd.collection.doc+json": { source: "iana", compressible: true }, "application/vnd.collection.next+json": { source: "iana", compressible: true }, "application/vnd.comicbook+zip": { source: "iana", compressible: false }, "application/vnd.comicbook-rar": { source: "iana" }, "application/vnd.commerce-battelle": { source: "iana" }, "application/vnd.commonspace": { source: "iana", extensions: ["csp"] }, "application/vnd.contact.cmsg": { source: "iana", extensions: ["cdbcmsg"] }, "application/vnd.coreos.ignition+json": { source: "iana", compressible: true }, "application/vnd.cosmocaller": { source: "iana", extensions: ["cmc"] }, "application/vnd.crick.clicker": { source: "iana", extensions: ["clkx"] }, "application/vnd.crick.clicker.keyboard": { source: "iana", extensions: ["clkk"] }, "application/vnd.crick.clicker.palette": { source: "iana", extensions: ["clkp"] }, "application/vnd.crick.clicker.template": { source: "iana", extensions: ["clkt"] }, "application/vnd.crick.clicker.wordbank": { source: "iana", extensions: ["clkw"] }, "application/vnd.criticaltools.wbs+xml": { source: "iana", compressible: true, extensions: ["wbs"] }, "application/vnd.cryptii.pipe+json": { source: "iana", compressible: true }, "application/vnd.crypto-shade-file": { source: "iana" }, "application/vnd.cryptomator.encrypted": { source: "iana" }, "application/vnd.cryptomator.vault": { source: "iana" }, "application/vnd.ctc-posml": { source: "iana", extensions: ["pml"] }, "application/vnd.ctct.ws+xml": { source: "iana", compressible: true }, "application/vnd.cups-pdf": { source: "iana" }, "application/vnd.cups-postscript": { source: "iana" }, "application/vnd.cups-ppd": { source: "iana", extensions: ["ppd"] }, "application/vnd.cups-raster": { source: "iana" }, "application/vnd.cups-raw": { source: "iana" }, "application/vnd.curl": { source: "iana" }, "application/vnd.curl.car": { source: "apache", extensions: ["car"] }, "application/vnd.curl.pcurl": { source: "apache", extensions: ["pcurl"] }, "application/vnd.cyan.dean.root+xml": { source: "iana", compressible: true }, "application/vnd.cybank": { source: "iana" }, "application/vnd.cyclonedx+json": { source: "iana", compressible: true }, "application/vnd.cyclonedx+xml": { source: "iana", compressible: true }, "application/vnd.d2l.coursepackage1p0+zip": { source: "iana", compressible: false }, "application/vnd.d3m-dataset": { source: "iana" }, "application/vnd.d3m-problem": { source: "iana" }, "application/vnd.dart": { source: "iana", compressible: true, extensions: ["dart"] }, "application/vnd.data-vision.rdz": { source: "iana", extensions: ["rdz"] }, "application/vnd.datapackage+json": { source: "iana", compressible: true }, "application/vnd.dataresource+json": { source: "iana", compressible: true }, "application/vnd.dbf": { source: "iana", extensions: ["dbf"] }, "application/vnd.debian.binary-package": { source: "iana" }, "application/vnd.dece.data": { source: "iana", extensions: ["uvf", "uvvf", "uvd", "uvvd"] }, "application/vnd.dece.ttml+xml": { source: "iana", compressible: true, extensions: ["uvt", "uvvt"] }, "application/vnd.dece.unspecified": { source: "iana", extensions: ["uvx", "uvvx"] }, "application/vnd.dece.zip": { source: "iana", extensions: ["uvz", "uvvz"] }, "application/vnd.denovo.fcselayout-link": { source: "iana", extensions: ["fe_launch"] }, "application/vnd.desmume.movie": { source: "iana" }, "application/vnd.dir-bi.plate-dl-nosuffix": { source: "iana" }, "application/vnd.dm.delegation+xml": { source: "iana", compressible: true }, "application/vnd.dna": { source: "iana", extensions: ["dna"] }, "application/vnd.document+json": { source: "iana", compressible: true }, "application/vnd.dolby.mlp": { source: "apache", extensions: ["mlp"] }, "application/vnd.dolby.mobile.1": { source: "iana" }, "application/vnd.dolby.mobile.2": { source: "iana" }, "application/vnd.doremir.scorecloud-binary-document": { source: "iana" }, "application/vnd.dpgraph": { source: "iana", extensions: ["dpg"] }, "application/vnd.dreamfactory": { source: "iana", extensions: ["dfac"] }, "application/vnd.drive+json": { source: "iana", compressible: true }, "application/vnd.ds-keypoint": { source: "apache", extensions: ["kpxx"] }, "application/vnd.dtg.local": { source: "iana" }, "application/vnd.dtg.local.flash": { source: "iana" }, "application/vnd.dtg.local.html": { source: "iana" }, "application/vnd.dvb.ait": { source: "iana", extensions: ["ait"] }, "application/vnd.dvb.dvbisl+xml": { source: "iana", compressible: true }, "application/vnd.dvb.dvbj": { source: "iana" }, "application/vnd.dvb.esgcontainer": { source: "iana" }, "application/vnd.dvb.ipdcdftnotifaccess": { source: "iana" }, "application/vnd.dvb.ipdcesgaccess": { source: "iana" }, "application/vnd.dvb.ipdcesgaccess2": { source: "iana" }, "application/vnd.dvb.ipdcesgpdd": { source: "iana" }, "application/vnd.dvb.ipdcroaming": { source: "iana" }, "application/vnd.dvb.iptv.alfec-base": { source: "iana" }, "application/vnd.dvb.iptv.alfec-enhancement": { source: "iana" }, "application/vnd.dvb.notif-aggregate-root+xml": { source: "iana", compressible: true }, "application/vnd.dvb.notif-container+xml": { source: "iana", compressible: true }, "application/vnd.dvb.notif-generic+xml": { source: "iana", compressible: true }, "application/vnd.dvb.notif-ia-msglist+xml": { source: "iana", compressible: true }, "application/vnd.dvb.notif-ia-registration-request+xml": { source: "iana", compressible: true }, "application/vnd.dvb.notif-ia-registration-response+xml": { source: "iana", compressible: true }, "application/vnd.dvb.notif-init+xml": { source: "iana", compressible: true }, "application/vnd.dvb.pfr": { source: "iana" }, "application/vnd.dvb.service": { source: "iana", extensions: ["svc"] }, "application/vnd.dxr": { source: "iana" }, "application/vnd.dynageo": { source: "iana", extensions: ["geo"] }, "application/vnd.dzr": { source: "iana" }, "application/vnd.easykaraoke.cdgdownload": { source: "iana" }, "application/vnd.ecdis-update": { source: "iana" }, "application/vnd.ecip.rlp": { source: "iana" }, "application/vnd.eclipse.ditto+json": { source: "iana", compressible: true }, "application/vnd.ecowin.chart": { source: "iana", extensions: ["mag"] }, "application/vnd.ecowin.filerequest": { source: "iana" }, "application/vnd.ecowin.fileupdate": { source: "iana" }, "application/vnd.ecowin.series": { source: "iana" }, "application/vnd.ecowin.seriesrequest": { source: "iana" }, "application/vnd.ecowin.seriesupdate": { source: "iana" }, "application/vnd.efi.img": { source: "iana" }, "application/vnd.efi.iso": { source: "iana" }, "application/vnd.emclient.accessrequest+xml": { source: "iana", compressible: true }, "application/vnd.enliven": { source: "iana", extensions: ["nml"] }, "application/vnd.enphase.envoy": { source: "iana" }, "application/vnd.eprints.data+xml": { source: "iana", compressible: true }, "application/vnd.epson.esf": { source: "iana", extensions: ["esf"] }, "application/vnd.epson.msf": { source: "iana", extensions: ["msf"] }, "application/vnd.epson.quickanime": { source: "iana", extensions: ["qam"] }, "application/vnd.epson.salt": { source: "iana", extensions: ["slt"] }, "application/vnd.epson.ssf": { source: "iana", extensions: ["ssf"] }, "application/vnd.ericsson.quickcall": { source: "iana" }, "application/vnd.espass-espass+zip": { source: "iana", compressible: false }, "application/vnd.eszigno3+xml": { source: "iana", compressible: true, extensions: ["es3", "et3"] }, "application/vnd.etsi.aoc+xml": { source: "iana", compressible: true }, "application/vnd.etsi.asic-e+zip": { source: "iana", compressible: false }, "application/vnd.etsi.asic-s+zip": { source: "iana", compressible: false }, "application/vnd.etsi.cug+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvcommand+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvdiscovery+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvprofile+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvsad-bc+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvsad-cod+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvsad-npvr+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvservice+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvsync+xml": { source: "iana", compressible: true }, "application/vnd.etsi.iptvueprofile+xml": { source: "iana", compressible: true }, "application/vnd.etsi.mcid+xml": { source: "iana", compressible: true }, "application/vnd.etsi.mheg5": { source: "iana" }, "application/vnd.etsi.overload-control-policy-dataset+xml": { source: "iana", compressible: true }, "application/vnd.etsi.pstn+xml": { source: "iana", compressible: true }, "application/vnd.etsi.sci+xml": { source: "iana", compressible: true }, "application/vnd.etsi.simservs+xml": { source: "iana", compressible: true }, "application/vnd.etsi.timestamp-token": { source: "iana" }, "application/vnd.etsi.tsl+xml": { source: "iana", compressible: true }, "application/vnd.etsi.tsl.der": { source: "iana" }, "application/vnd.eu.kasparian.car+json": { source: "iana", compressible: true }, "application/vnd.eudora.data": { source: "iana" }, "application/vnd.evolv.ecig.profile": { source: "iana" }, "application/vnd.evolv.ecig.settings": { source: "iana" }, "application/vnd.evolv.ecig.theme": { source: "iana" }, "application/vnd.exstream-empower+zip": { source: "iana", compressible: false }, "application/vnd.exstream-package": { source: "iana" }, "application/vnd.ezpix-album": { source: "iana", extensions: ["ez2"] }, "application/vnd.ezpix-package": { source: "iana", extensions: ["ez3"] }, "application/vnd.f-secure.mobile": { source: "iana" }, "application/vnd.familysearch.gedcom+zip": { source: "iana", compressible: false }, "application/vnd.fastcopy-disk-image": { source: "iana" }, "application/vnd.fdf": { source: "iana", extensions: ["fdf"] }, "application/vnd.fdsn.mseed": { source: "iana", extensions: ["mseed"] }, "application/vnd.fdsn.seed": { source: "iana", extensions: ["seed", "dataless"] }, "application/vnd.ffsns": { source: "iana" }, "application/vnd.ficlab.flb+zip": { source: "iana", compressible: false }, "application/vnd.filmit.zfc": { source: "iana" }, "application/vnd.fints": { source: "iana" }, "application/vnd.firemonkeys.cloudcell": { source: "iana" }, "application/vnd.flographit": { source: "iana", extensions: ["gph"] }, "application/vnd.fluxtime.clip": { source: "iana", extensions: ["ftc"] }, "application/vnd.font-fontforge-sfd": { source: "iana" }, "application/vnd.framemaker": { source: "iana", extensions: ["fm", "frame", "maker", "book"] }, "application/vnd.frogans.fnc": { source: "iana", extensions: ["fnc"] }, "application/vnd.frogans.ltf": { source: "iana", extensions: ["ltf"] }, "application/vnd.fsc.weblaunch": { source: "iana", extensions: ["fsc"] }, "application/vnd.fujifilm.fb.docuworks": { source: "iana" }, "application/vnd.fujifilm.fb.docuworks.binder": { source: "iana" }, "application/vnd.fujifilm.fb.docuworks.container": { source: "iana" }, "application/vnd.fujifilm.fb.jfi+xml": { source: "iana", compressible: true }, "application/vnd.fujitsu.oasys": { source: "iana", extensions: ["oas"] }, "application/vnd.fujitsu.oasys2": { source: "iana", extensions: ["oa2"] }, "application/vnd.fujitsu.oasys3": { source: "iana", extensions: ["oa3"] }, "application/vnd.fujitsu.oasysgp": { source: "iana", extensions: ["fg5"] }, "application/vnd.fujitsu.oasysprs": { source: "iana", extensions: ["bh2"] }, "application/vnd.fujixerox.art-ex": { source: "iana" }, "application/vnd.fujixerox.art4": { source: "iana" }, "application/vnd.fujixerox.ddd": { source: "iana", extensions: ["ddd"] }, "application/vnd.fujixerox.docuworks": { source: "iana", extensions: ["xdw"] }, "application/vnd.fujixerox.docuworks.binder": { source: "iana", extensions: ["xbd"] }, "application/vnd.fujixerox.docuworks.container": { source: "iana" }, "application/vnd.fujixerox.hbpl": { source: "iana" }, "application/vnd.fut-misnet": { source: "iana" }, "application/vnd.futoin+cbor": { source: "iana" }, "application/vnd.futoin+json": { source: "iana", compressible: true }, "application/vnd.fuzzysheet": { source: "iana", extensions: ["fzs"] }, "application/vnd.genomatix.tuxedo": { source: "iana", extensions: ["txd"] }, "application/vnd.gentics.grd+json": { source: "iana", compressible: true }, "application/vnd.geo+json": { source: "iana", compressible: true }, "application/vnd.geocube+xml": { source: "iana", compressible: true }, "application/vnd.geogebra.file": { source: "iana", extensions: ["ggb"] }, "application/vnd.geogebra.slides": { source: "iana" }, "application/vnd.geogebra.tool": { source: "iana", extensions: ["ggt"] }, "application/vnd.geometry-explorer": { source: "iana", extensions: ["gex", "gre"] }, "application/vnd.geonext": { source: "iana", extensions: ["gxt"] }, "application/vnd.geoplan": { source: "iana", extensions: ["g2w"] }, "application/vnd.geospace": { source: "iana", extensions: ["g3w"] }, "application/vnd.gerber": { source: "iana" }, "application/vnd.globalplatform.card-content-mgt": { source: "iana" }, "application/vnd.globalplatform.card-content-mgt-response": { source: "iana" }, "application/vnd.gmx": { source: "iana", extensions: ["gmx"] }, "application/vnd.google-apps.document": { compressible: false, extensions: ["gdoc"] }, "application/vnd.google-apps.presentation": { compressible: false, extensions: ["gslides"] }, "application/vnd.google-apps.spreadsheet": { compressible: false, extensions: ["gsheet"] }, "application/vnd.google-earth.kml+xml": { source: "iana", compressible: true, extensions: ["kml"] }, "application/vnd.google-earth.kmz": { source: "iana", compressible: false, extensions: ["kmz"] }, "application/vnd.gov.sk.e-form+xml": { source: "iana", compressible: true }, "application/vnd.gov.sk.e-form+zip": { source: "iana", compressible: false }, "application/vnd.gov.sk.xmldatacontainer+xml": { source: "iana", compressible: true }, "application/vnd.grafeq": { source: "iana", extensions: ["gqf", "gqs"] }, "application/vnd.gridmp": { source: "iana" }, "application/vnd.groove-account": { source: "iana", extensions: ["gac"] }, "application/vnd.groove-help": { source: "iana", extensions: ["ghf"] }, "application/vnd.groove-identity-message": { source: "iana", extensions: ["gim"] }, "application/vnd.groove-injector": { source: "iana", extensions: ["grv"] }, "application/vnd.groove-tool-message": { source: "iana", extensions: ["gtm"] }, "application/vnd.groove-tool-template": { source: "iana", extensions: ["tpl"] }, "application/vnd.groove-vcard": { source: "iana", extensions: ["vcg"] }, "application/vnd.hal+json": { source: "iana", compressible: true }, "application/vnd.hal+xml": { source: "iana", compressible: true, extensions: ["hal"] }, "application/vnd.handheld-entertainment+xml": { source: "iana", compressible: true, extensions: ["zmm"] }, "application/vnd.hbci": { source: "iana", extensions: ["hbci"] }, "application/vnd.hc+json": { source: "iana", compressible: true }, "application/vnd.hcl-bireports": { source: "iana" }, "application/vnd.hdt": { source: "iana" }, "application/vnd.heroku+json": { source: "iana", compressible: true }, "application/vnd.hhe.lesson-player": { source: "iana", extensions: ["les"] }, "application/vnd.hl7cda+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/vnd.hl7v2+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/vnd.hp-hpgl": { source: "iana", extensions: ["hpgl"] }, "application/vnd.hp-hpid": { source: "iana", extensions: ["hpid"] }, "application/vnd.hp-hps": { source: "iana", extensions: ["hps"] }, "application/vnd.hp-jlyt": { source: "iana", extensions: ["jlt"] }, "application/vnd.hp-pcl": { source: "iana", extensions: ["pcl"] }, "application/vnd.hp-pclxl": { source: "iana", extensions: ["pclxl"] }, "application/vnd.httphone": { source: "iana" }, "application/vnd.hydrostatix.sof-data": { source: "iana", extensions: ["sfd-hdstx"] }, "application/vnd.hyper+json": { source: "iana", compressible: true }, "application/vnd.hyper-item+json": { source: "iana", compressible: true }, "application/vnd.hyperdrive+json": { source: "iana", compressible: true }, "application/vnd.hzn-3d-crossword": { source: "iana" }, "application/vnd.ibm.afplinedata": { source: "iana" }, "application/vnd.ibm.electronic-media": { source: "iana" }, "application/vnd.ibm.minipay": { source: "iana", extensions: ["mpy"] }, "application/vnd.ibm.modcap": { source: "iana", extensions: ["afp", "listafp", "list3820"] }, "application/vnd.ibm.rights-management": { source: "iana", extensions: ["irm"] }, "application/vnd.ibm.secure-container": { source: "iana", extensions: ["sc"] }, "application/vnd.iccprofile": { source: "iana", extensions: ["icc", "icm"] }, "application/vnd.ieee.1905": { source: "iana" }, "application/vnd.igloader": { source: "iana", extensions: ["igl"] }, "application/vnd.imagemeter.folder+zip": { source: "iana", compressible: false }, "application/vnd.imagemeter.image+zip": { source: "iana", compressible: false }, "application/vnd.immervision-ivp": { source: "iana", extensions: ["ivp"] }, "application/vnd.immervision-ivu": { source: "iana", extensions: ["ivu"] }, "application/vnd.ims.imsccv1p1": { source: "iana" }, "application/vnd.ims.imsccv1p2": { source: "iana" }, "application/vnd.ims.imsccv1p3": { source: "iana" }, "application/vnd.ims.lis.v2.result+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolconsumerprofile+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolproxy+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolproxy.id+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolsettings+json": { source: "iana", compressible: true }, "application/vnd.ims.lti.v2.toolsettings.simple+json": { source: "iana", compressible: true }, "application/vnd.informedcontrol.rms+xml": { source: "iana", compressible: true }, "application/vnd.informix-visionary": { source: "iana" }, "application/vnd.infotech.project": { source: "iana" }, "application/vnd.infotech.project+xml": { source: "iana", compressible: true }, "application/vnd.innopath.wamp.notification": { source: "iana" }, "application/vnd.insors.igm": { source: "iana", extensions: ["igm"] }, "application/vnd.intercon.formnet": { source: "iana", extensions: ["xpw", "xpx"] }, "application/vnd.intergeo": { source: "iana", extensions: ["i2g"] }, "application/vnd.intertrust.digibox": { source: "iana" }, "application/vnd.intertrust.nncp": { source: "iana" }, "application/vnd.intu.qbo": { source: "iana", extensions: ["qbo"] }, "application/vnd.intu.qfx": { source: "iana", extensions: ["qfx"] }, "application/vnd.iptc.g2.catalogitem+xml": { source: "iana", compressible: true }, "application/vnd.iptc.g2.conceptitem+xml": { source: "iana", compressible: true }, "application/vnd.iptc.g2.knowledgeitem+xml": { source: "iana", compressible: true }, "application/vnd.iptc.g2.newsitem+xml": { source: "iana", compressible: true }, "application/vnd.iptc.g2.newsmessage+xml": { source: "iana", compressible: true }, "application/vnd.iptc.g2.packageitem+xml": { source: "iana", compressible: true }, "application/vnd.iptc.g2.planningitem+xml": { source: "iana", compressible: true }, "application/vnd.ipunplugged.rcprofile": { source: "iana", extensions: ["rcprofile"] }, "application/vnd.irepository.package+xml": { source: "iana", compressible: true, extensions: ["irp"] }, "application/vnd.is-xpr": { source: "iana", extensions: ["xpr"] }, "application/vnd.isac.fcs": { source: "iana", extensions: ["fcs"] }, "application/vnd.iso11783-10+zip": { source: "iana", compressible: false }, "application/vnd.jam": { source: "iana", extensions: ["jam"] }, "application/vnd.japannet-directory-service": { source: "iana" }, "application/vnd.japannet-jpnstore-wakeup": { source: "iana" }, "application/vnd.japannet-payment-wakeup": { source: "iana" }, "application/vnd.japannet-registration": { source: "iana" }, "application/vnd.japannet-registration-wakeup": { source: "iana" }, "application/vnd.japannet-setstore-wakeup": { source: "iana" }, "application/vnd.japannet-verification": { source: "iana" }, "application/vnd.japannet-verification-wakeup": { source: "iana" }, "application/vnd.jcp.javame.midlet-rms": { source: "iana", extensions: ["rms"] }, "application/vnd.jisp": { source: "iana", extensions: ["jisp"] }, "application/vnd.joost.joda-archive": { source: "iana", extensions: ["joda"] }, "application/vnd.jsk.isdn-ngn": { source: "iana" }, "application/vnd.kahootz": { source: "iana", extensions: ["ktz", "ktr"] }, "application/vnd.kde.karbon": { source: "iana", extensions: ["karbon"] }, "application/vnd.kde.kchart": { source: "iana", extensions: ["chrt"] }, "application/vnd.kde.kformula": { source: "iana", extensions: ["kfo"] }, "application/vnd.kde.kivio": { source: "iana", extensions: ["flw"] }, "application/vnd.kde.kontour": { source: "iana", extensions: ["kon"] }, "application/vnd.kde.kpresenter": { source: "iana", extensions: ["kpr", "kpt"] }, "application/vnd.kde.kspread": { source: "iana", extensions: ["ksp"] }, "application/vnd.kde.kword": { source: "iana", extensions: ["kwd", "kwt"] }, "application/vnd.kenameaapp": { source: "iana", extensions: ["htke"] }, "application/vnd.kidspiration": { source: "iana", extensions: ["kia"] }, "application/vnd.kinar": { source: "iana", extensions: ["kne", "knp"] }, "application/vnd.koan": { source: "iana", extensions: ["skp", "skd", "skt", "skm"] }, "application/vnd.kodak-descriptor": { source: "iana", extensions: ["sse"] }, "application/vnd.las": { source: "iana" }, "application/vnd.las.las+json": { source: "iana", compressible: true }, "application/vnd.las.las+xml": { source: "iana", compressible: true, extensions: ["lasxml"] }, "application/vnd.laszip": { source: "iana" }, "application/vnd.leap+json": { source: "iana", compressible: true }, "application/vnd.liberty-request+xml": { source: "iana", compressible: true }, "application/vnd.llamagraphics.life-balance.desktop": { source: "iana", extensions: ["lbd"] }, "application/vnd.llamagraphics.life-balance.exchange+xml": { source: "iana", compressible: true, extensions: ["lbe"] }, "application/vnd.logipipe.circuit+zip": { source: "iana", compressible: false }, "application/vnd.loom": { source: "iana" }, "application/vnd.lotus-1-2-3": { source: "iana", extensions: ["123"] }, "application/vnd.lotus-approach": { source: "iana", extensions: ["apr"] }, "application/vnd.lotus-freelance": { source: "iana", extensions: ["pre"] }, "application/vnd.lotus-notes": { source: "iana", extensions: ["nsf"] }, "application/vnd.lotus-organizer": { source: "iana", extensions: ["org"] }, "application/vnd.lotus-screencam": { source: "iana", extensions: ["scm"] }, "application/vnd.lotus-wordpro": { source: "iana", extensions: ["lwp"] }, "application/vnd.macports.portpkg": { source: "iana", extensions: ["portpkg"] }, "application/vnd.mapbox-vector-tile": { source: "iana", extensions: ["mvt"] }, "application/vnd.marlin.drm.actiontoken+xml": { source: "iana", compressible: true }, "application/vnd.marlin.drm.conftoken+xml": { source: "iana", compressible: true }, "application/vnd.marlin.drm.license+xml": { source: "iana", compressible: true }, "application/vnd.marlin.drm.mdcf": { source: "iana" }, "application/vnd.mason+json": { source: "iana", compressible: true }, "application/vnd.maxar.archive.3tz+zip": { source: "iana", compressible: false }, "application/vnd.maxmind.maxmind-db": { source: "iana" }, "application/vnd.mcd": { source: "iana", extensions: ["mcd"] }, "application/vnd.medcalcdata": { source: "iana", extensions: ["mc1"] }, "application/vnd.mediastation.cdkey": { source: "iana", extensions: ["cdkey"] }, "application/vnd.meridian-slingshot": { source: "iana" }, "application/vnd.mfer": { source: "iana", extensions: ["mwf"] }, "application/vnd.mfmp": { source: "iana", extensions: ["mfm"] }, "application/vnd.micro+json": { source: "iana", compressible: true }, "application/vnd.micrografx.flo": { source: "iana", extensions: ["flo"] }, "application/vnd.micrografx.igx": { source: "iana", extensions: ["igx"] }, "application/vnd.microsoft.portable-executable": { source: "iana" }, "application/vnd.microsoft.windows.thumbnail-cache": { source: "iana" }, "application/vnd.miele+json": { source: "iana", compressible: true }, "application/vnd.mif": { source: "iana", extensions: ["mif"] }, "application/vnd.minisoft-hp3000-save": { source: "iana" }, "application/vnd.mitsubishi.misty-guard.trustweb": { source: "iana" }, "application/vnd.mobius.daf": { source: "iana", extensions: ["daf"] }, "application/vnd.mobius.dis": { source: "iana", extensions: ["dis"] }, "application/vnd.mobius.mbk": { source: "iana", extensions: ["mbk"] }, "application/vnd.mobius.mqy": { source: "iana", extensions: ["mqy"] }, "application/vnd.mobius.msl": { source: "iana", extensions: ["msl"] }, "application/vnd.mobius.plc": { source: "iana", extensions: ["plc"] }, "application/vnd.mobius.txf": { source: "iana", extensions: ["txf"] }, "application/vnd.mophun.application": { source: "iana", extensions: ["mpn"] }, "application/vnd.mophun.certificate": { source: "iana", extensions: ["mpc"] }, "application/vnd.motorola.flexsuite": { source: "iana" }, "application/vnd.motorola.flexsuite.adsi": { source: "iana" }, "application/vnd.motorola.flexsuite.fis": { source: "iana" }, "application/vnd.motorola.flexsuite.gotap": { source: "iana" }, "application/vnd.motorola.flexsuite.kmr": { source: "iana" }, "application/vnd.motorola.flexsuite.ttc": { source: "iana" }, "application/vnd.motorola.flexsuite.wem": { source: "iana" }, "application/vnd.motorola.iprm": { source: "iana" }, "application/vnd.mozilla.xul+xml": { source: "iana", compressible: true, extensions: ["xul"] }, "application/vnd.ms-3mfdocument": { source: "iana" }, "application/vnd.ms-artgalry": { source: "iana", extensions: ["cil"] }, "application/vnd.ms-asf": { source: "iana" }, "application/vnd.ms-cab-compressed": { source: "iana", extensions: ["cab"] }, "application/vnd.ms-color.iccprofile": { source: "apache" }, "application/vnd.ms-excel": { source: "iana", compressible: false, extensions: ["xls", "xlm", "xla", "xlc", "xlt", "xlw"] }, "application/vnd.ms-excel.addin.macroenabled.12": { source: "iana", extensions: ["xlam"] }, "application/vnd.ms-excel.sheet.binary.macroenabled.12": { source: "iana", extensions: ["xlsb"] }, "application/vnd.ms-excel.sheet.macroenabled.12": { source: "iana", extensions: ["xlsm"] }, "application/vnd.ms-excel.template.macroenabled.12": { source: "iana", extensions: ["xltm"] }, "application/vnd.ms-fontobject": { source: "iana", compressible: true, extensions: ["eot"] }, "application/vnd.ms-htmlhelp": { source: "iana", extensions: ["chm"] }, "application/vnd.ms-ims": { source: "iana", extensions: ["ims"] }, "application/vnd.ms-lrm": { source: "iana", extensions: ["lrm"] }, "application/vnd.ms-office.activex+xml": { source: "iana", compressible: true }, "application/vnd.ms-officetheme": { source: "iana", extensions: ["thmx"] }, "application/vnd.ms-opentype": { source: "apache", compressible: true }, "application/vnd.ms-outlook": { compressible: false, extensions: ["msg"] }, "application/vnd.ms-package.obfuscated-opentype": { source: "apache" }, "application/vnd.ms-pki.seccat": { source: "apache", extensions: ["cat"] }, "application/vnd.ms-pki.stl": { source: "apache", extensions: ["stl"] }, "application/vnd.ms-playready.initiator+xml": { source: "iana", compressible: true }, "application/vnd.ms-powerpoint": { source: "iana", compressible: false, extensions: ["ppt", "pps", "pot"] }, "application/vnd.ms-powerpoint.addin.macroenabled.12": { source: "iana", extensions: ["ppam"] }, "application/vnd.ms-powerpoint.presentation.macroenabled.12": { source: "iana", extensions: ["pptm"] }, "application/vnd.ms-powerpoint.slide.macroenabled.12": { source: "iana", extensions: ["sldm"] }, "application/vnd.ms-powerpoint.slideshow.macroenabled.12": { source: "iana", extensions: ["ppsm"] }, "application/vnd.ms-powerpoint.template.macroenabled.12": { source: "iana", extensions: ["potm"] }, "application/vnd.ms-printdevicecapabilities+xml": { source: "iana", compressible: true }, "application/vnd.ms-printing.printticket+xml": { source: "apache", compressible: true }, "application/vnd.ms-printschematicket+xml": { source: "iana", compressible: true }, "application/vnd.ms-project": { source: "iana", extensions: ["mpp", "mpt"] }, "application/vnd.ms-tnef": { source: "iana" }, "application/vnd.ms-windows.devicepairing": { source: "iana" }, "application/vnd.ms-windows.nwprinting.oob": { source: "iana" }, "application/vnd.ms-windows.printerpairing": { source: "iana" }, "application/vnd.ms-windows.wsd.oob": { source: "iana" }, "application/vnd.ms-wmdrm.lic-chlg-req": { source: "iana" }, "application/vnd.ms-wmdrm.lic-resp": { source: "iana" }, "application/vnd.ms-wmdrm.meter-chlg-req": { source: "iana" }, "application/vnd.ms-wmdrm.meter-resp": { source: "iana" }, "application/vnd.ms-word.document.macroenabled.12": { source: "iana", extensions: ["docm"] }, "application/vnd.ms-word.template.macroenabled.12": { source: "iana", extensions: ["dotm"] }, "application/vnd.ms-works": { source: "iana", extensions: ["wps", "wks", "wcm", "wdb"] }, "application/vnd.ms-wpl": { source: "iana", extensions: ["wpl"] }, "application/vnd.ms-xpsdocument": { source: "iana", compressible: false, extensions: ["xps"] }, "application/vnd.msa-disk-image": { source: "iana" }, "application/vnd.mseq": { source: "iana", extensions: ["mseq"] }, "application/vnd.msign": { source: "iana" }, "application/vnd.multiad.creator": { source: "iana" }, "application/vnd.multiad.creator.cif": { source: "iana" }, "application/vnd.music-niff": { source: "iana" }, "application/vnd.musician": { source: "iana", extensions: ["mus"] }, "application/vnd.muvee.style": { source: "iana", extensions: ["msty"] }, "application/vnd.mynfc": { source: "iana", extensions: ["taglet"] }, "application/vnd.nacamar.ybrid+json": { source: "iana", compressible: true }, "application/vnd.ncd.control": { source: "iana" }, "application/vnd.ncd.reference": { source: "iana" }, "application/vnd.nearst.inv+json": { source: "iana", compressible: true }, "application/vnd.nebumind.line": { source: "iana" }, "application/vnd.nervana": { source: "iana" }, "application/vnd.netfpx": { source: "iana" }, "application/vnd.neurolanguage.nlu": { source: "iana", extensions: ["nlu"] }, "application/vnd.nimn": { source: "iana" }, "application/vnd.nintendo.nitro.rom": { source: "iana" }, "application/vnd.nintendo.snes.rom": { source: "iana" }, "application/vnd.nitf": { source: "iana", extensions: ["ntf", "nitf"] }, "application/vnd.noblenet-directory": { source: "iana", extensions: ["nnd"] }, "application/vnd.noblenet-sealer": { source: "iana", extensions: ["nns"] }, "application/vnd.noblenet-web": { source: "iana", extensions: ["nnw"] }, "application/vnd.nokia.catalogs": { source: "iana" }, "application/vnd.nokia.conml+wbxml": { source: "iana" }, "application/vnd.nokia.conml+xml": { source: "iana", compressible: true }, "application/vnd.nokia.iptv.config+xml": { source: "iana", compressible: true }, "application/vnd.nokia.isds-radio-presets": { source: "iana" }, "application/vnd.nokia.landmark+wbxml": { source: "iana" }, "application/vnd.nokia.landmark+xml": { source: "iana", compressible: true }, "application/vnd.nokia.landmarkcollection+xml": { source: "iana", compressible: true }, "application/vnd.nokia.n-gage.ac+xml": { source: "iana", compressible: true, extensions: ["ac"] }, "application/vnd.nokia.n-gage.data": { source: "iana", extensions: ["ngdat"] }, "application/vnd.nokia.n-gage.symbian.install": { source: "iana", extensions: ["n-gage"] }, "application/vnd.nokia.ncd": { source: "iana" }, "application/vnd.nokia.pcd+wbxml": { source: "iana" }, "application/vnd.nokia.pcd+xml": { source: "iana", compressible: true }, "application/vnd.nokia.radio-preset": { source: "iana", extensions: ["rpst"] }, "application/vnd.nokia.radio-presets": { source: "iana", extensions: ["rpss"] }, "application/vnd.novadigm.edm": { source: "iana", extensions: ["edm"] }, "application/vnd.novadigm.edx": { source: "iana", extensions: ["edx"] }, "application/vnd.novadigm.ext": { source: "iana", extensions: ["ext"] }, "application/vnd.ntt-local.content-share": { source: "iana" }, "application/vnd.ntt-local.file-transfer": { source: "iana" }, "application/vnd.ntt-local.ogw_remote-access": { source: "iana" }, "application/vnd.ntt-local.sip-ta_remote": { source: "iana" }, "application/vnd.ntt-local.sip-ta_tcp_stream": { source: "iana" }, "application/vnd.oasis.opendocument.chart": { source: "iana", extensions: ["odc"] }, "application/vnd.oasis.opendocument.chart-template": { source: "iana", extensions: ["otc"] }, "application/vnd.oasis.opendocument.database": { source: "iana", extensions: ["odb"] }, "application/vnd.oasis.opendocument.formula": { source: "iana", extensions: ["odf"] }, "application/vnd.oasis.opendocument.formula-template": { source: "iana", extensions: ["odft"] }, "application/vnd.oasis.opendocument.graphics": { source: "iana", compressible: false, extensions: ["odg"] }, "application/vnd.oasis.opendocument.graphics-template": { source: "iana", extensions: ["otg"] }, "application/vnd.oasis.opendocument.image": { source: "iana", extensions: ["odi"] }, "application/vnd.oasis.opendocument.image-template": { source: "iana", extensions: ["oti"] }, "application/vnd.oasis.opendocument.presentation": { source: "iana", compressible: false, extensions: ["odp"] }, "application/vnd.oasis.opendocument.presentation-template": { source: "iana", extensions: ["otp"] }, "application/vnd.oasis.opendocument.spreadsheet": { source: "iana", compressible: false, extensions: ["ods"] }, "application/vnd.oasis.opendocument.spreadsheet-template": { source: "iana", extensions: ["ots"] }, "application/vnd.oasis.opendocument.text": { source: "iana", compressible: false, extensions: ["odt"] }, "application/vnd.oasis.opendocument.text-master": { source: "iana", extensions: ["odm"] }, "application/vnd.oasis.opendocument.text-template": { source: "iana", extensions: ["ott"] }, "application/vnd.oasis.opendocument.text-web": { source: "iana", extensions: ["oth"] }, "application/vnd.obn": { source: "iana" }, "application/vnd.ocf+cbor": { source: "iana" }, "application/vnd.oci.image.manifest.v1+json": { source: "iana", compressible: true }, "application/vnd.oftn.l10n+json": { source: "iana", compressible: true }, "application/vnd.oipf.contentaccessdownload+xml": { source: "iana", compressible: true }, "application/vnd.oipf.contentaccessstreaming+xml": { source: "iana", compressible: true }, "application/vnd.oipf.cspg-hexbinary": { source: "iana" }, "application/vnd.oipf.dae.svg+xml": { source: "iana", compressible: true }, "application/vnd.oipf.dae.xhtml+xml": { source: "iana", compressible: true }, "application/vnd.oipf.mippvcontrolmessage+xml": { source: "iana", compressible: true }, "application/vnd.oipf.pae.gem": { source: "iana" }, "application/vnd.oipf.spdiscovery+xml": { source: "iana", compressible: true }, "application/vnd.oipf.spdlist+xml": { source: "iana", compressible: true }, "application/vnd.oipf.ueprofile+xml": { source: "iana", compressible: true }, "application/vnd.oipf.userprofile+xml": { source: "iana", compressible: true }, "application/vnd.olpc-sugar": { source: "iana", extensions: ["xo"] }, "application/vnd.oma-scws-config": { source: "iana" }, "application/vnd.oma-scws-http-request": { source: "iana" }, "application/vnd.oma-scws-http-response": { source: "iana" }, "application/vnd.oma.bcast.associated-procedure-parameter+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.drm-trigger+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.imd+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.ltkm": { source: "iana" }, "application/vnd.oma.bcast.notification+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.provisioningtrigger": { source: "iana" }, "application/vnd.oma.bcast.sgboot": { source: "iana" }, "application/vnd.oma.bcast.sgdd+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.sgdu": { source: "iana" }, "application/vnd.oma.bcast.simple-symbol-container": { source: "iana" }, "application/vnd.oma.bcast.smartcard-trigger+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.sprov+xml": { source: "iana", compressible: true }, "application/vnd.oma.bcast.stkm": { source: "iana" }, "application/vnd.oma.cab-address-book+xml": { source: "iana", compressible: true }, "application/vnd.oma.cab-feature-handler+xml": { source: "iana", compressible: true }, "application/vnd.oma.cab-pcc+xml": { source: "iana", compressible: true }, "application/vnd.oma.cab-subs-invite+xml": { source: "iana", compressible: true }, "application/vnd.oma.cab-user-prefs+xml": { source: "iana", compressible: true }, "application/vnd.oma.dcd": { source: "iana" }, "application/vnd.oma.dcdc": { source: "iana" }, "application/vnd.oma.dd2+xml": { source: "iana", compressible: true, extensions: ["dd2"] }, "application/vnd.oma.drm.risd+xml": { source: "iana", compressible: true }, "application/vnd.oma.group-usage-list+xml": { source: "iana", compressible: true }, "application/vnd.oma.lwm2m+cbor": { source: "iana" }, "application/vnd.oma.lwm2m+json": { source: "iana", compressible: true }, "application/vnd.oma.lwm2m+tlv": { source: "iana" }, "application/vnd.oma.pal+xml": { source: "iana", compressible: true }, "application/vnd.oma.poc.detailed-progress-report+xml": { source: "iana", compressible: true }, "application/vnd.oma.poc.final-report+xml": { source: "iana", compressible: true }, "application/vnd.oma.poc.groups+xml": { source: "iana", compressible: true }, "application/vnd.oma.poc.invocation-descriptor+xml": { source: "iana", compressible: true }, "application/vnd.oma.poc.optimized-progress-report+xml": { source: "iana", compressible: true }, "application/vnd.oma.push": { source: "iana" }, "application/vnd.oma.scidm.messages+xml": { source: "iana", compressible: true }, "application/vnd.oma.xcap-directory+xml": { source: "iana", compressible: true }, "application/vnd.omads-email+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/vnd.omads-file+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/vnd.omads-folder+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/vnd.omaloc-supl-init": { source: "iana" }, "application/vnd.onepager": { source: "iana" }, "application/vnd.onepagertamp": { source: "iana" }, "application/vnd.onepagertamx": { source: "iana" }, "application/vnd.onepagertat": { source: "iana" }, "application/vnd.onepagertatp": { source: "iana" }, "application/vnd.onepagertatx": { source: "iana" }, "application/vnd.openblox.game+xml": { source: "iana", compressible: true, extensions: ["obgx"] }, "application/vnd.openblox.game-binary": { source: "iana" }, "application/vnd.openeye.oeb": { source: "iana" }, "application/vnd.openofficeorg.extension": { source: "apache", extensions: ["oxt"] }, "application/vnd.openstreetmap.data+xml": { source: "iana", compressible: true, extensions: ["osm"] }, "application/vnd.opentimestamps.ots": { source: "iana" }, "application/vnd.openxmlformats-officedocument.custom-properties+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.customxmlproperties+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawing+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawingml.chart+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawingml.diagramcolors+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawingml.diagramdata+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawingml.diagramlayout+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.drawingml.diagramstyle+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.extended-properties+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.commentauthors+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.comments+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.handoutmaster+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.notesmaster+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.notesslide+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.presentation": { source: "iana", compressible: false, extensions: ["pptx"] }, "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.presprops+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.slide": { source: "iana", extensions: ["sldx"] }, "application/vnd.openxmlformats-officedocument.presentationml.slide+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.slidelayout+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.slidemaster+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow": { source: "iana", extensions: ["ppsx"] }, "application/vnd.openxmlformats-officedocument.presentationml.slideshow.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.slideupdateinfo+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.tablestyles+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.tags+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.template": { source: "iana", extensions: ["potx"] }, "application/vnd.openxmlformats-officedocument.presentationml.template.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.presentationml.viewprops+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.calcchain+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.chartsheet+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.connections+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.dialogsheet+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.externallink+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcachedefinition+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotcacherecords+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.pivottable+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.querytable+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionheaders+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.revisionlog+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedstrings+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet": { source: "iana", compressible: false, extensions: ["xlsx"] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheetmetadata+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.tablesinglecells+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template": { source: "iana", extensions: ["xltx"] }, "application/vnd.openxmlformats-officedocument.spreadsheetml.template.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.usernames+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.volatiledependencies+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.theme+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.themeoverride+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.vmldrawing": { source: "iana" }, "application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document": { source: "iana", compressible: false, extensions: ["docx"] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.glossary+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.endnotes+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.fonttable+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.numbering+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.styles+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template": { source: "iana", extensions: ["dotx"] }, "application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-officedocument.wordprocessingml.websettings+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-package.core-properties+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml": { source: "iana", compressible: true }, "application/vnd.openxmlformats-package.relationships+xml": { source: "iana", compressible: true }, "application/vnd.oracle.resource+json": { source: "iana", compressible: true }, "application/vnd.orange.indata": { source: "iana" }, "application/vnd.osa.netdeploy": { source: "iana" }, "application/vnd.osgeo.mapguide.package": { source: "iana", extensions: ["mgp"] }, "application/vnd.osgi.bundle": { source: "iana" }, "application/vnd.osgi.dp": { source: "iana", extensions: ["dp"] }, "application/vnd.osgi.subsystem": { source: "iana", extensions: ["esa"] }, "application/vnd.otps.ct-kip+xml": { source: "iana", compressible: true }, "application/vnd.oxli.countgraph": { source: "iana" }, "application/vnd.pagerduty+json": { source: "iana", compressible: true }, "application/vnd.palm": { source: "iana", extensions: ["pdb", "pqa", "oprc"] }, "application/vnd.panoply": { source: "iana" }, "application/vnd.paos.xml": { source: "iana" }, "application/vnd.patentdive": { source: "iana" }, "application/vnd.patientecommsdoc": { source: "iana" }, "application/vnd.pawaafile": { source: "iana", extensions: ["paw"] }, "application/vnd.pcos": { source: "iana" }, "application/vnd.pg.format": { source: "iana", extensions: ["str"] }, "application/vnd.pg.osasli": { source: "iana", extensions: ["ei6"] }, "application/vnd.piaccess.application-licence": { source: "iana" }, "application/vnd.picsel": { source: "iana", extensions: ["efif"] }, "application/vnd.pmi.widget": { source: "iana", extensions: ["wg"] }, "application/vnd.poc.group-advertisement+xml": { source: "iana", compressible: true }, "application/vnd.pocketlearn": { source: "iana", extensions: ["plf"] }, "application/vnd.powerbuilder6": { source: "iana", extensions: ["pbd"] }, "application/vnd.powerbuilder6-s": { source: "iana" }, "application/vnd.powerbuilder7": { source: "iana" }, "application/vnd.powerbuilder7-s": { source: "iana" }, "application/vnd.powerbuilder75": { source: "iana" }, "application/vnd.powerbuilder75-s": { source: "iana" }, "application/vnd.preminet": { source: "iana" }, "application/vnd.previewsystems.box": { source: "iana", extensions: ["box"] }, "application/vnd.proteus.magazine": { source: "iana", extensions: ["mgz"] }, "application/vnd.psfs": { source: "iana" }, "application/vnd.publishare-delta-tree": { source: "iana", extensions: ["qps"] }, "application/vnd.pvi.ptid1": { source: "iana", extensions: ["ptid"] }, "application/vnd.pwg-multiplexed": { source: "iana" }, "application/vnd.pwg-xhtml-print+xml": { source: "iana", compressible: true }, "application/vnd.qualcomm.brew-app-res": { source: "iana" }, "application/vnd.quarantainenet": { source: "iana" }, "application/vnd.quark.quarkxpress": { source: "iana", extensions: ["qxd", "qxt", "qwd", "qwt", "qxl", "qxb"] }, "application/vnd.quobject-quoxdocument": { source: "iana" }, "application/vnd.radisys.moml+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-audit+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-audit-conf+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-audit-conn+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-audit-dialog+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-audit-stream+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-conf+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog-base+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog-fax-detect+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog-fax-sendrecv+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog-group+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog-speech+xml": { source: "iana", compressible: true }, "application/vnd.radisys.msml-dialog-transform+xml": { source: "iana", compressible: true }, "application/vnd.rainstor.data": { source: "iana" }, "application/vnd.rapid": { source: "iana" }, "application/vnd.rar": { source: "iana", extensions: ["rar"] }, "application/vnd.realvnc.bed": { source: "iana", extensions: ["bed"] }, "application/vnd.recordare.musicxml": { source: "iana", extensions: ["mxl"] }, "application/vnd.recordare.musicxml+xml": { source: "iana", compressible: true, extensions: ["musicxml"] }, "application/vnd.renlearn.rlprint": { source: "iana" }, "application/vnd.resilient.logic": { source: "iana" }, "application/vnd.restful+json": { source: "iana", compressible: true }, "application/vnd.rig.cryptonote": { source: "iana", extensions: ["cryptonote"] }, "application/vnd.rim.cod": { source: "apache", extensions: ["cod"] }, "application/vnd.rn-realmedia": { source: "apache", extensions: ["rm"] }, "application/vnd.rn-realmedia-vbr": { source: "apache", extensions: ["rmvb"] }, "application/vnd.route66.link66+xml": { source: "iana", compressible: true, extensions: ["link66"] }, "application/vnd.rs-274x": { source: "iana" }, "application/vnd.ruckus.download": { source: "iana" }, "application/vnd.s3sms": { source: "iana" }, "application/vnd.sailingtracker.track": { source: "iana", extensions: ["st"] }, "application/vnd.sar": { source: "iana" }, "application/vnd.sbm.cid": { source: "iana" }, "application/vnd.sbm.mid2": { source: "iana" }, "application/vnd.scribus": { source: "iana" }, "application/vnd.sealed.3df": { source: "iana" }, "application/vnd.sealed.csf": { source: "iana" }, "application/vnd.sealed.doc": { source: "iana" }, "application/vnd.sealed.eml": { source: "iana" }, "application/vnd.sealed.mht": { source: "iana" }, "application/vnd.sealed.net": { source: "iana" }, "application/vnd.sealed.ppt": { source: "iana" }, "application/vnd.sealed.tiff": { source: "iana" }, "application/vnd.sealed.xls": { source: "iana" }, "application/vnd.sealedmedia.softseal.html": { source: "iana" }, "application/vnd.sealedmedia.softseal.pdf": { source: "iana" }, "application/vnd.seemail": { source: "iana", extensions: ["see"] }, "application/vnd.seis+json": { source: "iana", compressible: true }, "application/vnd.sema": { source: "iana", extensions: ["sema"] }, "application/vnd.semd": { source: "iana", extensions: ["semd"] }, "application/vnd.semf": { source: "iana", extensions: ["semf"] }, "application/vnd.shade-save-file": { source: "iana" }, "application/vnd.shana.informed.formdata": { source: "iana", extensions: ["ifm"] }, "application/vnd.shana.informed.formtemplate": { source: "iana", extensions: ["itp"] }, "application/vnd.shana.informed.interchange": { source: "iana", extensions: ["iif"] }, "application/vnd.shana.informed.package": { source: "iana", extensions: ["ipk"] }, "application/vnd.shootproof+json": { source: "iana", compressible: true }, "application/vnd.shopkick+json": { source: "iana", compressible: true }, "application/vnd.shp": { source: "iana" }, "application/vnd.shx": { source: "iana" }, "application/vnd.sigrok.session": { source: "iana" }, "application/vnd.simtech-mindmapper": { source: "iana", extensions: ["twd", "twds"] }, "application/vnd.siren+json": { source: "iana", compressible: true }, "application/vnd.smaf": { source: "iana", extensions: ["mmf"] }, "application/vnd.smart.notebook": { source: "iana" }, "application/vnd.smart.teacher": { source: "iana", extensions: ["teacher"] }, "application/vnd.snesdev-page-table": { source: "iana" }, "application/vnd.software602.filler.form+xml": { source: "iana", compressible: true, extensions: ["fo"] }, "application/vnd.software602.filler.form-xml-zip": { source: "iana" }, "application/vnd.solent.sdkm+xml": { source: "iana", compressible: true, extensions: ["sdkm", "sdkd"] }, "application/vnd.spotfire.dxp": { source: "iana", extensions: ["dxp"] }, "application/vnd.spotfire.sfs": { source: "iana", extensions: ["sfs"] }, "application/vnd.sqlite3": { source: "iana" }, "application/vnd.sss-cod": { source: "iana" }, "application/vnd.sss-dtf": { source: "iana" }, "application/vnd.sss-ntf": { source: "iana" }, "application/vnd.stardivision.calc": { source: "apache", extensions: ["sdc"] }, "application/vnd.stardivision.draw": { source: "apache", extensions: ["sda"] }, "application/vnd.stardivision.impress": { source: "apache", extensions: ["sdd"] }, "application/vnd.stardivision.math": { source: "apache", extensions: ["smf"] }, "application/vnd.stardivision.writer": { source: "apache", extensions: ["sdw", "vor"] }, "application/vnd.stardivision.writer-global": { source: "apache", extensions: ["sgl"] }, "application/vnd.stepmania.package": { source: "iana", extensions: ["smzip"] }, "application/vnd.stepmania.stepchart": { source: "iana", extensions: ["sm"] }, "application/vnd.street-stream": { source: "iana" }, "application/vnd.sun.wadl+xml": { source: "iana", compressible: true, extensions: ["wadl"] }, "application/vnd.sun.xml.calc": { source: "apache", extensions: ["sxc"] }, "application/vnd.sun.xml.calc.template": { source: "apache", extensions: ["stc"] }, "application/vnd.sun.xml.draw": { source: "apache", extensions: ["sxd"] }, "application/vnd.sun.xml.draw.template": { source: "apache", extensions: ["std"] }, "application/vnd.sun.xml.impress": { source: "apache", extensions: ["sxi"] }, "application/vnd.sun.xml.impress.template": { source: "apache", extensions: ["sti"] }, "application/vnd.sun.xml.math": { source: "apache", extensions: ["sxm"] }, "application/vnd.sun.xml.writer": { source: "apache", extensions: ["sxw"] }, "application/vnd.sun.xml.writer.global": { source: "apache", extensions: ["sxg"] }, "application/vnd.sun.xml.writer.template": { source: "apache", extensions: ["stw"] }, "application/vnd.sus-calendar": { source: "iana", extensions: ["sus", "susp"] }, "application/vnd.svd": { source: "iana", extensions: ["svd"] }, "application/vnd.swiftview-ics": { source: "iana" }, "application/vnd.sycle+xml": { source: "iana", compressible: true }, "application/vnd.syft+json": { source: "iana", compressible: true }, "application/vnd.symbian.install": { source: "apache", extensions: ["sis", "sisx"] }, "application/vnd.syncml+xml": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["xsm"] }, "application/vnd.syncml.dm+wbxml": { source: "iana", charset: "UTF-8", extensions: ["bdm"] }, "application/vnd.syncml.dm+xml": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["xdm"] }, "application/vnd.syncml.dm.notification": { source: "iana" }, "application/vnd.syncml.dmddf+wbxml": { source: "iana" }, "application/vnd.syncml.dmddf+xml": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["ddf"] }, "application/vnd.syncml.dmtnds+wbxml": { source: "iana" }, "application/vnd.syncml.dmtnds+xml": { source: "iana", charset: "UTF-8", compressible: true }, "application/vnd.syncml.ds.notification": { source: "iana" }, "application/vnd.tableschema+json": { source: "iana", compressible: true }, "application/vnd.tao.intent-module-archive": { source: "iana", extensions: ["tao"] }, "application/vnd.tcpdump.pcap": { source: "iana", extensions: ["pcap", "cap", "dmp"] }, "application/vnd.think-cell.ppttc+json": { source: "iana", compressible: true }, "application/vnd.tmd.mediaflex.api+xml": { source: "iana", compressible: true }, "application/vnd.tml": { source: "iana" }, "application/vnd.tmobile-livetv": { source: "iana", extensions: ["tmo"] }, "application/vnd.tri.onesource": { source: "iana" }, "application/vnd.trid.tpt": { source: "iana", extensions: ["tpt"] }, "application/vnd.triscape.mxs": { source: "iana", extensions: ["mxs"] }, "application/vnd.trueapp": { source: "iana", extensions: ["tra"] }, "application/vnd.truedoc": { source: "iana" }, "application/vnd.ubisoft.webplayer": { source: "iana" }, "application/vnd.ufdl": { source: "iana", extensions: ["ufd", "ufdl"] }, "application/vnd.uiq.theme": { source: "iana", extensions: ["utz"] }, "application/vnd.umajin": { source: "iana", extensions: ["umj"] }, "application/vnd.unity": { source: "iana", extensions: ["unityweb"] }, "application/vnd.uoml+xml": { source: "iana", compressible: true, extensions: ["uoml"] }, "application/vnd.uplanet.alert": { source: "iana" }, "application/vnd.uplanet.alert-wbxml": { source: "iana" }, "application/vnd.uplanet.bearer-choice": { source: "iana" }, "application/vnd.uplanet.bearer-choice-wbxml": { source: "iana" }, "application/vnd.uplanet.cacheop": { source: "iana" }, "application/vnd.uplanet.cacheop-wbxml": { source: "iana" }, "application/vnd.uplanet.channel": { source: "iana" }, "application/vnd.uplanet.channel-wbxml": { source: "iana" }, "application/vnd.uplanet.list": { source: "iana" }, "application/vnd.uplanet.list-wbxml": { source: "iana" }, "application/vnd.uplanet.listcmd": { source: "iana" }, "application/vnd.uplanet.listcmd-wbxml": { source: "iana" }, "application/vnd.uplanet.signal": { source: "iana" }, "application/vnd.uri-map": { source: "iana" }, "application/vnd.valve.source.material": { source: "iana" }, "application/vnd.vcx": { source: "iana", extensions: ["vcx"] }, "application/vnd.vd-study": { source: "iana" }, "application/vnd.vectorworks": { source: "iana" }, "application/vnd.vel+json": { source: "iana", compressible: true }, "application/vnd.verimatrix.vcas": { source: "iana" }, "application/vnd.veritone.aion+json": { source: "iana", compressible: true }, "application/vnd.veryant.thin": { source: "iana" }, "application/vnd.ves.encrypted": { source: "iana" }, "application/vnd.vidsoft.vidconference": { source: "iana" }, "application/vnd.visio": { source: "iana", extensions: ["vsd", "vst", "vss", "vsw"] }, "application/vnd.visionary": { source: "iana", extensions: ["vis"] }, "application/vnd.vividence.scriptfile": { source: "iana" }, "application/vnd.vsf": { source: "iana", extensions: ["vsf"] }, "application/vnd.wap.sic": { source: "iana" }, "application/vnd.wap.slc": { source: "iana" }, "application/vnd.wap.wbxml": { source: "iana", charset: "UTF-8", extensions: ["wbxml"] }, "application/vnd.wap.wmlc": { source: "iana", extensions: ["wmlc"] }, "application/vnd.wap.wmlscriptc": { source: "iana", extensions: ["wmlsc"] }, "application/vnd.webturbo": { source: "iana", extensions: ["wtb"] }, "application/vnd.wfa.dpp": { source: "iana" }, "application/vnd.wfa.p2p": { source: "iana" }, "application/vnd.wfa.wsc": { source: "iana" }, "application/vnd.windows.devicepairing": { source: "iana" }, "application/vnd.wmc": { source: "iana" }, "application/vnd.wmf.bootstrap": { source: "iana" }, "application/vnd.wolfram.mathematica": { source: "iana" }, "application/vnd.wolfram.mathematica.package": { source: "iana" }, "application/vnd.wolfram.player": { source: "iana", extensions: ["nbp"] }, "application/vnd.wordperfect": { source: "iana", extensions: ["wpd"] }, "application/vnd.wqd": { source: "iana", extensions: ["wqd"] }, "application/vnd.wrq-hp3000-labelled": { source: "iana" }, "application/vnd.wt.stf": { source: "iana", extensions: ["stf"] }, "application/vnd.wv.csp+wbxml": { source: "iana" }, "application/vnd.wv.csp+xml": { source: "iana", compressible: true }, "application/vnd.wv.ssp+xml": { source: "iana", compressible: true }, "application/vnd.xacml+json": { source: "iana", compressible: true }, "application/vnd.xara": { source: "iana", extensions: ["xar"] }, "application/vnd.xfdl": { source: "iana", extensions: ["xfdl"] }, "application/vnd.xfdl.webform": { source: "iana" }, "application/vnd.xmi+xml": { source: "iana", compressible: true }, "application/vnd.xmpie.cpkg": { source: "iana" }, "application/vnd.xmpie.dpkg": { source: "iana" }, "application/vnd.xmpie.plan": { source: "iana" }, "application/vnd.xmpie.ppkg": { source: "iana" }, "application/vnd.xmpie.xlim": { source: "iana" }, "application/vnd.yamaha.hv-dic": { source: "iana", extensions: ["hvd"] }, "application/vnd.yamaha.hv-script": { source: "iana", extensions: ["hvs"] }, "application/vnd.yamaha.hv-voice": { source: "iana", extensions: ["hvp"] }, "application/vnd.yamaha.openscoreformat": { source: "iana", extensions: ["osf"] }, "application/vnd.yamaha.openscoreformat.osfpvg+xml": { source: "iana", compressible: true, extensions: ["osfpvg"] }, "application/vnd.yamaha.remote-setup": { source: "iana" }, "application/vnd.yamaha.smaf-audio": { source: "iana", extensions: ["saf"] }, "application/vnd.yamaha.smaf-phrase": { source: "iana", extensions: ["spf"] }, "application/vnd.yamaha.through-ngn": { source: "iana" }, "application/vnd.yamaha.tunnel-udpencap": { source: "iana" }, "application/vnd.yaoweme": { source: "iana" }, "application/vnd.yellowriver-custom-menu": { source: "iana", extensions: ["cmp"] }, "application/vnd.youtube.yt": { source: "iana" }, "application/vnd.zul": { source: "iana", extensions: ["zir", "zirz"] }, "application/vnd.zzazz.deck+xml": { source: "iana", compressible: true, extensions: ["zaz"] }, "application/voicexml+xml": { source: "iana", compressible: true, extensions: ["vxml"] }, "application/voucher-cms+json": { source: "iana", compressible: true }, "application/vq-rtcpxr": { source: "iana" }, "application/wasm": { source: "iana", compressible: true, extensions: ["wasm"] }, "application/watcherinfo+xml": { source: "iana", compressible: true, extensions: ["wif"] }, "application/webpush-options+json": { source: "iana", compressible: true }, "application/whoispp-query": { source: "iana" }, "application/whoispp-response": { source: "iana" }, "application/widget": { source: "iana", extensions: ["wgt"] }, "application/winhlp": { source: "apache", extensions: ["hlp"] }, "application/wita": { source: "iana" }, "application/wordperfect5.1": { source: "iana" }, "application/wsdl+xml": { source: "iana", compressible: true, extensions: ["wsdl"] }, "application/wspolicy+xml": { source: "iana", compressible: true, extensions: ["wspolicy"] }, "application/x-7z-compressed": { source: "apache", compressible: false, extensions: ["7z"] }, "application/x-abiword": { source: "apache", extensions: ["abw"] }, "application/x-ace-compressed": { source: "apache", extensions: ["ace"] }, "application/x-amf": { source: "apache" }, "application/x-apple-diskimage": { source: "apache", extensions: ["dmg"] }, "application/x-arj": { compressible: false, extensions: ["arj"] }, "application/x-authorware-bin": { source: "apache", extensions: ["aab", "x32", "u32", "vox"] }, "application/x-authorware-map": { source: "apache", extensions: ["aam"] }, "application/x-authorware-seg": { source: "apache", extensions: ["aas"] }, "application/x-bcpio": { source: "apache", extensions: ["bcpio"] }, "application/x-bdoc": { compressible: false, extensions: ["bdoc"] }, "application/x-bittorrent": { source: "apache", extensions: ["torrent"] }, "application/x-blorb": { source: "apache", extensions: ["blb", "blorb"] }, "application/x-bzip": { source: "apache", compressible: false, extensions: ["bz"] }, "application/x-bzip2": { source: "apache", compressible: false, extensions: ["bz2", "boz"] }, "application/x-cbr": { source: "apache", extensions: ["cbr", "cba", "cbt", "cbz", "cb7"] }, "application/x-cdlink": { source: "apache", extensions: ["vcd"] }, "application/x-cfs-compressed": { source: "apache", extensions: ["cfs"] }, "application/x-chat": { source: "apache", extensions: ["chat"] }, "application/x-chess-pgn": { source: "apache", extensions: ["pgn"] }, "application/x-chrome-extension": { extensions: ["crx"] }, "application/x-cocoa": { source: "nginx", extensions: ["cco"] }, "application/x-compress": { source: "apache" }, "application/x-conference": { source: "apache", extensions: ["nsc"] }, "application/x-cpio": { source: "apache", extensions: ["cpio"] }, "application/x-csh": { source: "apache", extensions: ["csh"] }, "application/x-deb": { compressible: false }, "application/x-debian-package": { source: "apache", extensions: ["deb", "udeb"] }, "application/x-dgc-compressed": { source: "apache", extensions: ["dgc"] }, "application/x-director": { source: "apache", extensions: ["dir", "dcr", "dxr", "cst", "cct", "cxt", "w3d", "fgd", "swa"] }, "application/x-doom": { source: "apache", extensions: ["wad"] }, "application/x-dtbncx+xml": { source: "apache", compressible: true, extensions: ["ncx"] }, "application/x-dtbook+xml": { source: "apache", compressible: true, extensions: ["dtb"] }, "application/x-dtbresource+xml": { source: "apache", compressible: true, extensions: ["res"] }, "application/x-dvi": { source: "apache", compressible: false, extensions: ["dvi"] }, "application/x-envoy": { source: "apache", extensions: ["evy"] }, "application/x-eva": { source: "apache", extensions: ["eva"] }, "application/x-font-bdf": { source: "apache", extensions: ["bdf"] }, "application/x-font-dos": { source: "apache" }, "application/x-font-framemaker": { source: "apache" }, "application/x-font-ghostscript": { source: "apache", extensions: ["gsf"] }, "application/x-font-libgrx": { source: "apache" }, "application/x-font-linux-psf": { source: "apache", extensions: ["psf"] }, "application/x-font-pcf": { source: "apache", extensions: ["pcf"] }, "application/x-font-snf": { source: "apache", extensions: ["snf"] }, "application/x-font-speedo": { source: "apache" }, "application/x-font-sunos-news": { source: "apache" }, "application/x-font-type1": { source: "apache", extensions: ["pfa", "pfb", "pfm", "afm"] }, "application/x-font-vfont": { source: "apache" }, "application/x-freearc": { source: "apache", extensions: ["arc"] }, "application/x-futuresplash": { source: "apache", extensions: ["spl"] }, "application/x-gca-compressed": { source: "apache", extensions: ["gca"] }, "application/x-glulx": { source: "apache", extensions: ["ulx"] }, "application/x-gnumeric": { source: "apache", extensions: ["gnumeric"] }, "application/x-gramps-xml": { source: "apache", extensions: ["gramps"] }, "application/x-gtar": { source: "apache", extensions: ["gtar"] }, "application/x-gzip": { source: "apache" }, "application/x-hdf": { source: "apache", extensions: ["hdf"] }, "application/x-httpd-php": { compressible: true, extensions: ["php"] }, "application/x-install-instructions": { source: "apache", extensions: ["install"] }, "application/x-iso9660-image": { source: "apache", extensions: ["iso"] }, "application/x-iwork-keynote-sffkey": { extensions: ["key"] }, "application/x-iwork-numbers-sffnumbers": { extensions: ["numbers"] }, "application/x-iwork-pages-sffpages": { extensions: ["pages"] }, "application/x-java-archive-diff": { source: "nginx", extensions: ["jardiff"] }, "application/x-java-jnlp-file": { source: "apache", compressible: false, extensions: ["jnlp"] }, "application/x-javascript": { compressible: true }, "application/x-keepass2": { extensions: ["kdbx"] }, "application/x-latex": { source: "apache", compressible: false, extensions: ["latex"] }, "application/x-lua-bytecode": { extensions: ["luac"] }, "application/x-lzh-compressed": { source: "apache", extensions: ["lzh", "lha"] }, "application/x-makeself": { source: "nginx", extensions: ["run"] }, "application/x-mie": { source: "apache", extensions: ["mie"] }, "application/x-mobipocket-ebook": { source: "apache", extensions: ["prc", "mobi"] }, "application/x-mpegurl": { compressible: false }, "application/x-ms-application": { source: "apache", extensions: ["application"] }, "application/x-ms-shortcut": { source: "apache", extensions: ["lnk"] }, "application/x-ms-wmd": { source: "apache", extensions: ["wmd"] }, "application/x-ms-wmz": { source: "apache", extensions: ["wmz"] }, "application/x-ms-xbap": { source: "apache", extensions: ["xbap"] }, "application/x-msaccess": { source: "apache", extensions: ["mdb"] }, "application/x-msbinder": { source: "apache", extensions: ["obd"] }, "application/x-mscardfile": { source: "apache", extensions: ["crd"] }, "application/x-msclip": { source: "apache", extensions: ["clp"] }, "application/x-msdos-program": { extensions: ["exe"] }, "application/x-msdownload": { source: "apache", extensions: ["exe", "dll", "com", "bat", "msi"] }, "application/x-msmediaview": { source: "apache", extensions: ["mvb", "m13", "m14"] }, "application/x-msmetafile": { source: "apache", extensions: ["wmf", "wmz", "emf", "emz"] }, "application/x-msmoney": { source: "apache", extensions: ["mny"] }, "application/x-mspublisher": { source: "apache", extensions: ["pub"] }, "application/x-msschedule": { source: "apache", extensions: ["scd"] }, "application/x-msterminal": { source: "apache", extensions: ["trm"] }, "application/x-mswrite": { source: "apache", extensions: ["wri"] }, "application/x-netcdf": { source: "apache", extensions: ["nc", "cdf"] }, "application/x-ns-proxy-autoconfig": { compressible: true, extensions: ["pac"] }, "application/x-nzb": { source: "apache", extensions: ["nzb"] }, "application/x-perl": { source: "nginx", extensions: ["pl", "pm"] }, "application/x-pilot": { source: "nginx", extensions: ["prc", "pdb"] }, "application/x-pkcs12": { source: "apache", compressible: false, extensions: ["p12", "pfx"] }, "application/x-pkcs7-certificates": { source: "apache", extensions: ["p7b", "spc"] }, "application/x-pkcs7-certreqresp": { source: "apache", extensions: ["p7r"] }, "application/x-pki-message": { source: "iana" }, "application/x-rar-compressed": { source: "apache", compressible: false, extensions: ["rar"] }, "application/x-redhat-package-manager": { source: "nginx", extensions: ["rpm"] }, "application/x-research-info-systems": { source: "apache", extensions: ["ris"] }, "application/x-sea": { source: "nginx", extensions: ["sea"] }, "application/x-sh": { source: "apache", compressible: true, extensions: ["sh"] }, "application/x-shar": { source: "apache", extensions: ["shar"] }, "application/x-shockwave-flash": { source: "apache", compressible: false, extensions: ["swf"] }, "application/x-silverlight-app": { source: "apache", extensions: ["xap"] }, "application/x-sql": { source: "apache", extensions: ["sql"] }, "application/x-stuffit": { source: "apache", compressible: false, extensions: ["sit"] }, "application/x-stuffitx": { source: "apache", extensions: ["sitx"] }, "application/x-subrip": { source: "apache", extensions: ["srt"] }, "application/x-sv4cpio": { source: "apache", extensions: ["sv4cpio"] }, "application/x-sv4crc": { source: "apache", extensions: ["sv4crc"] }, "application/x-t3vm-image": { source: "apache", extensions: ["t3"] }, "application/x-tads": { source: "apache", extensions: ["gam"] }, "application/x-tar": { source: "apache", compressible: true, extensions: ["tar"] }, "application/x-tcl": { source: "apache", extensions: ["tcl", "tk"] }, "application/x-tex": { source: "apache", extensions: ["tex"] }, "application/x-tex-tfm": { source: "apache", extensions: ["tfm"] }, "application/x-texinfo": { source: "apache", extensions: ["texinfo", "texi"] }, "application/x-tgif": { source: "apache", extensions: ["obj"] }, "application/x-ustar": { source: "apache", extensions: ["ustar"] }, "application/x-virtualbox-hdd": { compressible: true, extensions: ["hdd"] }, "application/x-virtualbox-ova": { compressible: true, extensions: ["ova"] }, "application/x-virtualbox-ovf": { compressible: true, extensions: ["ovf"] }, "application/x-virtualbox-vbox": { compressible: true, extensions: ["vbox"] }, "application/x-virtualbox-vbox-extpack": { compressible: false, extensions: ["vbox-extpack"] }, "application/x-virtualbox-vdi": { compressible: true, extensions: ["vdi"] }, "application/x-virtualbox-vhd": { compressible: true, extensions: ["vhd"] }, "application/x-virtualbox-vmdk": { compressible: true, extensions: ["vmdk"] }, "application/x-wais-source": { source: "apache", extensions: ["src"] }, "application/x-web-app-manifest+json": { compressible: true, extensions: ["webapp"] }, "application/x-www-form-urlencoded": { source: "iana", compressible: true }, "application/x-x509-ca-cert": { source: "iana", extensions: ["der", "crt", "pem"] }, "application/x-x509-ca-ra-cert": { source: "iana" }, "application/x-x509-next-ca-cert": { source: "iana" }, "application/x-xfig": { source: "apache", extensions: ["fig"] }, "application/x-xliff+xml": { source: "apache", compressible: true, extensions: ["xlf"] }, "application/x-xpinstall": { source: "apache", compressible: false, extensions: ["xpi"] }, "application/x-xz": { source: "apache", extensions: ["xz"] }, "application/x-zmachine": { source: "apache", extensions: ["z1", "z2", "z3", "z4", "z5", "z6", "z7", "z8"] }, "application/x400-bp": { source: "iana" }, "application/xacml+xml": { source: "iana", compressible: true }, "application/xaml+xml": { source: "apache", compressible: true, extensions: ["xaml"] }, "application/xcap-att+xml": { source: "iana", compressible: true, extensions: ["xav"] }, "application/xcap-caps+xml": { source: "iana", compressible: true, extensions: ["xca"] }, "application/xcap-diff+xml": { source: "iana", compressible: true, extensions: ["xdf"] }, "application/xcap-el+xml": { source: "iana", compressible: true, extensions: ["xel"] }, "application/xcap-error+xml": { source: "iana", compressible: true }, "application/xcap-ns+xml": { source: "iana", compressible: true, extensions: ["xns"] }, "application/xcon-conference-info+xml": { source: "iana", compressible: true }, "application/xcon-conference-info-diff+xml": { source: "iana", compressible: true }, "application/xenc+xml": { source: "iana", compressible: true, extensions: ["xenc"] }, "application/xhtml+xml": { source: "iana", compressible: true, extensions: ["xhtml", "xht"] }, "application/xhtml-voice+xml": { source: "apache", compressible: true }, "application/xliff+xml": { source: "iana", compressible: true, extensions: ["xlf"] }, "application/xml": { source: "iana", compressible: true, extensions: ["xml", "xsl", "xsd", "rng"] }, "application/xml-dtd": { source: "iana", compressible: true, extensions: ["dtd"] }, "application/xml-external-parsed-entity": { source: "iana" }, "application/xml-patch+xml": { source: "iana", compressible: true }, "application/xmpp+xml": { source: "iana", compressible: true }, "application/xop+xml": { source: "iana", compressible: true, extensions: ["xop"] }, "application/xproc+xml": { source: "apache", compressible: true, extensions: ["xpl"] }, "application/xslt+xml": { source: "iana", compressible: true, extensions: ["xsl", "xslt"] }, "application/xspf+xml": { source: "apache", compressible: true, extensions: ["xspf"] }, "application/xv+xml": { source: "iana", compressible: true, extensions: ["mxml", "xhvml", "xvml", "xvm"] }, "application/yang": { source: "iana", extensions: ["yang"] }, "application/yang-data+json": { source: "iana", compressible: true }, "application/yang-data+xml": { source: "iana", compressible: true }, "application/yang-patch+json": { source: "iana", compressible: true }, "application/yang-patch+xml": { source: "iana", compressible: true }, "application/yin+xml": { source: "iana", compressible: true, extensions: ["yin"] }, "application/zip": { source: "iana", compressible: false, extensions: ["zip"] }, "application/zlib": { source: "iana" }, "application/zstd": { source: "iana" }, "audio/1d-interleaved-parityfec": { source: "iana" }, "audio/32kadpcm": { source: "iana" }, "audio/3gpp": { source: "iana", compressible: false, extensions: ["3gpp"] }, "audio/3gpp2": { source: "iana" }, "audio/aac": { source: "iana" }, "audio/ac3": { source: "iana" }, "audio/adpcm": { source: "apache", extensions: ["adp"] }, "audio/amr": { source: "iana", extensions: ["amr"] }, "audio/amr-wb": { source: "iana" }, "audio/amr-wb+": { source: "iana" }, "audio/aptx": { source: "iana" }, "audio/asc": { source: "iana" }, "audio/atrac-advanced-lossless": { source: "iana" }, "audio/atrac-x": { source: "iana" }, "audio/atrac3": { source: "iana" }, "audio/basic": { source: "iana", compressible: false, extensions: ["au", "snd"] }, "audio/bv16": { source: "iana" }, "audio/bv32": { source: "iana" }, "audio/clearmode": { source: "iana" }, "audio/cn": { source: "iana" }, "audio/dat12": { source: "iana" }, "audio/dls": { source: "iana" }, "audio/dsr-es201108": { source: "iana" }, "audio/dsr-es202050": { source: "iana" }, "audio/dsr-es202211": { source: "iana" }, "audio/dsr-es202212": { source: "iana" }, "audio/dv": { source: "iana" }, "audio/dvi4": { source: "iana" }, "audio/eac3": { source: "iana" }, "audio/encaprtp": { source: "iana" }, "audio/evrc": { source: "iana" }, "audio/evrc-qcp": { source: "iana" }, "audio/evrc0": { source: "iana" }, "audio/evrc1": { source: "iana" }, "audio/evrcb": { source: "iana" }, "audio/evrcb0": { source: "iana" }, "audio/evrcb1": { source: "iana" }, "audio/evrcnw": { source: "iana" }, "audio/evrcnw0": { source: "iana" }, "audio/evrcnw1": { source: "iana" }, "audio/evrcwb": { source: "iana" }, "audio/evrcwb0": { source: "iana" }, "audio/evrcwb1": { source: "iana" }, "audio/evs": { source: "iana" }, "audio/flexfec": { source: "iana" }, "audio/fwdred": { source: "iana" }, "audio/g711-0": { source: "iana" }, "audio/g719": { source: "iana" }, "audio/g722": { source: "iana" }, "audio/g7221": { source: "iana" }, "audio/g723": { source: "iana" }, "audio/g726-16": { source: "iana" }, "audio/g726-24": { source: "iana" }, "audio/g726-32": { source: "iana" }, "audio/g726-40": { source: "iana" }, "audio/g728": { source: "iana" }, "audio/g729": { source: "iana" }, "audio/g7291": { source: "iana" }, "audio/g729d": { source: "iana" }, "audio/g729e": { source: "iana" }, "audio/gsm": { source: "iana" }, "audio/gsm-efr": { source: "iana" }, "audio/gsm-hr-08": { source: "iana" }, "audio/ilbc": { source: "iana" }, "audio/ip-mr_v2.5": { source: "iana" }, "audio/isac": { source: "apache" }, "audio/l16": { source: "iana" }, "audio/l20": { source: "iana" }, "audio/l24": { source: "iana", compressible: false }, "audio/l8": { source: "iana" }, "audio/lpc": { source: "iana" }, "audio/melp": { source: "iana" }, "audio/melp1200": { source: "iana" }, "audio/melp2400": { source: "iana" }, "audio/melp600": { source: "iana" }, "audio/mhas": { source: "iana" }, "audio/midi": { source: "apache", extensions: ["mid", "midi", "kar", "rmi"] }, "audio/mobile-xmf": { source: "iana", extensions: ["mxmf"] }, "audio/mp3": { compressible: false, extensions: ["mp3"] }, "audio/mp4": { source: "iana", compressible: false, extensions: ["m4a", "mp4a"] }, "audio/mp4a-latm": { source: "iana" }, "audio/mpa": { source: "iana" }, "audio/mpa-robust": { source: "iana" }, "audio/mpeg": { source: "iana", compressible: false, extensions: ["mpga", "mp2", "mp2a", "mp3", "m2a", "m3a"] }, "audio/mpeg4-generic": { source: "iana" }, "audio/musepack": { source: "apache" }, "audio/ogg": { source: "iana", compressible: false, extensions: ["oga", "ogg", "spx", "opus"] }, "audio/opus": { source: "iana" }, "audio/parityfec": { source: "iana" }, "audio/pcma": { source: "iana" }, "audio/pcma-wb": { source: "iana" }, "audio/pcmu": { source: "iana" }, "audio/pcmu-wb": { source: "iana" }, "audio/prs.sid": { source: "iana" }, "audio/qcelp": { source: "iana" }, "audio/raptorfec": { source: "iana" }, "audio/red": { source: "iana" }, "audio/rtp-enc-aescm128": { source: "iana" }, "audio/rtp-midi": { source: "iana" }, "audio/rtploopback": { source: "iana" }, "audio/rtx": { source: "iana" }, "audio/s3m": { source: "apache", extensions: ["s3m"] }, "audio/scip": { source: "iana" }, "audio/silk": { source: "apache", extensions: ["sil"] }, "audio/smv": { source: "iana" }, "audio/smv-qcp": { source: "iana" }, "audio/smv0": { source: "iana" }, "audio/sofa": { source: "iana" }, "audio/sp-midi": { source: "iana" }, "audio/speex": { source: "iana" }, "audio/t140c": { source: "iana" }, "audio/t38": { source: "iana" }, "audio/telephone-event": { source: "iana" }, "audio/tetra_acelp": { source: "iana" }, "audio/tetra_acelp_bb": { source: "iana" }, "audio/tone": { source: "iana" }, "audio/tsvcis": { source: "iana" }, "audio/uemclip": { source: "iana" }, "audio/ulpfec": { source: "iana" }, "audio/usac": { source: "iana" }, "audio/vdvi": { source: "iana" }, "audio/vmr-wb": { source: "iana" }, "audio/vnd.3gpp.iufp": { source: "iana" }, "audio/vnd.4sb": { source: "iana" }, "audio/vnd.audiokoz": { source: "iana" }, "audio/vnd.celp": { source: "iana" }, "audio/vnd.cisco.nse": { source: "iana" }, "audio/vnd.cmles.radio-events": { source: "iana" }, "audio/vnd.cns.anp1": { source: "iana" }, "audio/vnd.cns.inf1": { source: "iana" }, "audio/vnd.dece.audio": { source: "iana", extensions: ["uva", "uvva"] }, "audio/vnd.digital-winds": { source: "iana", extensions: ["eol"] }, "audio/vnd.dlna.adts": { source: "iana" }, "audio/vnd.dolby.heaac.1": { source: "iana" }, "audio/vnd.dolby.heaac.2": { source: "iana" }, "audio/vnd.dolby.mlp": { source: "iana" }, "audio/vnd.dolby.mps": { source: "iana" }, "audio/vnd.dolby.pl2": { source: "iana" }, "audio/vnd.dolby.pl2x": { source: "iana" }, "audio/vnd.dolby.pl2z": { source: "iana" }, "audio/vnd.dolby.pulse.1": { source: "iana" }, "audio/vnd.dra": { source: "iana", extensions: ["dra"] }, "audio/vnd.dts": { source: "iana", extensions: ["dts"] }, "audio/vnd.dts.hd": { source: "iana", extensions: ["dtshd"] }, "audio/vnd.dts.uhd": { source: "iana" }, "audio/vnd.dvb.file": { source: "iana" }, "audio/vnd.everad.plj": { source: "iana" }, "audio/vnd.hns.audio": { source: "iana" }, "audio/vnd.lucent.voice": { source: "iana", extensions: ["lvp"] }, "audio/vnd.ms-playready.media.pya": { source: "iana", extensions: ["pya"] }, "audio/vnd.nokia.mobile-xmf": { source: "iana" }, "audio/vnd.nortel.vbk": { source: "iana" }, "audio/vnd.nuera.ecelp4800": { source: "iana", extensions: ["ecelp4800"] }, "audio/vnd.nuera.ecelp7470": { source: "iana", extensions: ["ecelp7470"] }, "audio/vnd.nuera.ecelp9600": { source: "iana", extensions: ["ecelp9600"] }, "audio/vnd.octel.sbc": { source: "iana" }, "audio/vnd.presonus.multitrack": { source: "iana" }, "audio/vnd.qcelp": { source: "iana" }, "audio/vnd.rhetorex.32kadpcm": { source: "iana" }, "audio/vnd.rip": { source: "iana", extensions: ["rip"] }, "audio/vnd.rn-realaudio": { compressible: false }, "audio/vnd.sealedmedia.softseal.mpeg": { source: "iana" }, "audio/vnd.vmx.cvsd": { source: "iana" }, "audio/vnd.wave": { compressible: false }, "audio/vorbis": { source: "iana", compressible: false }, "audio/vorbis-config": { source: "iana" }, "audio/wav": { compressible: false, extensions: ["wav"] }, "audio/wave": { compressible: false, extensions: ["wav"] }, "audio/webm": { source: "apache", compressible: false, extensions: ["weba"] }, "audio/x-aac": { source: "apache", compressible: false, extensions: ["aac"] }, "audio/x-aiff": { source: "apache", extensions: ["aif", "aiff", "aifc"] }, "audio/x-caf": { source: "apache", compressible: false, extensions: ["caf"] }, "audio/x-flac": { source: "apache", extensions: ["flac"] }, "audio/x-m4a": { source: "nginx", extensions: ["m4a"] }, "audio/x-matroska": { source: "apache", extensions: ["mka"] }, "audio/x-mpegurl": { source: "apache", extensions: ["m3u"] }, "audio/x-ms-wax": { source: "apache", extensions: ["wax"] }, "audio/x-ms-wma": { source: "apache", extensions: ["wma"] }, "audio/x-pn-realaudio": { source: "apache", extensions: ["ram", "ra"] }, "audio/x-pn-realaudio-plugin": { source: "apache", extensions: ["rmp"] }, "audio/x-realaudio": { source: "nginx", extensions: ["ra"] }, "audio/x-tta": { source: "apache" }, "audio/x-wav": { source: "apache", extensions: ["wav"] }, "audio/xm": { source: "apache", extensions: ["xm"] }, "chemical/x-cdx": { source: "apache", extensions: ["cdx"] }, "chemical/x-cif": { source: "apache", extensions: ["cif"] }, "chemical/x-cmdf": { source: "apache", extensions: ["cmdf"] }, "chemical/x-cml": { source: "apache", extensions: ["cml"] }, "chemical/x-csml": { source: "apache", extensions: ["csml"] }, "chemical/x-pdb": { source: "apache" }, "chemical/x-xyz": { source: "apache", extensions: ["xyz"] }, "font/collection": { source: "iana", extensions: ["ttc"] }, "font/otf": { source: "iana", compressible: true, extensions: ["otf"] }, "font/sfnt": { source: "iana" }, "font/ttf": { source: "iana", compressible: true, extensions: ["ttf"] }, "font/woff": { source: "iana", extensions: ["woff"] }, "font/woff2": { source: "iana", extensions: ["woff2"] }, "image/aces": { source: "iana", extensions: ["exr"] }, "image/apng": { compressible: false, extensions: ["apng"] }, "image/avci": { source: "iana", extensions: ["avci"] }, "image/avcs": { source: "iana", extensions: ["avcs"] }, "image/avif": { source: "iana", compressible: false, extensions: ["avif"] }, "image/bmp": { source: "iana", compressible: true, extensions: ["bmp"] }, "image/cgm": { source: "iana", extensions: ["cgm"] }, "image/dicom-rle": { source: "iana", extensions: ["drle"] }, "image/emf": { source: "iana", extensions: ["emf"] }, "image/fits": { source: "iana", extensions: ["fits"] }, "image/g3fax": { source: "iana", extensions: ["g3"] }, "image/gif": { source: "iana", compressible: false, extensions: ["gif"] }, "image/heic": { source: "iana", extensions: ["heic"] }, "image/heic-sequence": { source: "iana", extensions: ["heics"] }, "image/heif": { source: "iana", extensions: ["heif"] }, "image/heif-sequence": { source: "iana", extensions: ["heifs"] }, "image/hej2k": { source: "iana", extensions: ["hej2"] }, "image/hsj2": { source: "iana", extensions: ["hsj2"] }, "image/ief": { source: "iana", extensions: ["ief"] }, "image/jls": { source: "iana", extensions: ["jls"] }, "image/jp2": { source: "iana", compressible: false, extensions: ["jp2", "jpg2"] }, "image/jpeg": { source: "iana", compressible: false, extensions: ["jpeg", "jpg", "jpe"] }, "image/jph": { source: "iana", extensions: ["jph"] }, "image/jphc": { source: "iana", extensions: ["jhc"] }, "image/jpm": { source: "iana", compressible: false, extensions: ["jpm"] }, "image/jpx": { source: "iana", compressible: false, extensions: ["jpx", "jpf"] }, "image/jxr": { source: "iana", extensions: ["jxr"] }, "image/jxra": { source: "iana", extensions: ["jxra"] }, "image/jxrs": { source: "iana", extensions: ["jxrs"] }, "image/jxs": { source: "iana", extensions: ["jxs"] }, "image/jxsc": { source: "iana", extensions: ["jxsc"] }, "image/jxsi": { source: "iana", extensions: ["jxsi"] }, "image/jxss": { source: "iana", extensions: ["jxss"] }, "image/ktx": { source: "iana", extensions: ["ktx"] }, "image/ktx2": { source: "iana", extensions: ["ktx2"] }, "image/naplps": { source: "iana" }, "image/pjpeg": { compressible: false }, "image/png": { source: "iana", compressible: false, extensions: ["png"] }, "image/prs.btif": { source: "iana", extensions: ["btif"] }, "image/prs.pti": { source: "iana", extensions: ["pti"] }, "image/pwg-raster": { source: "iana" }, "image/sgi": { source: "apache", extensions: ["sgi"] }, "image/svg+xml": { source: "iana", compressible: true, extensions: ["svg", "svgz"] }, "image/t38": { source: "iana", extensions: ["t38"] }, "image/tiff": { source: "iana", compressible: false, extensions: ["tif", "tiff"] }, "image/tiff-fx": { source: "iana", extensions: ["tfx"] }, "image/vnd.adobe.photoshop": { source: "iana", compressible: true, extensions: ["psd"] }, "image/vnd.airzip.accelerator.azv": { source: "iana", extensions: ["azv"] }, "image/vnd.cns.inf2": { source: "iana" }, "image/vnd.dece.graphic": { source: "iana", extensions: ["uvi", "uvvi", "uvg", "uvvg"] }, "image/vnd.djvu": { source: "iana", extensions: ["djvu", "djv"] }, "image/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] }, "image/vnd.dwg": { source: "iana", extensions: ["dwg"] }, "image/vnd.dxf": { source: "iana", extensions: ["dxf"] }, "image/vnd.fastbidsheet": { source: "iana", extensions: ["fbs"] }, "image/vnd.fpx": { source: "iana", extensions: ["fpx"] }, "image/vnd.fst": { source: "iana", extensions: ["fst"] }, "image/vnd.fujixerox.edmics-mmr": { source: "iana", extensions: ["mmr"] }, "image/vnd.fujixerox.edmics-rlc": { source: "iana", extensions: ["rlc"] }, "image/vnd.globalgraphics.pgb": { source: "iana" }, "image/vnd.microsoft.icon": { source: "iana", compressible: true, extensions: ["ico"] }, "image/vnd.mix": { source: "iana" }, "image/vnd.mozilla.apng": { source: "iana" }, "image/vnd.ms-dds": { compressible: true, extensions: ["dds"] }, "image/vnd.ms-modi": { source: "iana", extensions: ["mdi"] }, "image/vnd.ms-photo": { source: "apache", extensions: ["wdp"] }, "image/vnd.net-fpx": { source: "iana", extensions: ["npx"] }, "image/vnd.pco.b16": { source: "iana", extensions: ["b16"] }, "image/vnd.radiance": { source: "iana" }, "image/vnd.sealed.png": { source: "iana" }, "image/vnd.sealedmedia.softseal.gif": { source: "iana" }, "image/vnd.sealedmedia.softseal.jpg": { source: "iana" }, "image/vnd.svf": { source: "iana" }, "image/vnd.tencent.tap": { source: "iana", extensions: ["tap"] }, "image/vnd.valve.source.texture": { source: "iana", extensions: ["vtf"] }, "image/vnd.wap.wbmp": { source: "iana", extensions: ["wbmp"] }, "image/vnd.xiff": { source: "iana", extensions: ["xif"] }, "image/vnd.zbrush.pcx": { source: "iana", extensions: ["pcx"] }, "image/webp": { source: "apache", extensions: ["webp"] }, "image/wmf": { source: "iana", extensions: ["wmf"] }, "image/x-3ds": { source: "apache", extensions: ["3ds"] }, "image/x-cmu-raster": { source: "apache", extensions: ["ras"] }, "image/x-cmx": { source: "apache", extensions: ["cmx"] }, "image/x-freehand": { source: "apache", extensions: ["fh", "fhc", "fh4", "fh5", "fh7"] }, "image/x-icon": { source: "apache", compressible: true, extensions: ["ico"] }, "image/x-jng": { source: "nginx", extensions: ["jng"] }, "image/x-mrsid-image": { source: "apache", extensions: ["sid"] }, "image/x-ms-bmp": { source: "nginx", compressible: true, extensions: ["bmp"] }, "image/x-pcx": { source: "apache", extensions: ["pcx"] }, "image/x-pict": { source: "apache", extensions: ["pic", "pct"] }, "image/x-portable-anymap": { source: "apache", extensions: ["pnm"] }, "image/x-portable-bitmap": { source: "apache", extensions: ["pbm"] }, "image/x-portable-graymap": { source: "apache", extensions: ["pgm"] }, "image/x-portable-pixmap": { source: "apache", extensions: ["ppm"] }, "image/x-rgb": { source: "apache", extensions: ["rgb"] }, "image/x-tga": { source: "apache", extensions: ["tga"] }, "image/x-xbitmap": { source: "apache", extensions: ["xbm"] }, "image/x-xcf": { compressible: false }, "image/x-xpixmap": { source: "apache", extensions: ["xpm"] }, "image/x-xwindowdump": { source: "apache", extensions: ["xwd"] }, "message/cpim": { source: "iana" }, "message/delivery-status": { source: "iana" }, "message/disposition-notification": { source: "iana", extensions: ["disposition-notification"] }, "message/external-body": { source: "iana" }, "message/feedback-report": { source: "iana" }, "message/global": { source: "iana", extensions: ["u8msg"] }, "message/global-delivery-status": { source: "iana", extensions: ["u8dsn"] }, "message/global-disposition-notification": { source: "iana", extensions: ["u8mdn"] }, "message/global-headers": { source: "iana", extensions: ["u8hdr"] }, "message/http": { source: "iana", compressible: false }, "message/imdn+xml": { source: "iana", compressible: true }, "message/news": { source: "iana" }, "message/partial": { source: "iana", compressible: false }, "message/rfc822": { source: "iana", compressible: true, extensions: ["eml", "mime"] }, "message/s-http": { source: "iana" }, "message/sip": { source: "iana" }, "message/sipfrag": { source: "iana" }, "message/tracking-status": { source: "iana" }, "message/vnd.si.simp": { source: "iana" }, "message/vnd.wfa.wsc": { source: "iana", extensions: ["wsc"] }, "model/3mf": { source: "iana", extensions: ["3mf"] }, "model/e57": { source: "iana" }, "model/gltf+json": { source: "iana", compressible: true, extensions: ["gltf"] }, "model/gltf-binary": { source: "iana", compressible: true, extensions: ["glb"] }, "model/iges": { source: "iana", compressible: false, extensions: ["igs", "iges"] }, "model/mesh": { source: "iana", compressible: false, extensions: ["msh", "mesh", "silo"] }, "model/mtl": { source: "iana", extensions: ["mtl"] }, "model/obj": { source: "iana", extensions: ["obj"] }, "model/step": { source: "iana" }, "model/step+xml": { source: "iana", compressible: true, extensions: ["stpx"] }, "model/step+zip": { source: "iana", compressible: false, extensions: ["stpz"] }, "model/step-xml+zip": { source: "iana", compressible: false, extensions: ["stpxz"] }, "model/stl": { source: "iana", extensions: ["stl"] }, "model/vnd.collada+xml": { source: "iana", compressible: true, extensions: ["dae"] }, "model/vnd.dwf": { source: "iana", extensions: ["dwf"] }, "model/vnd.flatland.3dml": { source: "iana" }, "model/vnd.gdl": { source: "iana", extensions: ["gdl"] }, "model/vnd.gs-gdl": { source: "apache" }, "model/vnd.gs.gdl": { source: "iana" }, "model/vnd.gtw": { source: "iana", extensions: ["gtw"] }, "model/vnd.moml+xml": { source: "iana", compressible: true }, "model/vnd.mts": { source: "iana", extensions: ["mts"] }, "model/vnd.opengex": { source: "iana", extensions: ["ogex"] }, "model/vnd.parasolid.transmit.binary": { source: "iana", extensions: ["x_b"] }, "model/vnd.parasolid.transmit.text": { source: "iana", extensions: ["x_t"] }, "model/vnd.pytha.pyox": { source: "iana" }, "model/vnd.rosette.annotated-data-model": { source: "iana" }, "model/vnd.sap.vds": { source: "iana", extensions: ["vds"] }, "model/vnd.usdz+zip": { source: "iana", compressible: false, extensions: ["usdz"] }, "model/vnd.valve.source.compiled-map": { source: "iana", extensions: ["bsp"] }, "model/vnd.vtu": { source: "iana", extensions: ["vtu"] }, "model/vrml": { source: "iana", compressible: false, extensions: ["wrl", "vrml"] }, "model/x3d+binary": { source: "apache", compressible: false, extensions: ["x3db", "x3dbz"] }, "model/x3d+fastinfoset": { source: "iana", extensions: ["x3db"] }, "model/x3d+vrml": { source: "apache", compressible: false, extensions: ["x3dv", "x3dvz"] }, "model/x3d+xml": { source: "iana", compressible: true, extensions: ["x3d", "x3dz"] }, "model/x3d-vrml": { source: "iana", extensions: ["x3dv"] }, "multipart/alternative": { source: "iana", compressible: false }, "multipart/appledouble": { source: "iana" }, "multipart/byteranges": { source: "iana" }, "multipart/digest": { source: "iana" }, "multipart/encrypted": { source: "iana", compressible: false }, "multipart/form-data": { source: "iana", compressible: false }, "multipart/header-set": { source: "iana" }, "multipart/mixed": { source: "iana" }, "multipart/multilingual": { source: "iana" }, "multipart/parallel": { source: "iana" }, "multipart/related": { source: "iana", compressible: false }, "multipart/report": { source: "iana" }, "multipart/signed": { source: "iana", compressible: false }, "multipart/vnd.bint.med-plus": { source: "iana" }, "multipart/voice-message": { source: "iana" }, "multipart/x-mixed-replace": { source: "iana" }, "text/1d-interleaved-parityfec": { source: "iana" }, "text/cache-manifest": { source: "iana", compressible: true, extensions: ["appcache", "manifest"] }, "text/calendar": { source: "iana", extensions: ["ics", "ifb"] }, "text/calender": { compressible: true }, "text/cmd": { compressible: true }, "text/coffeescript": { extensions: ["coffee", "litcoffee"] }, "text/cql": { source: "iana" }, "text/cql-expression": { source: "iana" }, "text/cql-identifier": { source: "iana" }, "text/css": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["css"] }, "text/csv": { source: "iana", compressible: true, extensions: ["csv"] }, "text/csv-schema": { source: "iana" }, "text/directory": { source: "iana" }, "text/dns": { source: "iana" }, "text/ecmascript": { source: "iana" }, "text/encaprtp": { source: "iana" }, "text/enriched": { source: "iana" }, "text/fhirpath": { source: "iana" }, "text/flexfec": { source: "iana" }, "text/fwdred": { source: "iana" }, "text/gff3": { source: "iana" }, "text/grammar-ref-list": { source: "iana" }, "text/html": { source: "iana", compressible: true, extensions: ["html", "htm", "shtml"] }, "text/jade": { extensions: ["jade"] }, "text/javascript": { source: "iana", compressible: true }, "text/jcr-cnd": { source: "iana" }, "text/jsx": { compressible: true, extensions: ["jsx"] }, "text/less": { compressible: true, extensions: ["less"] }, "text/markdown": { source: "iana", compressible: true, extensions: ["markdown", "md"] }, "text/mathml": { source: "nginx", extensions: ["mml"] }, "text/mdx": { compressible: true, extensions: ["mdx"] }, "text/mizar": { source: "iana" }, "text/n3": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["n3"] }, "text/parameters": { source: "iana", charset: "UTF-8" }, "text/parityfec": { source: "iana" }, "text/plain": { source: "iana", compressible: true, extensions: ["txt", "text", "conf", "def", "list", "log", "in", "ini"] }, "text/provenance-notation": { source: "iana", charset: "UTF-8" }, "text/prs.fallenstein.rst": { source: "iana" }, "text/prs.lines.tag": { source: "iana", extensions: ["dsc"] }, "text/prs.prop.logic": { source: "iana" }, "text/raptorfec": { source: "iana" }, "text/red": { source: "iana" }, "text/rfc822-headers": { source: "iana" }, "text/richtext": { source: "iana", compressible: true, extensions: ["rtx"] }, "text/rtf": { source: "iana", compressible: true, extensions: ["rtf"] }, "text/rtp-enc-aescm128": { source: "iana" }, "text/rtploopback": { source: "iana" }, "text/rtx": { source: "iana" }, "text/sgml": { source: "iana", extensions: ["sgml", "sgm"] }, "text/shaclc": { source: "iana" }, "text/shex": { source: "iana", extensions: ["shex"] }, "text/slim": { extensions: ["slim", "slm"] }, "text/spdx": { source: "iana", extensions: ["spdx"] }, "text/strings": { source: "iana" }, "text/stylus": { extensions: ["stylus", "styl"] }, "text/t140": { source: "iana" }, "text/tab-separated-values": { source: "iana", compressible: true, extensions: ["tsv"] }, "text/troff": { source: "iana", extensions: ["t", "tr", "roff", "man", "me", "ms"] }, "text/turtle": { source: "iana", charset: "UTF-8", extensions: ["ttl"] }, "text/ulpfec": { source: "iana" }, "text/uri-list": { source: "iana", compressible: true, extensions: ["uri", "uris", "urls"] }, "text/vcard": { source: "iana", compressible: true, extensions: ["vcard"] }, "text/vnd.a": { source: "iana" }, "text/vnd.abc": { source: "iana" }, "text/vnd.ascii-art": { source: "iana" }, "text/vnd.curl": { source: "iana", extensions: ["curl"] }, "text/vnd.curl.dcurl": { source: "apache", extensions: ["dcurl"] }, "text/vnd.curl.mcurl": { source: "apache", extensions: ["mcurl"] }, "text/vnd.curl.scurl": { source: "apache", extensions: ["scurl"] }, "text/vnd.debian.copyright": { source: "iana", charset: "UTF-8" }, "text/vnd.dmclientscript": { source: "iana" }, "text/vnd.dvb.subtitle": { source: "iana", extensions: ["sub"] }, "text/vnd.esmertec.theme-descriptor": { source: "iana", charset: "UTF-8" }, "text/vnd.familysearch.gedcom": { source: "iana", extensions: ["ged"] }, "text/vnd.ficlab.flt": { source: "iana" }, "text/vnd.fly": { source: "iana", extensions: ["fly"] }, "text/vnd.fmi.flexstor": { source: "iana", extensions: ["flx"] }, "text/vnd.gml": { source: "iana" }, "text/vnd.graphviz": { source: "iana", extensions: ["gv"] }, "text/vnd.hans": { source: "iana" }, "text/vnd.hgl": { source: "iana" }, "text/vnd.in3d.3dml": { source: "iana", extensions: ["3dml"] }, "text/vnd.in3d.spot": { source: "iana", extensions: ["spot"] }, "text/vnd.iptc.newsml": { source: "iana" }, "text/vnd.iptc.nitf": { source: "iana" }, "text/vnd.latex-z": { source: "iana" }, "text/vnd.motorola.reflex": { source: "iana" }, "text/vnd.ms-mediapackage": { source: "iana" }, "text/vnd.net2phone.commcenter.command": { source: "iana" }, "text/vnd.radisys.msml-basic-layout": { source: "iana" }, "text/vnd.senx.warpscript": { source: "iana" }, "text/vnd.si.uricatalogue": { source: "iana" }, "text/vnd.sosi": { source: "iana" }, "text/vnd.sun.j2me.app-descriptor": { source: "iana", charset: "UTF-8", extensions: ["jad"] }, "text/vnd.trolltech.linguist": { source: "iana", charset: "UTF-8" }, "text/vnd.wap.si": { source: "iana" }, "text/vnd.wap.sl": { source: "iana" }, "text/vnd.wap.wml": { source: "iana", extensions: ["wml"] }, "text/vnd.wap.wmlscript": { source: "iana", extensions: ["wmls"] }, "text/vtt": { source: "iana", charset: "UTF-8", compressible: true, extensions: ["vtt"] }, "text/x-asm": { source: "apache", extensions: ["s", "asm"] }, "text/x-c": { source: "apache", extensions: ["c", "cc", "cxx", "cpp", "h", "hh", "dic"] }, "text/x-component": { source: "nginx", extensions: ["htc"] }, "text/x-fortran": { source: "apache", extensions: ["f", "for", "f77", "f90"] }, "text/x-gwt-rpc": { compressible: true }, "text/x-handlebars-template": { extensions: ["hbs"] }, "text/x-java-source": { source: "apache", extensions: ["java"] }, "text/x-jquery-tmpl": { compressible: true }, "text/x-lua": { extensions: ["lua"] }, "text/x-markdown": { compressible: true, extensions: ["mkd"] }, "text/x-nfo": { source: "apache", extensions: ["nfo"] }, "text/x-opml": { source: "apache", extensions: ["opml"] }, "text/x-org": { compressible: true, extensions: ["org"] }, "text/x-pascal": { source: "apache", extensions: ["p", "pas"] }, "text/x-processing": { compressible: true, extensions: ["pde"] }, "text/x-sass": { extensions: ["sass"] }, "text/x-scss": { extensions: ["scss"] }, "text/x-setext": { source: "apache", extensions: ["etx"] }, "text/x-sfv": { source: "apache", extensions: ["sfv"] }, "text/x-suse-ymp": { compressible: true, extensions: ["ymp"] }, "text/x-uuencode": { source: "apache", extensions: ["uu"] }, "text/x-vcalendar": { source: "apache", extensions: ["vcs"] }, "text/x-vcard": { source: "apache", extensions: ["vcf"] }, "text/xml": { source: "iana", compressible: true, extensions: ["xml"] }, "text/xml-external-parsed-entity": { source: "iana" }, "text/yaml": { compressible: true, extensions: ["yaml", "yml"] }, "video/1d-interleaved-parityfec": { source: "iana" }, "video/3gpp": { source: "iana", extensions: ["3gp", "3gpp"] }, "video/3gpp-tt": { source: "iana" }, "video/3gpp2": { source: "iana", extensions: ["3g2"] }, "video/av1": { source: "iana" }, "video/bmpeg": { source: "iana" }, "video/bt656": { source: "iana" }, "video/celb": { source: "iana" }, "video/dv": { source: "iana" }, "video/encaprtp": { source: "iana" }, "video/ffv1": { source: "iana" }, "video/flexfec": { source: "iana" }, "video/h261": { source: "iana", extensions: ["h261"] }, "video/h263": { source: "iana", extensions: ["h263"] }, "video/h263-1998": { source: "iana" }, "video/h263-2000": { source: "iana" }, "video/h264": { source: "iana", extensions: ["h264"] }, "video/h264-rcdo": { source: "iana" }, "video/h264-svc": { source: "iana" }, "video/h265": { source: "iana" }, "video/iso.segment": { source: "iana", extensions: ["m4s"] }, "video/jpeg": { source: "iana", extensions: ["jpgv"] }, "video/jpeg2000": { source: "iana" }, "video/jpm": { source: "apache", extensions: ["jpm", "jpgm"] }, "video/jxsv": { source: "iana" }, "video/mj2": { source: "iana", extensions: ["mj2", "mjp2"] }, "video/mp1s": { source: "iana" }, "video/mp2p": { source: "iana" }, "video/mp2t": { source: "iana", extensions: ["ts"] }, "video/mp4": { source: "iana", compressible: false, extensions: ["mp4", "mp4v", "mpg4"] }, "video/mp4v-es": { source: "iana" }, "video/mpeg": { source: "iana", compressible: false, extensions: ["mpeg", "mpg", "mpe", "m1v", "m2v"] }, "video/mpeg4-generic": { source: "iana" }, "video/mpv": { source: "iana" }, "video/nv": { source: "iana" }, "video/ogg": { source: "iana", compressible: false, extensions: ["ogv"] }, "video/parityfec": { source: "iana" }, "video/pointer": { source: "iana" }, "video/quicktime": { source: "iana", compressible: false, extensions: ["qt", "mov"] }, "video/raptorfec": { source: "iana" }, "video/raw": { source: "iana" }, "video/rtp-enc-aescm128": { source: "iana" }, "video/rtploopback": { source: "iana" }, "video/rtx": { source: "iana" }, "video/scip": { source: "iana" }, "video/smpte291": { source: "iana" }, "video/smpte292m": { source: "iana" }, "video/ulpfec": { source: "iana" }, "video/vc1": { source: "iana" }, "video/vc2": { source: "iana" }, "video/vnd.cctv": { source: "iana" }, "video/vnd.dece.hd": { source: "iana", extensions: ["uvh", "uvvh"] }, "video/vnd.dece.mobile": { source: "iana", extensions: ["uvm", "uvvm"] }, "video/vnd.dece.mp4": { source: "iana" }, "video/vnd.dece.pd": { source: "iana", extensions: ["uvp", "uvvp"] }, "video/vnd.dece.sd": { source: "iana", extensions: ["uvs", "uvvs"] }, "video/vnd.dece.video": { source: "iana", extensions: ["uvv", "uvvv"] }, "video/vnd.directv.mpeg": { source: "iana" }, "video/vnd.directv.mpeg-tts": { source: "iana" }, "video/vnd.dlna.mpeg-tts": { source: "iana" }, "video/vnd.dvb.file": { source: "iana", extensions: ["dvb"] }, "video/vnd.fvt": { source: "iana", extensions: ["fvt"] }, "video/vnd.hns.video": { source: "iana" }, "video/vnd.iptvforum.1dparityfec-1010": { source: "iana" }, "video/vnd.iptvforum.1dparityfec-2005": { source: "iana" }, "video/vnd.iptvforum.2dparityfec-1010": { source: "iana" }, "video/vnd.iptvforum.2dparityfec-2005": { source: "iana" }, "video/vnd.iptvforum.ttsavc": { source: "iana" }, "video/vnd.iptvforum.ttsmpeg2": { source: "iana" }, "video/vnd.motorola.video": { source: "iana" }, "video/vnd.motorola.videop": { source: "iana" }, "video/vnd.mpegurl": { source: "iana", extensions: ["mxu", "m4u"] }, "video/vnd.ms-playready.media.pyv": { source: "iana", extensions: ["pyv"] }, "video/vnd.nokia.interleaved-multimedia": { source: "iana" }, "video/vnd.nokia.mp4vr": { source: "iana" }, "video/vnd.nokia.videovoip": { source: "iana" }, "video/vnd.objectvideo": { source: "iana" }, "video/vnd.radgamettools.bink": { source: "iana" }, "video/vnd.radgamettools.smacker": { source: "iana" }, "video/vnd.sealed.mpeg1": { source: "iana" }, "video/vnd.sealed.mpeg4": { source: "iana" }, "video/vnd.sealed.swf": { source: "iana" }, "video/vnd.sealedmedia.softseal.mov": { source: "iana" }, "video/vnd.uvvu.mp4": { source: "iana", extensions: ["uvu", "uvvu"] }, "video/vnd.vivo": { source: "iana", extensions: ["viv"] }, "video/vnd.youtube.yt": { source: "iana" }, "video/vp8": { source: "iana" }, "video/vp9": { source: "iana" }, "video/webm": { source: "apache", compressible: false, extensions: ["webm"] }, "video/x-f4v": { source: "apache", extensions: ["f4v"] }, "video/x-fli": { source: "apache", extensions: ["fli"] }, "video/x-flv": { source: "apache", compressible: false, extensions: ["flv"] }, "video/x-m4v": { source: "apache", extensions: ["m4v"] }, "video/x-matroska": { source: "apache", compressible: false, extensions: ["mkv", "mk3d", "mks"] }, "video/x-mng": { source: "apache", extensions: ["mng"] }, "video/x-ms-asf": { source: "apache", extensions: ["asf", "asx"] }, "video/x-ms-vob": { source: "apache", extensions: ["vob"] }, "video/x-ms-wm": { source: "apache", extensions: ["wm"] }, "video/x-ms-wmv": { source: "apache", compressible: false, extensions: ["wmv"] }, "video/x-ms-wmx": { source: "apache", extensions: ["wmx"] }, "video/x-ms-wvx": { source: "apache", extensions: ["wvx"] }, "video/x-msvideo": { source: "apache", extensions: ["avi"] }, "video/x-sgi-movie": { source: "apache", extensions: ["movie"] }, "video/x-smv": { source: "apache", extensions: ["smv"] }, "x-conference/x-cooltalk": { source: "apache", extensions: ["ice"] }, "x-shader/x-fragment": { compressible: true }, "x-shader/x-vertex": { compressible: true } };
|
|
17545
18319
|
});
|
|
17546
18320
|
var O0 = v(function(Nre) {
|
|
18321
|
+
/*!
|
|
18322
|
+
* mime-types
|
|
18323
|
+
* Copyright(c) 2014 Jonathan Ong
|
|
18324
|
+
* Copyright(c) 2015 Douglas Christopher Wilson
|
|
18325
|
+
* MIT Licensed
|
|
18326
|
+
*/
|
|
17547
18327
|
var dh = E0(), Cre = be("path").extname, w0 = /^\s*([^;\s]*)(?:;|\s|$)/, Rre = /^text\//i;
|
|
17548
18328
|
Nre.charset = T0;
|
|
17549
18329
|
Nre.charsets = { lookup: T0 };
|
|
@@ -20857,8 +21637,8 @@ var qU = v(function(BU) {
|
|
|
20857
21637
|
BU._globalThis = void 0;
|
|
20858
21638
|
BU._globalThis = typeof globalThis === "object" ? globalThis : global;
|
|
20859
21639
|
});
|
|
20860
|
-
var GU = v(function(
|
|
20861
|
-
var Axe =
|
|
21640
|
+
var GU = v(function(os8) {
|
|
21641
|
+
var Axe = os8 && os8.__createBinding || (Object.create ? function(e, t, r, n) {
|
|
20862
21642
|
if (n === void 0) n = r;
|
|
20863
21643
|
Object.defineProperty(e, n, { enumerable: true, get: function() {
|
|
20864
21644
|
return t[r];
|
|
@@ -20866,11 +21646,11 @@ var GU = v(function(os7) {
|
|
|
20866
21646
|
} : function(e, t, r, n) {
|
|
20867
21647
|
if (n === void 0) n = r;
|
|
20868
21648
|
e[n] = t[r];
|
|
20869
|
-
}), kxe =
|
|
21649
|
+
}), kxe = os8 && os8.__exportStar || function(e, t) {
|
|
20870
21650
|
for (var r in e) if (r !== "default" && !Object.prototype.hasOwnProperty.call(t, r)) Axe(t, e, r);
|
|
20871
21651
|
};
|
|
20872
|
-
Object.defineProperty(
|
|
20873
|
-
kxe(qU(),
|
|
21652
|
+
Object.defineProperty(os8, "__esModule", { value: true });
|
|
21653
|
+
kxe(qU(), os8);
|
|
20874
21654
|
});
|
|
20875
21655
|
var WU = v(function(is) {
|
|
20876
21656
|
var Oxe = is && is.__createBinding || (Object.create ? function(e, t, r, n) {
|
|
@@ -42832,14 +43612,70 @@ var ClaudeBackgroundOccupancy = class {
|
|
|
42832
43612
|
}
|
|
42833
43613
|
};
|
|
42834
43614
|
|
|
43615
|
+
// ../../harness-adapter/dist/session-import.js
|
|
43616
|
+
var SessionImportScope = class {
|
|
43617
|
+
#abort = new AbortController();
|
|
43618
|
+
#options;
|
|
43619
|
+
#pending = /* @__PURE__ */ new Set();
|
|
43620
|
+
constructor(options) {
|
|
43621
|
+
this.#options = options;
|
|
43622
|
+
}
|
|
43623
|
+
#closed() {
|
|
43624
|
+
return {
|
|
43625
|
+
ok: false,
|
|
43626
|
+
error: { code: "invalidState", message: this.#options.closedMessage, retryable: false }
|
|
43627
|
+
};
|
|
43628
|
+
}
|
|
43629
|
+
read(operation) {
|
|
43630
|
+
const signal = this.#abort.signal;
|
|
43631
|
+
if (signal.aborted)
|
|
43632
|
+
return Promise.resolve(this.#closed());
|
|
43633
|
+
let started;
|
|
43634
|
+
try {
|
|
43635
|
+
started = operation(signal);
|
|
43636
|
+
} catch (error52) {
|
|
43637
|
+
started = Promise.reject(error52 instanceof Error ? error52 : new Error("Session read failed"));
|
|
43638
|
+
}
|
|
43639
|
+
const request = started.then((value) => signal.aborted ? this.#closed() : { ok: true, value }).catch(() => signal.aborted ? this.#closed() : {
|
|
43640
|
+
ok: false,
|
|
43641
|
+
error: {
|
|
43642
|
+
code: "unavailable",
|
|
43643
|
+
message: this.#options.unavailableMessage,
|
|
43644
|
+
retryable: true
|
|
43645
|
+
}
|
|
43646
|
+
}).finally(() => this.#pending.delete(request));
|
|
43647
|
+
this.#pending.add(request);
|
|
43648
|
+
return request;
|
|
43649
|
+
}
|
|
43650
|
+
/** `read` for `resolveCandidate`: a null source is the selected Session having disappeared. */
|
|
43651
|
+
async resolve(operation) {
|
|
43652
|
+
const result = await this.read(operation);
|
|
43653
|
+
if (!result.ok)
|
|
43654
|
+
return result;
|
|
43655
|
+
return result.value ? { ok: true, value: result.value } : {
|
|
43656
|
+
ok: false,
|
|
43657
|
+
error: {
|
|
43658
|
+
code: "sessionNotFound",
|
|
43659
|
+
message: this.#options.notFoundMessage,
|
|
43660
|
+
retryable: false
|
|
43661
|
+
}
|
|
43662
|
+
};
|
|
43663
|
+
}
|
|
43664
|
+
/** Idempotent. Resolves after every started read has settled. */
|
|
43665
|
+
async close() {
|
|
43666
|
+
this.#abort.abort();
|
|
43667
|
+
await Promise.allSettled(this.#pending);
|
|
43668
|
+
}
|
|
43669
|
+
};
|
|
43670
|
+
|
|
42835
43671
|
// dist/command.js
|
|
42836
|
-
import
|
|
43672
|
+
import path8 from "node:path";
|
|
42837
43673
|
|
|
42838
43674
|
// ../../harness-discovery/dist/environment.js
|
|
42839
43675
|
import fs from "node:fs";
|
|
42840
|
-
import
|
|
43676
|
+
import path4 from "node:path";
|
|
42841
43677
|
function targetPath(platform) {
|
|
42842
|
-
return platform === "win32" ?
|
|
43678
|
+
return platform === "win32" ? path4.win32 : path4.posix;
|
|
42843
43679
|
}
|
|
42844
43680
|
function environmentValue(environment, name) {
|
|
42845
43681
|
const lowered = name.toLowerCase();
|
|
@@ -42882,9 +43718,9 @@ function newestFirst(names) {
|
|
|
42882
43718
|
}
|
|
42883
43719
|
|
|
42884
43720
|
// ../../harness-discovery/dist/invocation.js
|
|
42885
|
-
import
|
|
43721
|
+
import path5 from "node:path";
|
|
42886
43722
|
function commandInvocation(command, arguments_, environment, platform = process.platform) {
|
|
42887
|
-
const extension =
|
|
43723
|
+
const extension = path5.win32.extname(command).toLowerCase();
|
|
42888
43724
|
if (platform !== "win32" || ![".cmd", ".bat"].includes(extension)) {
|
|
42889
43725
|
return { command, arguments: [...arguments_], windowsVerbatimArguments: false };
|
|
42890
43726
|
}
|
|
@@ -42898,11 +43734,11 @@ function commandInvocation(command, arguments_, environment, platform = process.
|
|
|
42898
43734
|
}
|
|
42899
43735
|
|
|
42900
43736
|
// ../../harness-discovery/dist/node-runtime.js
|
|
42901
|
-
import
|
|
43737
|
+
import path6 from "node:path";
|
|
42902
43738
|
function withNodeRuntimeOnPath(environment, runtimeExecutable = process.execPath, platform = process.platform) {
|
|
42903
43739
|
const pathKey = Object.keys(environment).find((name) => name.toLowerCase() === "path") ?? "PATH";
|
|
42904
43740
|
const delimiter = platform === "win32" ? ";" : ":";
|
|
42905
|
-
const runtimeDirectory =
|
|
43741
|
+
const runtimeDirectory = path6.dirname(runtimeExecutable);
|
|
42906
43742
|
const directories = (environment[pathKey] ?? "").split(delimiter).filter(Boolean);
|
|
42907
43743
|
const equal = platform === "win32" ? (value) => value.toLowerCase() : (value) => value;
|
|
42908
43744
|
if (!directories.some((directory) => equal(directory) === equal(runtimeDirectory))) {
|
|
@@ -42912,7 +43748,7 @@ function withNodeRuntimeOnPath(environment, runtimeExecutable = process.execPath
|
|
|
42912
43748
|
}
|
|
42913
43749
|
|
|
42914
43750
|
// ../../harness-discovery/dist/resolve.js
|
|
42915
|
-
import
|
|
43751
|
+
import os3 from "node:os";
|
|
42916
43752
|
|
|
42917
43753
|
// ../../harness-discovery/dist/version-managers.js
|
|
42918
43754
|
function versionManagerBinaryDirectories(context) {
|
|
@@ -42978,7 +43814,7 @@ function installRootExtensions(platform) {
|
|
|
42978
43814
|
return platform === "win32" ? [".exe", ".cmd"] : [""];
|
|
42979
43815
|
}
|
|
42980
43816
|
function resolveHomeDirectory(input) {
|
|
42981
|
-
return input.homeDirectory ?? environmentValue(input.environment, "HOME") ?? environmentValue(input.environment, "USERPROFILE") ??
|
|
43817
|
+
return input.homeDirectory ?? environmentValue(input.environment, "HOME") ?? environmentValue(input.environment, "USERPROFILE") ?? os3.homedir();
|
|
42982
43818
|
}
|
|
42983
43819
|
function templateVariables(environment, platform, home) {
|
|
42984
43820
|
const pathFlavor = targetPath(platform);
|
|
@@ -43075,13 +43911,13 @@ function resolveHarnessExecutable(spec, input, dependencies = {}) {
|
|
|
43075
43911
|
}
|
|
43076
43912
|
|
|
43077
43913
|
// ../../harness-discovery/dist/installation.js
|
|
43078
|
-
import { execFile } from "node:child_process";
|
|
43914
|
+
import { execFile as execFile2 } from "node:child_process";
|
|
43079
43915
|
import { homedir } from "node:os";
|
|
43080
43916
|
function runInstallationCommand(command, args, environment, timeout = 3e4) {
|
|
43081
43917
|
const env = withNodeRuntimeOnPath(environment);
|
|
43082
43918
|
const invocation = /\.[cm]?js$/i.test(command) ? commandInvocation(process.execPath, [command, ...args], env) : commandInvocation(command, args, env);
|
|
43083
43919
|
return new Promise((resolve2, reject) => {
|
|
43084
|
-
const child =
|
|
43920
|
+
const child = execFile2(invocation.command, invocation.arguments, {
|
|
43085
43921
|
env,
|
|
43086
43922
|
cwd: env.HOME ?? env.USERPROFILE ?? homedir(),
|
|
43087
43923
|
encoding: "utf8",
|
|
@@ -43186,58 +44022,58 @@ async function fetchInstallationText(url2) {
|
|
|
43186
44022
|
|
|
43187
44023
|
// ../../harness-discovery/dist/npm-installation.js
|
|
43188
44024
|
import { readFile as readFile2, realpath } from "node:fs/promises";
|
|
43189
|
-
import
|
|
44025
|
+
import path7 from "node:path";
|
|
43190
44026
|
function referencesNpmBin(shim, name, bin) {
|
|
43191
44027
|
if (bin.includes(".."))
|
|
43192
44028
|
return false;
|
|
43193
44029
|
const target = `node_modules/${name}/${bin.replace(/^\.\//, "")}`.toLowerCase();
|
|
43194
|
-
const
|
|
43195
|
-
return
|
|
44030
|
+
const text2 = shim.replaceAll("\\", "/").toLowerCase();
|
|
44031
|
+
return text2.includes(`%dp0%/${target}"`) || text2.includes(`%~dp0/${target}"`);
|
|
43196
44032
|
}
|
|
43197
44033
|
async function npmInstallation(command, packages, environment) {
|
|
43198
44034
|
let selected = await realpath(command);
|
|
43199
44035
|
if (process.platform === "win32" && /\.(cmd|bat)$/i.test(selected)) {
|
|
43200
44036
|
const shim = (await readFile2(selected, "utf8")).replaceAll("\\", "/");
|
|
43201
|
-
const root =
|
|
44037
|
+
const root = path7.dirname(selected);
|
|
43202
44038
|
for (const name of packages) {
|
|
43203
|
-
const directory2 =
|
|
43204
|
-
const metadata = await readFile2(
|
|
44039
|
+
const directory2 = path7.join(root, "node_modules", ...name.split("/"));
|
|
44040
|
+
const metadata = await readFile2(path7.join(directory2, "package.json"), "utf8").then((text2) => JSON.parse(text2)).catch(() => null);
|
|
43205
44041
|
const bins = typeof metadata?.bin === "string" ? [metadata.bin] : Object.values(metadata?.bin ?? {});
|
|
43206
44042
|
const bin = bins.find((entry) => referencesNpmBin(shim, name, entry));
|
|
43207
44043
|
if (bin) {
|
|
43208
|
-
selected = await realpath(
|
|
44044
|
+
selected = await realpath(path7.join(directory2, bin));
|
|
43209
44045
|
break;
|
|
43210
44046
|
}
|
|
43211
44047
|
}
|
|
43212
44048
|
}
|
|
43213
|
-
let directory =
|
|
44049
|
+
let directory = path7.dirname(selected);
|
|
43214
44050
|
for (let depth = 0; depth < 8; depth++) {
|
|
43215
|
-
const metadata = await readFile2(
|
|
44051
|
+
const metadata = await readFile2(path7.join(directory, "package.json"), "utf8").then((text2) => JSON.parse(text2)).catch(() => null);
|
|
43216
44052
|
if (metadata?.name && packages.includes(metadata.name)) {
|
|
43217
44053
|
const name = metadata.name;
|
|
43218
44054
|
const currentVersion = installationVersion(metadata.version);
|
|
43219
44055
|
const segments = name.split("/");
|
|
43220
44056
|
let modules = directory;
|
|
43221
44057
|
for (let index = 0; index < segments.length; index++)
|
|
43222
|
-
modules =
|
|
43223
|
-
const prefix = process.platform === "win32" ?
|
|
43224
|
-
const globalRoot = process.platform === "win32" ?
|
|
44058
|
+
modules = path7.dirname(modules);
|
|
44059
|
+
const prefix = process.platform === "win32" ? path7.dirname(modules) : path7.dirname(path7.dirname(modules));
|
|
44060
|
+
const globalRoot = process.platform === "win32" ? path7.join(prefix, "node_modules") : path7.join(prefix, "lib", "node_modules");
|
|
43225
44061
|
const env = withNodeRuntimeOnPath(environment);
|
|
43226
44062
|
const npm = resolveHarnessExecutable({ id: "npm", command: "npm", installRoots: { posix: [], windows: [] } }, { environment: env });
|
|
43227
44063
|
let globalInstall = modules === globalRoot;
|
|
43228
44064
|
if (process.platform === "win32") {
|
|
43229
|
-
const
|
|
44065
|
+
const project2 = (await Promise.all(["package.json", "package-lock.json", "npm-shrinkwrap.json"].map((file2) => readFile2(path7.join(prefix, file2), "utf8").then(() => true, (error52) => error52.code !== "ENOENT")))).some(Boolean);
|
|
43230
44066
|
const bins = typeof metadata.bin === "string" ? { [name.split("/").at(-1) ?? name]: metadata.bin } : metadata.bin ?? {};
|
|
43231
44067
|
const launchers = await Promise.all(Object.entries(bins).map(async ([bin, entry]) => {
|
|
43232
|
-
if (
|
|
44068
|
+
if (path7.basename(bin) !== bin || entry.includes(".."))
|
|
43233
44069
|
return false;
|
|
43234
|
-
const target = await realpath(
|
|
44070
|
+
const target = await realpath(path7.join(directory, entry)).catch(() => "");
|
|
43235
44071
|
if (target.toLowerCase() !== selected.toLowerCase())
|
|
43236
44072
|
return false;
|
|
43237
|
-
const shim = await readFile2(
|
|
44073
|
+
const shim = await readFile2(path7.join(prefix, `${bin}.cmd`), "utf8").catch(() => "");
|
|
43238
44074
|
return referencesNpmBin(shim, name, entry);
|
|
43239
44075
|
}));
|
|
43240
|
-
globalInstall = globalInstall && !
|
|
44076
|
+
globalInstall = globalInstall && !project2 && launchers.some(Boolean);
|
|
43241
44077
|
}
|
|
43242
44078
|
const canUpdate = globalInstall && !!npm;
|
|
43243
44079
|
return {
|
|
@@ -43255,7 +44091,7 @@ async function npmInstallation(command, packages, environment) {
|
|
|
43255
44091
|
}
|
|
43256
44092
|
};
|
|
43257
44093
|
}
|
|
43258
|
-
const parent =
|
|
44094
|
+
const parent = path7.dirname(directory);
|
|
43259
44095
|
if (parent === directory)
|
|
43260
44096
|
break;
|
|
43261
44097
|
directory = parent;
|
|
@@ -43363,14 +44199,14 @@ function resolveClaudeCodeExecutable(input = {}, dependencies = {}) {
|
|
|
43363
44199
|
}, dependencies);
|
|
43364
44200
|
if (!resolution)
|
|
43365
44201
|
throw new ClaudeCodeExecutableError("Claude Code is not installed");
|
|
43366
|
-
return targetPath(platform).isAbsolute(resolution.executable) ? resolution.executable :
|
|
44202
|
+
return targetPath(platform).isAbsolute(resolution.executable) ? resolution.executable : path8.resolve(resolution.executable);
|
|
43367
44203
|
}
|
|
43368
44204
|
|
|
43369
44205
|
// dist/pending-session.js
|
|
43370
44206
|
import { randomUUID as randomUUID2 } from "node:crypto";
|
|
43371
44207
|
import { mkdir, open, readFile as readFile3, rename, rm as rm3, stat, unlink } from "node:fs/promises";
|
|
43372
|
-
import
|
|
43373
|
-
import
|
|
44208
|
+
import os4 from "node:os";
|
|
44209
|
+
import path9 from "node:path";
|
|
43374
44210
|
var reservationSchema = external_exports.strictObject({
|
|
43375
44211
|
version: external_exports.literal(1),
|
|
43376
44212
|
sessionId: external_exports.uuid(),
|
|
@@ -43383,13 +44219,13 @@ function isPendingClaudeSession(ref) {
|
|
|
43383
44219
|
var ClaudePendingSessions = class {
|
|
43384
44220
|
#directory;
|
|
43385
44221
|
constructor(environment) {
|
|
43386
|
-
this.#directory =
|
|
44222
|
+
this.#directory = path9.join(path9.resolve(environment.CLAUDE_CONFIG_DIR ?? path9.join(os4.homedir(), ".claude")), "codexhost", "pending-sessions");
|
|
43387
44223
|
}
|
|
43388
44224
|
#path(ref, cwd) {
|
|
43389
|
-
if (ref.harnessId !== "claude-code" || !external_exports.uuid().safeParse(ref.nativeSessionId).success || !external_exports.strictObject({ pendingSession: external_exports.literal(1) }).safeParse(ref.locator).success || !
|
|
44225
|
+
if (ref.harnessId !== "claude-code" || !external_exports.uuid().safeParse(ref.nativeSessionId).success || !external_exports.strictObject({ pendingSession: external_exports.literal(1) }).safeParse(ref.locator).success || !path9.isAbsolute(cwd)) {
|
|
43390
44226
|
throw new Error("Claude Code pending Session identity is invalid");
|
|
43391
44227
|
}
|
|
43392
|
-
return
|
|
44228
|
+
return path9.join(this.#directory, ref.nativeSessionId);
|
|
43393
44229
|
}
|
|
43394
44230
|
async create(cwd, configuration) {
|
|
43395
44231
|
const ref = nativeSessionRefSchema.parse({
|
|
@@ -43408,7 +44244,7 @@ var ClaudePendingSessions = class {
|
|
|
43408
44244
|
await mkdir(this.#directory, { recursive: true, mode: 448 });
|
|
43409
44245
|
await mkdir(directory, { mode: 448 });
|
|
43410
44246
|
try {
|
|
43411
|
-
const file2 = await open(
|
|
44247
|
+
const file2 = await open(path9.join(directory, "session.json"), "wx", 384);
|
|
43412
44248
|
try {
|
|
43413
44249
|
await file2.writeFile(JSON.stringify(reservation));
|
|
43414
44250
|
await file2.sync();
|
|
@@ -43425,13 +44261,13 @@ var ClaudePendingSessions = class {
|
|
|
43425
44261
|
}
|
|
43426
44262
|
async read(ref, cwd) {
|
|
43427
44263
|
const directory = this.#path(ref, cwd);
|
|
43428
|
-
const reservation = reservationSchema.parse(JSON.parse(await readFile3(
|
|
44264
|
+
const reservation = reservationSchema.parse(JSON.parse(await readFile3(path9.join(directory, "session.json"), "utf8")));
|
|
43429
44265
|
if (reservation.sessionId !== ref.nativeSessionId || reservation.cwd !== cwd) {
|
|
43430
44266
|
throw new Error("Claude Code pending Session does not belong to this working directory");
|
|
43431
44267
|
}
|
|
43432
44268
|
let started = false;
|
|
43433
44269
|
try {
|
|
43434
|
-
const claim = await stat(
|
|
44270
|
+
const claim = await stat(path9.join(directory, "started"));
|
|
43435
44271
|
if (!claim.isFile())
|
|
43436
44272
|
throw new Error("Claude Code pending Session claim is invalid");
|
|
43437
44273
|
started = true;
|
|
@@ -43444,7 +44280,7 @@ var ClaudePendingSessions = class {
|
|
|
43444
44280
|
async saveConfiguration(ref, cwd, configuration) {
|
|
43445
44281
|
await this.read(ref, cwd);
|
|
43446
44282
|
const directory = this.#path(ref, cwd);
|
|
43447
|
-
const temporary =
|
|
44283
|
+
const temporary = path9.join(directory, `${randomUUID2()}.tmp`);
|
|
43448
44284
|
try {
|
|
43449
44285
|
const file2 = await open(temporary, "wx", 384);
|
|
43450
44286
|
try {
|
|
@@ -43458,7 +44294,7 @@ var ClaudePendingSessions = class {
|
|
|
43458
44294
|
} finally {
|
|
43459
44295
|
await file2.close();
|
|
43460
44296
|
}
|
|
43461
|
-
await rename(temporary,
|
|
44297
|
+
await rename(temporary, path9.join(directory, "session.json"));
|
|
43462
44298
|
await this.#sync(directory);
|
|
43463
44299
|
} finally {
|
|
43464
44300
|
await rm3(temporary, { force: true });
|
|
@@ -43476,7 +44312,7 @@ var ClaudePendingSessions = class {
|
|
|
43476
44312
|
}
|
|
43477
44313
|
async claim(ref, cwd) {
|
|
43478
44314
|
await this.read(ref, cwd);
|
|
43479
|
-
const claim = await open(
|
|
44315
|
+
const claim = await open(path9.join(this.#path(ref, cwd), "started"), "wx", 384);
|
|
43480
44316
|
try {
|
|
43481
44317
|
await claim.sync();
|
|
43482
44318
|
} finally {
|
|
@@ -43486,7 +44322,7 @@ var ClaudePendingSessions = class {
|
|
|
43486
44322
|
}
|
|
43487
44323
|
/** Only the claim owner may release, after proven close and before submitting any native input. */
|
|
43488
44324
|
async release(ref, cwd) {
|
|
43489
|
-
await unlink(
|
|
44325
|
+
await unlink(path9.join(this.#path(ref, cwd), "started"));
|
|
43490
44326
|
await this.#sync(this.#path(ref, cwd));
|
|
43491
44327
|
}
|
|
43492
44328
|
async discard(ref, cwd) {
|
|
@@ -43495,11 +44331,11 @@ var ClaudePendingSessions = class {
|
|
|
43495
44331
|
};
|
|
43496
44332
|
|
|
43497
44333
|
// dist/claude-fork.js
|
|
43498
|
-
import
|
|
44334
|
+
import path11 from "node:path";
|
|
43499
44335
|
import { isDeepStrictEqual } from "node:util";
|
|
43500
44336
|
|
|
43501
44337
|
// dist/file-change.js
|
|
43502
|
-
import
|
|
44338
|
+
import path10 from "node:path";
|
|
43503
44339
|
var hunkSchema = external_exports.object({
|
|
43504
44340
|
oldStart: external_exports.number().int().nonnegative(),
|
|
43505
44341
|
oldLines: external_exports.number().int().nonnegative(),
|
|
@@ -43507,7 +44343,7 @@ var hunkSchema = external_exports.object({
|
|
|
43507
44343
|
newLines: external_exports.number().int().nonnegative(),
|
|
43508
44344
|
lines: external_exports.array(external_exports.string())
|
|
43509
44345
|
}).strict();
|
|
43510
|
-
function
|
|
44346
|
+
function isRecord4(value) {
|
|
43511
44347
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
43512
44348
|
}
|
|
43513
44349
|
function validNativePath(value) {
|
|
@@ -43531,7 +44367,7 @@ function validHunk(value) {
|
|
|
43531
44367
|
return hunk;
|
|
43532
44368
|
}
|
|
43533
44369
|
function parseClaudeNativeFileChange(toolName, value) {
|
|
43534
|
-
if (toolName !== "Edit" && toolName !== "Write" || !
|
|
44370
|
+
if (toolName !== "Edit" && toolName !== "Write" || !isRecord4(value))
|
|
43535
44371
|
return null;
|
|
43536
44372
|
if (!validNativePath(value.filePath) || !Array.isArray(value.structuredPatch))
|
|
43537
44373
|
return null;
|
|
@@ -43547,10 +44383,10 @@ function parseClaudeNativeFileChange(toolName, value) {
|
|
|
43547
44383
|
};
|
|
43548
44384
|
}
|
|
43549
44385
|
function displayPath(nativePath, cwd) {
|
|
43550
|
-
const resolvedCwd =
|
|
43551
|
-
const resolvedPath =
|
|
43552
|
-
const relative =
|
|
43553
|
-
const selected = relative.length > 0 && relative !== ".." && !relative.startsWith(`..${
|
|
44386
|
+
const resolvedCwd = path10.resolve(cwd);
|
|
44387
|
+
const resolvedPath = path10.isAbsolute(nativePath) ? path10.resolve(nativePath) : path10.resolve(cwd, nativePath);
|
|
44388
|
+
const relative = path10.relative(resolvedCwd, resolvedPath);
|
|
44389
|
+
const selected = relative.length > 0 && relative !== ".." && !relative.startsWith(`..${path10.sep}`) ? relative : resolvedPath;
|
|
43554
44390
|
const normalized = selected.replaceAll("\\", "/");
|
|
43555
44391
|
return validNativePath(normalized) && normalized !== "." ? normalized : null;
|
|
43556
44392
|
}
|
|
@@ -43562,7 +44398,7 @@ function projectClaudeFileChange(value, cwd) {
|
|
|
43562
44398
|
`@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`,
|
|
43563
44399
|
...hunk.lines
|
|
43564
44400
|
]);
|
|
43565
|
-
const absoluteDisplayPath =
|
|
44401
|
+
const absoluteDisplayPath = path10.posix.isAbsolute(normalizedPath);
|
|
43566
44402
|
const oldHeader = value.kind === "add" ? "/dev/null" : absoluteDisplayPath ? normalizedPath : `a/${normalizedPath}`;
|
|
43567
44403
|
const newHeader = absoluteDisplayPath ? normalizedPath : `b/${normalizedPath}`;
|
|
43568
44404
|
const unifiedDiff = [`--- ${oldHeader}`, `+++ ${newHeader}`, ...body, ""].join("\n");
|
|
@@ -43576,7 +44412,7 @@ var CLAUDE_SUBAGENT_TOOLS = /* @__PURE__ */ new Set(["Agent", "Task", "SendMessa
|
|
|
43576
44412
|
var BACKGROUND_OUTPUT_FILE_PATTERN = /Output is being written to: (.+?\.output)\./u;
|
|
43577
44413
|
var SUBAGENT_DESCRIPTION_LIMIT = 500;
|
|
43578
44414
|
var SUBAGENT_SUMMARY_LIMIT = 2e3;
|
|
43579
|
-
function
|
|
44415
|
+
function isRecord5(value) {
|
|
43580
44416
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
43581
44417
|
}
|
|
43582
44418
|
function nativeUuid(message) {
|
|
@@ -43586,12 +44422,12 @@ function parentToolUseId(message) {
|
|
|
43586
44422
|
return typeof message.parent_tool_use_id === "string" && message.parent_tool_use_id.length > 0 ? message.parent_tool_use_id : null;
|
|
43587
44423
|
}
|
|
43588
44424
|
function assistantNativeMessageId(message) {
|
|
43589
|
-
if (!
|
|
44425
|
+
if (!isRecord5(message.message))
|
|
43590
44426
|
return null;
|
|
43591
44427
|
return typeof message.message.id === "string" && message.message.id.length > 0 ? message.message.id : null;
|
|
43592
44428
|
}
|
|
43593
44429
|
function assistantContent(message) {
|
|
43594
|
-
if (message.type !== "assistant" || !
|
|
44430
|
+
if (message.type !== "assistant" || !isRecord5(message.message))
|
|
43595
44431
|
return null;
|
|
43596
44432
|
return Array.isArray(message.message.content) ? message.message.content : null;
|
|
43597
44433
|
}
|
|
@@ -43599,10 +44435,10 @@ function assistantText(message) {
|
|
|
43599
44435
|
const content = assistantContent(message);
|
|
43600
44436
|
if (!content)
|
|
43601
44437
|
return null;
|
|
43602
|
-
return content.flatMap((block) =>
|
|
44438
|
+
return content.flatMap((block) => isRecord5(block) && block.type === "text" && typeof block.text === "string" ? [block.text] : []).join("");
|
|
43603
44439
|
}
|
|
43604
44440
|
function assistantError(message) {
|
|
43605
|
-
return
|
|
44441
|
+
return isRecord5(message) && message.type === "assistant" && typeof message.error === "string" ? message.error : null;
|
|
43606
44442
|
}
|
|
43607
44443
|
function boundedString(value, limit) {
|
|
43608
44444
|
if (typeof value !== "string")
|
|
@@ -43613,25 +44449,25 @@ function boundedString(value, limit) {
|
|
|
43613
44449
|
return trimmed.slice(0, limit);
|
|
43614
44450
|
}
|
|
43615
44451
|
function subagentDescription(argumentsValue, toolName) {
|
|
43616
|
-
if (!
|
|
44452
|
+
if (!isRecord5(argumentsValue))
|
|
43617
44453
|
return `${toolName} delegation`;
|
|
43618
44454
|
return boundedString(argumentsValue.description, SUBAGENT_DESCRIPTION_LIMIT) ?? boundedString(argumentsValue.summary, SUBAGENT_DESCRIPTION_LIMIT) ?? boundedString(argumentsValue.name, SUBAGENT_DESCRIPTION_LIMIT) ?? `${toolName} delegation`;
|
|
43619
44455
|
}
|
|
43620
44456
|
function subagentPrompt(argumentsValue) {
|
|
43621
|
-
if (!
|
|
44457
|
+
if (!isRecord5(argumentsValue))
|
|
43622
44458
|
return void 0;
|
|
43623
44459
|
return boundedString(argumentsValue.prompt ?? argumentsValue.message, SUBAGENT_SUMMARY_LIMIT);
|
|
43624
44460
|
}
|
|
43625
44461
|
function subagentRole(argumentsValue) {
|
|
43626
|
-
if (!
|
|
44462
|
+
if (!isRecord5(argumentsValue))
|
|
43627
44463
|
return void 0;
|
|
43628
44464
|
return boundedString(argumentsValue.subagent_type ?? argumentsValue.agent_type, SUBAGENT_DESCRIPTION_LIMIT);
|
|
43629
44465
|
}
|
|
43630
44466
|
function subagentBackground(argumentsValue) {
|
|
43631
|
-
return
|
|
44467
|
+
return isRecord5(argumentsValue) && argumentsValue.run_in_background === true;
|
|
43632
44468
|
}
|
|
43633
44469
|
function targetedSubagentId(argumentsValue) {
|
|
43634
|
-
if (!
|
|
44470
|
+
if (!isRecord5(argumentsValue))
|
|
43635
44471
|
return void 0;
|
|
43636
44472
|
return boundedString(argumentsValue.to ?? argumentsValue.recipient ?? argumentsValue.agentId, SUBAGENT_DESCRIPTION_LIMIT);
|
|
43637
44473
|
}
|
|
@@ -43648,11 +44484,11 @@ function finiteNonNegativeNumber(value) {
|
|
|
43648
44484
|
return typeof value === "number" && Number.isFinite(value) && value >= 0;
|
|
43649
44485
|
}
|
|
43650
44486
|
function parseResultModelUsage(value) {
|
|
43651
|
-
if (!
|
|
44487
|
+
if (!isRecord5(value))
|
|
43652
44488
|
return void 0;
|
|
43653
44489
|
const usage = [];
|
|
43654
44490
|
for (const entry of Object.values(value)) {
|
|
43655
|
-
if (!
|
|
44491
|
+
if (!isRecord5(entry) || !safeNonNegativeInteger(entry.inputTokens) || !safeNonNegativeInteger(entry.outputTokens)) {
|
|
43656
44492
|
return void 0;
|
|
43657
44493
|
}
|
|
43658
44494
|
usage.push({
|
|
@@ -43667,7 +44503,7 @@ function parseResultModelUsage(value) {
|
|
|
43667
44503
|
return usage;
|
|
43668
44504
|
}
|
|
43669
44505
|
function parseLastRequestUsage(value, attribution = {}) {
|
|
43670
|
-
if (!
|
|
44506
|
+
if (!isRecord5(value))
|
|
43671
44507
|
return void 0;
|
|
43672
44508
|
const inputTokens = value.input_tokens;
|
|
43673
44509
|
const outputTokens = value.output_tokens;
|
|
@@ -43677,11 +44513,11 @@ function parseLastRequestUsage(value, attribution = {}) {
|
|
|
43677
44513
|
return void 0;
|
|
43678
44514
|
}
|
|
43679
44515
|
const requestId = boundedString(attribution.requestId, 500);
|
|
43680
|
-
const
|
|
44516
|
+
const model2 = boundedString(attribution.model, 500);
|
|
43681
44517
|
const provider = boundedString(attribution.provider, 100);
|
|
43682
44518
|
return {
|
|
43683
44519
|
...requestId ? { requestId } : {},
|
|
43684
|
-
...
|
|
44520
|
+
...model2 ? { model: model2 } : {},
|
|
43685
44521
|
...provider ? { provider } : {},
|
|
43686
44522
|
inputTokens,
|
|
43687
44523
|
outputTokens,
|
|
@@ -43690,7 +44526,7 @@ function parseLastRequestUsage(value, attribution = {}) {
|
|
|
43690
44526
|
};
|
|
43691
44527
|
}
|
|
43692
44528
|
function assistantRequestUsage(message, provider) {
|
|
43693
|
-
if (!
|
|
44529
|
+
if (!isRecord5(message.message))
|
|
43694
44530
|
return void 0;
|
|
43695
44531
|
return parseLastRequestUsage(message.message.usage, {
|
|
43696
44532
|
requestId: message.message.id ?? message.request_id,
|
|
@@ -43713,7 +44549,7 @@ function parseResultUsageEvent(message) {
|
|
|
43713
44549
|
};
|
|
43714
44550
|
}
|
|
43715
44551
|
function parsePlanLimitWindow(value) {
|
|
43716
|
-
if (!
|
|
44552
|
+
if (!isRecord5(value))
|
|
43717
44553
|
return void 0;
|
|
43718
44554
|
const utilization = value.utilization;
|
|
43719
44555
|
if (typeof utilization !== "number" || !Number.isFinite(utilization) || utilization < 0) {
|
|
@@ -43725,12 +44561,12 @@ function parsePlanLimitWindow(value) {
|
|
|
43725
44561
|
return { utilizationPercent, ...resetsAtUnix !== void 0 ? { resetsAtUnix } : {} };
|
|
43726
44562
|
}
|
|
43727
44563
|
function parseClaudePlanLimitEvent(message) {
|
|
43728
|
-
if (!
|
|
44564
|
+
if (!isRecord5(message) || message.type !== "rate_limit_event")
|
|
43729
44565
|
return null;
|
|
43730
44566
|
const info = message.rate_limit_info;
|
|
43731
|
-
if (!
|
|
44567
|
+
if (!isRecord5(info))
|
|
43732
44568
|
return null;
|
|
43733
|
-
const windows =
|
|
44569
|
+
const windows = isRecord5(info.unifiedWindows) ? info.unifiedWindows : void 0;
|
|
43734
44570
|
let fiveHour = parsePlanLimitWindow(windows?.five_hour);
|
|
43735
44571
|
let sevenDay = parsePlanLimitWindow(windows?.seven_day);
|
|
43736
44572
|
if (!fiveHour && !sevenDay) {
|
|
@@ -43748,7 +44584,7 @@ function parseClaudePlanLimitEvent(message) {
|
|
|
43748
44584
|
};
|
|
43749
44585
|
}
|
|
43750
44586
|
function nativeSubagentId(nativeResult, outputText) {
|
|
43751
|
-
if (
|
|
44587
|
+
if (isRecord5(nativeResult)) {
|
|
43752
44588
|
const structured = boundedString(nativeResult.agentId ?? nativeResult.agent_id ?? nativeResult.task_id, SUBAGENT_DESCRIPTION_LIMIT);
|
|
43753
44589
|
if (structured)
|
|
43754
44590
|
return structured;
|
|
@@ -43756,7 +44592,7 @@ function nativeSubagentId(nativeResult, outputText) {
|
|
|
43756
44592
|
return boundedString(/agentId:\s*([A-Za-z0-9_-]+)/u.exec(outputText ?? "")?.[1], SUBAGENT_DESCRIPTION_LIMIT);
|
|
43757
44593
|
}
|
|
43758
44594
|
function subagentContinuesInBackground(nativeResult, outputText) {
|
|
43759
|
-
if (
|
|
44595
|
+
if (isRecord5(nativeResult)) {
|
|
43760
44596
|
if (nativeResult.isAsync === true || nativeResult.is_async === true)
|
|
43761
44597
|
return true;
|
|
43762
44598
|
if (nativeResult.status === "async_launched")
|
|
@@ -43765,15 +44601,15 @@ function subagentContinuesInBackground(nativeResult, outputText) {
|
|
|
43765
44601
|
return outputText?.includes("The agent is working in the background.") ?? false;
|
|
43766
44602
|
}
|
|
43767
44603
|
function resultText(content, nativeResult) {
|
|
43768
|
-
let
|
|
44604
|
+
let text2 = "";
|
|
43769
44605
|
if (typeof content === "string") {
|
|
43770
|
-
|
|
44606
|
+
text2 = content;
|
|
43771
44607
|
} else if (Array.isArray(content)) {
|
|
43772
|
-
|
|
44608
|
+
text2 = content.flatMap((block) => isRecord5(block) && block.type === "text" && typeof block.text === "string" ? [block.text] : []).join("");
|
|
43773
44609
|
}
|
|
43774
|
-
if (
|
|
43775
|
-
return
|
|
43776
|
-
if (!
|
|
44610
|
+
if (text2.length > 0)
|
|
44611
|
+
return text2;
|
|
44612
|
+
if (!isRecord5(nativeResult))
|
|
43777
44613
|
return void 0;
|
|
43778
44614
|
const stdout = typeof nativeResult.stdout === "string" ? nativeResult.stdout : "";
|
|
43779
44615
|
const stderr = typeof nativeResult.stderr === "string" ? nativeResult.stderr : "";
|
|
@@ -43785,13 +44621,13 @@ function userMessageText(content) {
|
|
|
43785
44621
|
return content;
|
|
43786
44622
|
if (!Array.isArray(content))
|
|
43787
44623
|
return null;
|
|
43788
|
-
const
|
|
43789
|
-
return
|
|
44624
|
+
const text2 = content.flatMap((block) => isRecord5(block) && block.type === "text" && typeof block.text === "string" ? [block.text] : []).join("");
|
|
44625
|
+
return text2.length > 0 ? text2 : null;
|
|
43790
44626
|
}
|
|
43791
44627
|
function parseClaudeTaskNotification(message) {
|
|
43792
|
-
if (!
|
|
44628
|
+
if (!isRecord5(message) || message.type !== "user" || !isRecord5(message.message))
|
|
43793
44629
|
return null;
|
|
43794
|
-
if (
|
|
44630
|
+
if (isRecord5(message.origin) && message.origin.kind !== "task-notification")
|
|
43795
44631
|
return null;
|
|
43796
44632
|
const content = userMessageText(message.message.content);
|
|
43797
44633
|
if (!content || !content.includes("<task-notification>"))
|
|
@@ -43851,8 +44687,9 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
43851
44687
|
requestCancel() {
|
|
43852
44688
|
this.#cancelRequested = true;
|
|
43853
44689
|
}
|
|
44690
|
+
#usageRequest = null;
|
|
43854
44691
|
consume(message) {
|
|
43855
|
-
if (this.#completed || !
|
|
44692
|
+
if (this.#completed || !isRecord5(message))
|
|
43856
44693
|
return { events: [] };
|
|
43857
44694
|
const events = [];
|
|
43858
44695
|
this.#consumeSegmentLevel(message, events);
|
|
@@ -43866,9 +44703,11 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
43866
44703
|
this.#consumeCompaction(message, events);
|
|
43867
44704
|
this.#consumeLocalCommandOutput(message, events);
|
|
43868
44705
|
}
|
|
43869
|
-
if (message.type === "stream_event" &&
|
|
43870
|
-
if (!nested)
|
|
44706
|
+
if (message.type === "stream_event" && isRecord5(message.event)) {
|
|
44707
|
+
if (!nested) {
|
|
44708
|
+
this.#observeUsage(message.event, events);
|
|
43871
44709
|
this.#consumeStreamEvent(message, events);
|
|
44710
|
+
}
|
|
43872
44711
|
} else if (message.type === "tool_progress") {
|
|
43873
44712
|
this.#consumeToolProgress(message, events);
|
|
43874
44713
|
}
|
|
@@ -43886,6 +44725,10 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
43886
44725
|
}
|
|
43887
44726
|
if (message.type !== "result")
|
|
43888
44727
|
return { events };
|
|
44728
|
+
if (this.#usageRequest) {
|
|
44729
|
+
this.#usageRequest = null;
|
|
44730
|
+
events.push({ type: "usage.request", record: { kind: "missing" } });
|
|
44731
|
+
}
|
|
43889
44732
|
const usageEvent = parseResultUsageEvent(message);
|
|
43890
44733
|
if (usageEvent)
|
|
43891
44734
|
events.push(usageEvent);
|
|
@@ -43973,7 +44816,7 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
43973
44816
|
if (message.subtype !== "background_tasks_changed" || !Array.isArray(message.tasks))
|
|
43974
44817
|
return;
|
|
43975
44818
|
const nativeSubagentIds = message.tasks.flatMap((task) => {
|
|
43976
|
-
if (!
|
|
44819
|
+
if (!isRecord5(task))
|
|
43977
44820
|
return [];
|
|
43978
44821
|
const taskId = boundedString(task.task_id, SUBAGENT_DESCRIPTION_LIMIT);
|
|
43979
44822
|
return taskId ? [taskId] : [];
|
|
@@ -44035,7 +44878,7 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
44035
44878
|
});
|
|
44036
44879
|
return;
|
|
44037
44880
|
}
|
|
44038
|
-
if (message.subtype === "task_updated" &&
|
|
44881
|
+
if (message.subtype === "task_updated" && isRecord5(message.patch)) {
|
|
44039
44882
|
const status = taskStatus(message.patch.status);
|
|
44040
44883
|
if (!status)
|
|
44041
44884
|
return;
|
|
@@ -44052,16 +44895,45 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
44052
44895
|
});
|
|
44053
44896
|
}
|
|
44054
44897
|
}
|
|
44898
|
+
/**
|
|
44899
|
+
* Meters each root model request from the Anthropic stream: `message_start` names it and
|
|
44900
|
+
* carries input and cache counts, the first `content_block_start` is its first output token,
|
|
44901
|
+
* `message_delta` carries the final counts and `message_stop` completes it.
|
|
44902
|
+
*/
|
|
44903
|
+
#observeUsage(event, events) {
|
|
44904
|
+
if (event.type === "message_start") {
|
|
44905
|
+
const message = isRecord5(event.message) ? event.message : null;
|
|
44906
|
+
this.#usageRequest = message && typeof message.id === "string" && message.id.length > 0 && isClaudeModelRequest(message.model) ? { id: message.id, model: message.model, usage: message.usage, startedAtMs: null } : null;
|
|
44907
|
+
return;
|
|
44908
|
+
}
|
|
44909
|
+
const request = this.#usageRequest;
|
|
44910
|
+
if (!request)
|
|
44911
|
+
return;
|
|
44912
|
+
if (event.type === "content_block_start") {
|
|
44913
|
+
request.startedAtMs ??= Date.now();
|
|
44914
|
+
} else if (event.type === "message_delta" && isRecord5(event.usage)) {
|
|
44915
|
+
request.usage = { ...isRecord5(request.usage) ? request.usage : {}, ...event.usage };
|
|
44916
|
+
} else if (event.type === "message_stop") {
|
|
44917
|
+
this.#usageRequest = null;
|
|
44918
|
+
events.push({
|
|
44919
|
+
type: "usage.request",
|
|
44920
|
+
record: claudeUsageRecord(request.id, request.model, request.usage, {
|
|
44921
|
+
startedAtMs: request.startedAtMs,
|
|
44922
|
+
completedAtMs: Date.now()
|
|
44923
|
+
})
|
|
44924
|
+
});
|
|
44925
|
+
}
|
|
44926
|
+
}
|
|
44055
44927
|
#consumeStreamEvent(message, events) {
|
|
44056
44928
|
const event = message.event;
|
|
44057
|
-
if (!
|
|
44929
|
+
if (!isRecord5(event))
|
|
44058
44930
|
return;
|
|
44059
|
-
if (event.type === "message_start" &&
|
|
44931
|
+
if (event.type === "message_start" && isRecord5(event.message) && typeof event.message.id === "string" && event.message.id.length > 0) {
|
|
44060
44932
|
this.#activeRootStreamMessageId = event.message.id;
|
|
44061
44933
|
this.#messageState(event.message.id);
|
|
44062
44934
|
return;
|
|
44063
44935
|
}
|
|
44064
|
-
if (event.type !== "content_block_delta" || !
|
|
44936
|
+
if (event.type !== "content_block_delta" || !isRecord5(event.delta))
|
|
44065
44937
|
return;
|
|
44066
44938
|
const messageId = this.#activeRootStreamMessageId ?? nativeUuid(message) ?? this.#nextMessageId();
|
|
44067
44939
|
if (!this.#activeRootStreamMessageId)
|
|
@@ -44137,7 +45009,7 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
44137
45009
|
}
|
|
44138
45010
|
#consumeToolUseBlocks(message, events, ignoreKnownIds) {
|
|
44139
45011
|
for (const block of assistantContent(message) ?? []) {
|
|
44140
|
-
if (!
|
|
45012
|
+
if (!isRecord5(block) || block.type !== "tool_use")
|
|
44141
45013
|
continue;
|
|
44142
45014
|
const argumentsResult = jsonValueSchema.safeParse(block.input);
|
|
44143
45015
|
if (typeof block.id !== "string" || block.id.length === 0 || typeof block.name !== "string" || block.name.length === 0 || !argumentsResult.success) {
|
|
@@ -44189,9 +45061,9 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
44189
45061
|
events.push(settled);
|
|
44190
45062
|
}
|
|
44191
45063
|
#consumeToolResults(message, events, ignoreUnknown) {
|
|
44192
|
-
if (!
|
|
45064
|
+
if (!isRecord5(message.message) || !Array.isArray(message.message.content))
|
|
44193
45065
|
return;
|
|
44194
|
-
const resultBlocks = message.message.content.filter((block) =>
|
|
45066
|
+
const resultBlocks = message.message.content.filter((block) => isRecord5(block) && block.type === "tool_result");
|
|
44195
45067
|
if (resultBlocks.length === 0)
|
|
44196
45068
|
return;
|
|
44197
45069
|
if (resultBlocks.length > 1 && message.tool_use_result !== void 0) {
|
|
@@ -44233,7 +45105,7 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
44233
45105
|
continue;
|
|
44234
45106
|
}
|
|
44235
45107
|
const fileChange = isError ? null : parseClaudeNativeFileChange(tool.name, nativeResult);
|
|
44236
|
-
const backgroundTaskId = tool.name === "Bash" && !isError &&
|
|
45108
|
+
const backgroundTaskId = tool.name === "Bash" && !isError && isRecord5(nativeResult) && typeof nativeResult.backgroundTaskId === "string" && nativeResult.backgroundTaskId.length > 0 ? nativeResult.backgroundTaskId : void 0;
|
|
44237
45109
|
const outputFile = backgroundTaskId !== void 0 ? BACKGROUND_OUTPUT_FILE_PATTERN.exec(outputText ?? "")?.[1] : void 0;
|
|
44238
45110
|
const backgroundOutputFile = typeof outputFile === "string" && outputFile.length > 0 ? outputFile : void 0;
|
|
44239
45111
|
events.push({
|
|
@@ -44270,7 +45142,7 @@ function claudeTranscriptItemId(nativeTurnKey, kind, ordinal) {
|
|
|
44270
45142
|
|
|
44271
45143
|
// dist/claude-history.js
|
|
44272
45144
|
var claudeCodeHarnessId = harnessIdSchema.parse("claude-code");
|
|
44273
|
-
function
|
|
45145
|
+
function isRecord6(value) {
|
|
44274
45146
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
44275
45147
|
}
|
|
44276
45148
|
function isoToMs(value) {
|
|
@@ -44300,12 +45172,12 @@ function textParts(value) {
|
|
|
44300
45172
|
return value.length > 0 ? [value] : [];
|
|
44301
45173
|
if (!Array.isArray(value))
|
|
44302
45174
|
return [];
|
|
44303
|
-
return value.flatMap((part) =>
|
|
45175
|
+
return value.flatMap((part) => isRecord6(part) && part.type === "text" && typeof part.text === "string" ? [part.text] : []);
|
|
44304
45176
|
}
|
|
44305
45177
|
function thinkingParts(value) {
|
|
44306
45178
|
if (!Array.isArray(value))
|
|
44307
45179
|
return [];
|
|
44308
|
-
return value.flatMap((part) =>
|
|
45180
|
+
return value.flatMap((part) => isRecord6(part) && part.type === "thinking" && typeof part.thinking === "string" ? [part.thinking] : []);
|
|
44309
45181
|
}
|
|
44310
45182
|
var localCommandRecordPattern = /^\s*<(local-command-(?:stdout|caveat))>[\s\S]*<\/\1>\s*$/u;
|
|
44311
45183
|
var taskNotificationRecordPattern = /^\s*<task-notification>[\s\S]*<\/task-notification>\s*$/u;
|
|
@@ -44314,33 +45186,33 @@ var controlCommandNamePattern = /<command-name>\s*\/(?:model|compact)\s*<\/comma
|
|
|
44314
45186
|
var recapCommandNamePattern = /<command-name>\s*\/recap\s*<\/command-name>/u;
|
|
44315
45187
|
var initCommandNamePattern = /<command-name>\s*\/init\s*<\/command-name>/u;
|
|
44316
45188
|
var localCommandStdoutPattern = /^\s*<local-command-stdout>([\s\S]*)<\/local-command-stdout>\s*$/u;
|
|
44317
|
-
function isLocalCommandRecord(
|
|
44318
|
-
return localCommandRecordPattern.test(
|
|
45189
|
+
function isLocalCommandRecord(text2) {
|
|
45190
|
+
return localCommandRecordPattern.test(text2);
|
|
44319
45191
|
}
|
|
44320
|
-
function isTaskNotificationRecord(
|
|
44321
|
-
return taskNotificationRecordPattern.test(
|
|
45192
|
+
function isTaskNotificationRecord(text2) {
|
|
45193
|
+
return taskNotificationRecordPattern.test(text2);
|
|
44322
45194
|
}
|
|
44323
|
-
function isControlCommandEnvelope(
|
|
44324
|
-
return commandEnvelopePattern.test(
|
|
45195
|
+
function isControlCommandEnvelope(text2) {
|
|
45196
|
+
return commandEnvelopePattern.test(text2) && controlCommandNamePattern.test(text2);
|
|
44325
45197
|
}
|
|
44326
|
-
function isNamedCommandEnvelope(
|
|
44327
|
-
return commandEnvelopePattern.test(
|
|
45198
|
+
function isNamedCommandEnvelope(text2, namePattern) {
|
|
45199
|
+
return commandEnvelopePattern.test(text2) && namePattern.test(text2);
|
|
44328
45200
|
}
|
|
44329
|
-
function displayedUserText(
|
|
44330
|
-
if (isNamedCommandEnvelope(
|
|
45201
|
+
function displayedUserText(text2) {
|
|
45202
|
+
if (isNamedCommandEnvelope(text2, initCommandNamePattern))
|
|
44331
45203
|
return "/init";
|
|
44332
|
-
if (isNamedCommandEnvelope(
|
|
45204
|
+
if (isNamedCommandEnvelope(text2, recapCommandNamePattern))
|
|
44333
45205
|
return "/recap";
|
|
44334
|
-
return
|
|
45206
|
+
return text2;
|
|
44335
45207
|
}
|
|
44336
|
-
function localCommandStdoutText(
|
|
44337
|
-
const match = localCommandStdoutPattern.exec(
|
|
45208
|
+
function localCommandStdoutText(text2) {
|
|
45209
|
+
const match = localCommandStdoutPattern.exec(text2);
|
|
44338
45210
|
if (!match)
|
|
44339
45211
|
return null;
|
|
44340
45212
|
return match[1] ?? "";
|
|
44341
45213
|
}
|
|
44342
45214
|
function isTaskNotificationOrigin(value) {
|
|
44343
|
-
return
|
|
45215
|
+
return isRecord6(value.origin) && value.origin.kind === "task-notification";
|
|
44344
45216
|
}
|
|
44345
45217
|
function visibleUserTextParts(message) {
|
|
44346
45218
|
if (message.type !== "user" || message.syntheticUser)
|
|
@@ -44351,24 +45223,24 @@ function visibleUserTextParts(message) {
|
|
|
44351
45223
|
return parts.filter((part) => !isLocalCommandRecord(part) && !isTaskNotificationRecord(part));
|
|
44352
45224
|
}
|
|
44353
45225
|
function isInterruptionRecord(value, promptId) {
|
|
44354
|
-
if (value.type !== "user" || promptId === null || value.promptId !== promptId || value.promptSource !== void 0 || !
|
|
45226
|
+
if (value.type !== "user" || promptId === null || value.promptId !== promptId || value.promptSource !== void 0 || !isRecord6(value.message))
|
|
44355
45227
|
return false;
|
|
44356
45228
|
const content = value.message.content;
|
|
44357
45229
|
if (!Array.isArray(content) || content.length !== 1)
|
|
44358
45230
|
return false;
|
|
44359
45231
|
const part = content[0];
|
|
44360
|
-
return
|
|
45232
|
+
return isRecord6(part) && part.type === "text" && (part.text === "[Request interrupted by user]" || part.text === "[Request interrupted by user for tool use]");
|
|
44361
45233
|
}
|
|
44362
45234
|
function conversationMessages(values, sessionId) {
|
|
44363
45235
|
const messages = [];
|
|
44364
45236
|
const ids = /* @__PURE__ */ new Set();
|
|
44365
45237
|
let promptId = null;
|
|
44366
45238
|
for (const value of values) {
|
|
44367
|
-
if (!
|
|
45239
|
+
if (!isRecord6(value))
|
|
44368
45240
|
throw new Error("Claude history contains a malformed message");
|
|
44369
45241
|
if (value.type === "system")
|
|
44370
45242
|
continue;
|
|
44371
|
-
if (value.type !== "user" && value.type !== "assistant" || typeof value.uuid !== "string" || value.uuid.length === 0 || value.session_id !== sessionId || !
|
|
45243
|
+
if (value.type !== "user" && value.type !== "assistant" || typeof value.uuid !== "string" || value.uuid.length === 0 || value.session_id !== sessionId || !isRecord6(value.message) || value.message.role !== value.type) {
|
|
44372
45244
|
throw new Error("Claude history contains an invalid message identity");
|
|
44373
45245
|
}
|
|
44374
45246
|
if (ids.has(value.uuid))
|
|
@@ -44467,14 +45339,14 @@ function mapClaudeSnapshot(values, sessionId) {
|
|
|
44467
45339
|
} : {},
|
|
44468
45340
|
...startedAtMs !== void 0 ? { startedAtMs } : {},
|
|
44469
45341
|
...completedAtMs !== void 0 ? { completedAtMs } : {},
|
|
44470
|
-
input: visibleUserTextParts(user).map((
|
|
45342
|
+
input: visibleUserTextParts(user).map((text2) => ({
|
|
44471
45343
|
type: "text",
|
|
44472
|
-
text: displayedUserText(
|
|
45344
|
+
text: displayedUserText(text2)
|
|
44473
45345
|
})),
|
|
44474
45346
|
items: turnMessages.flatMap((message) => {
|
|
44475
45347
|
const recordDurationMs = durationsMs.get(message.uuid);
|
|
44476
45348
|
if (message.type === "user") {
|
|
44477
|
-
const recapOutput = visibleUserTextParts(user).some((
|
|
45349
|
+
const recapOutput = visibleUserTextParts(user).some((text3) => isNamedCommandEnvelope(text3, recapCommandNamePattern)) ? textParts(message.message.content).map(localCommandStdoutText).find((text3) => text3 !== null && text3.length > 0) : void 0;
|
|
44478
45350
|
if (!recapOutput)
|
|
44479
45351
|
return [];
|
|
44480
45352
|
return [
|
|
@@ -44492,15 +45364,15 @@ function mapClaudeSnapshot(values, sessionId) {
|
|
|
44492
45364
|
if (message.type !== "assistant")
|
|
44493
45365
|
return [];
|
|
44494
45366
|
const content = message.message.content;
|
|
44495
|
-
const
|
|
45367
|
+
const text2 = textParts(content).join("");
|
|
44496
45368
|
const reasoning = thinkingParts(content).join("");
|
|
44497
45369
|
if (!Array.isArray(content)) {
|
|
44498
|
-
return
|
|
45370
|
+
return text2.length > 0 ? [
|
|
44499
45371
|
{
|
|
44500
45372
|
item: {
|
|
44501
45373
|
type: "agentMessage",
|
|
44502
45374
|
itemId: claudeTranscriptItemId(user.uuid, "agentMessage", agentMessageOrdinal += 1),
|
|
44503
|
-
text,
|
|
45375
|
+
text: text2,
|
|
44504
45376
|
...recordDurationMs !== void 0 ? { durationMs: recordDurationMs } : {}
|
|
44505
45377
|
},
|
|
44506
45378
|
outcome: itemOutcome(outcome)
|
|
@@ -44511,7 +45383,7 @@ function mapClaudeSnapshot(values, sessionId) {
|
|
|
44511
45383
|
let projectedReasoning = false;
|
|
44512
45384
|
let projectedText = false;
|
|
44513
45385
|
for (const [blockIndex, block] of content.entries()) {
|
|
44514
|
-
if (!
|
|
45386
|
+
if (!isRecord6(block))
|
|
44515
45387
|
continue;
|
|
44516
45388
|
if (block.type === "thinking" && !projectedReasoning && reasoning.length > 0) {
|
|
44517
45389
|
items.push({
|
|
@@ -44526,12 +45398,12 @@ function mapClaudeSnapshot(values, sessionId) {
|
|
|
44526
45398
|
projectedReasoning = true;
|
|
44527
45399
|
continue;
|
|
44528
45400
|
}
|
|
44529
|
-
if (block.type === "text" && !projectedText &&
|
|
45401
|
+
if (block.type === "text" && !projectedText && text2.length > 0) {
|
|
44530
45402
|
items.push({
|
|
44531
45403
|
item: {
|
|
44532
45404
|
type: "agentMessage",
|
|
44533
45405
|
itemId: claudeTranscriptItemId(user.uuid, "agentMessage", agentMessageOrdinal += 1),
|
|
44534
|
-
text,
|
|
45406
|
+
text: text2,
|
|
44535
45407
|
...recordDurationMs !== void 0 ? { durationMs: recordDurationMs } : {}
|
|
44536
45408
|
},
|
|
44537
45409
|
outcome: itemOutcome(outcome)
|
|
@@ -44558,7 +45430,7 @@ function mapClaudeSnapshot(values, sessionId) {
|
|
|
44558
45430
|
}
|
|
44559
45431
|
} : { status: "succeeded" };
|
|
44560
45432
|
const itemId = toolItem !== null ? claudeTranscriptItemId(user.uuid, "tool", toolItem) : hostItemIdSchema.parse(`claude-item-v1-${message.uuid}-tool-${blockIndex}`);
|
|
44561
|
-
if (block.name === "Bash" &&
|
|
45433
|
+
if (block.name === "Bash" && isRecord6(block.input) && typeof block.input.command === "string") {
|
|
44562
45434
|
items.push({
|
|
44563
45435
|
item: {
|
|
44564
45436
|
type: "commandExecution",
|
|
@@ -44598,7 +45470,7 @@ function toolResultBlocks(messages) {
|
|
|
44598
45470
|
if (message.type !== "user" || !Array.isArray(message.message.content))
|
|
44599
45471
|
continue;
|
|
44600
45472
|
for (const block of message.message.content) {
|
|
44601
|
-
if (
|
|
45473
|
+
if (isRecord6(block) && block.type === "tool_result" && typeof block.tool_use_id === "string") {
|
|
44602
45474
|
results.set(block.tool_use_id, { block, timestampMs: message.timestampMs });
|
|
44603
45475
|
}
|
|
44604
45476
|
}
|
|
@@ -44608,12 +45480,12 @@ function toolResultBlocks(messages) {
|
|
|
44608
45480
|
function toolResultOutput(block) {
|
|
44609
45481
|
if (!block)
|
|
44610
45482
|
return void 0;
|
|
44611
|
-
const
|
|
44612
|
-
return
|
|
45483
|
+
const text2 = textParts(block.content).join("");
|
|
45484
|
+
return text2.length > 0 ? text2 : void 0;
|
|
44613
45485
|
}
|
|
44614
45486
|
function resultSubagentId(value, block) {
|
|
44615
45487
|
const nativeResult = value.tool_use_result;
|
|
44616
|
-
if (
|
|
45488
|
+
if (isRecord6(nativeResult)) {
|
|
44617
45489
|
const structured = nativeResult.agentId ?? nativeResult.agent_id ?? nativeResult.task_id;
|
|
44618
45490
|
if (typeof structured === "string" && structured.length > 0)
|
|
44619
45491
|
return structured;
|
|
@@ -44624,13 +45496,13 @@ function resultSubagentId(value, block) {
|
|
|
44624
45496
|
function subagentPrompt2(values, nativeSubagentId2) {
|
|
44625
45497
|
const toolUses = /* @__PURE__ */ new Map();
|
|
44626
45498
|
for (const value of values) {
|
|
44627
|
-
if (!
|
|
45499
|
+
if (!isRecord6(value) || !isRecord6(value.message) || !Array.isArray(value.message.content)) {
|
|
44628
45500
|
continue;
|
|
44629
45501
|
}
|
|
44630
45502
|
for (const block of value.message.content) {
|
|
44631
|
-
if (!
|
|
45503
|
+
if (!isRecord6(block))
|
|
44632
45504
|
continue;
|
|
44633
|
-
if (block.type === "tool_use" && typeof block.id === "string" && (block.name === "Agent" || block.name === "Task") &&
|
|
45505
|
+
if (block.type === "tool_use" && typeof block.id === "string" && (block.name === "Agent" || block.name === "Task") && isRecord6(block.input) && typeof block.input.prompt === "string" && block.input.prompt.length > 0) {
|
|
44634
45506
|
toolUses.set(block.id, block.input.prompt);
|
|
44635
45507
|
continue;
|
|
44636
45508
|
}
|
|
@@ -44644,7 +45516,7 @@ function subagentPrompt2(values, nativeSubagentId2) {
|
|
|
44644
45516
|
return void 0;
|
|
44645
45517
|
}
|
|
44646
45518
|
function mapClaudeSubagentSnapshot(values, parentSessionId, nativeSubagentId2, parentValues = []) {
|
|
44647
|
-
const messages = conversationMessages(values.map((value) =>
|
|
45519
|
+
const messages = conversationMessages(values.map((value) => isRecord6(value) ? { ...value, session_id: parentSessionId } : value), parentSessionId);
|
|
44648
45520
|
const durationsMs = recordDurationsMs(messages);
|
|
44649
45521
|
const turns = [];
|
|
44650
45522
|
for (let index = 0; index < messages.length; ) {
|
|
@@ -44675,7 +45547,7 @@ function mapClaudeSubagentSnapshot(values, parentSessionId, nativeSubagentId2, p
|
|
|
44675
45547
|
const content = Array.isArray(message.message.content) ? message.message.content : [{ type: "text", text: message.message.content }];
|
|
44676
45548
|
for (let blockIndex = 0; blockIndex < content.length; blockIndex += 1) {
|
|
44677
45549
|
const block = content[blockIndex];
|
|
44678
|
-
if (!
|
|
45550
|
+
if (!isRecord6(block))
|
|
44679
45551
|
continue;
|
|
44680
45552
|
const itemId = hostItemIdSchema.parse(`claude-subagent-item-v2-${nativeSubagentId2}-${message.uuid}-${blockIndex}`);
|
|
44681
45553
|
if (block.type === "thinking" && typeof block.thinking === "string") {
|
|
@@ -44723,7 +45595,7 @@ function mapClaudeSubagentSnapshot(values, parentSessionId, nativeSubagentId2, p
|
|
|
44723
45595
|
retryable: false
|
|
44724
45596
|
}
|
|
44725
45597
|
} : { status: "succeeded" };
|
|
44726
|
-
if (block.name === "Bash" &&
|
|
45598
|
+
if (block.name === "Bash" && isRecord6(block.input) && typeof block.input.command === "string") {
|
|
44727
45599
|
items.push({
|
|
44728
45600
|
item: {
|
|
44729
45601
|
type: "commandExecution",
|
|
@@ -44769,7 +45641,7 @@ function mapClaudeSubagentSnapshot(values, parentSessionId, nativeSubagentId2, p
|
|
|
44769
45641
|
} : {},
|
|
44770
45642
|
...startedAtMs !== void 0 ? { startedAtMs } : {},
|
|
44771
45643
|
...completedAtMs !== void 0 ? { completedAtMs } : {},
|
|
44772
|
-
input: user ? visibleUserTextParts(user).map((
|
|
45644
|
+
input: user ? visibleUserTextParts(user).map((text2) => ({ type: "text", text: text2 })) : turns.length === 0 ? [subagentPrompt2(parentValues, nativeSubagentId2)].filter((text2) => text2 !== void 0).map((text2) => ({ type: "text", text: text2 })) : [],
|
|
44773
45645
|
items,
|
|
44774
45646
|
outcome
|
|
44775
45647
|
});
|
|
@@ -44803,7 +45675,7 @@ function nativeIds(snapshot) {
|
|
|
44803
45675
|
async function readSnapshot(dependencies, cwd, sessionId) {
|
|
44804
45676
|
let messages;
|
|
44805
45677
|
try {
|
|
44806
|
-
messages = await dependencies.readSessionMessages({ cwd, sessionId });
|
|
45678
|
+
messages = await dependencies.readSessionMessages({ cwd, sessionId }) ?? [];
|
|
44807
45679
|
} catch {
|
|
44808
45680
|
return {
|
|
44809
45681
|
ok: false,
|
|
@@ -44857,7 +45729,7 @@ async function forkClaudeSession(input) {
|
|
|
44857
45729
|
error: error51("protocolError", "Claude Code Session working directory is unavailable", false)
|
|
44858
45730
|
};
|
|
44859
45731
|
}
|
|
44860
|
-
if (
|
|
45732
|
+
if (path11.resolve(sourceInfo.cwd) !== input.cwd) {
|
|
44861
45733
|
return {
|
|
44862
45734
|
ok: false,
|
|
44863
45735
|
error: error51("unsupported", "Claude Code cannot Fork across working directories", false)
|
|
@@ -44958,7 +45830,7 @@ async function forkClaudeSession(input) {
|
|
|
44958
45830
|
|
|
44959
45831
|
// dist/claude-session-import.js
|
|
44960
45832
|
import { realpath as realpath2, stat as stat2 } from "node:fs/promises";
|
|
44961
|
-
import
|
|
45833
|
+
import path12 from "node:path";
|
|
44962
45834
|
function titleFromMetadata(metadata) {
|
|
44963
45835
|
for (const value of [metadata.customTitle, metadata.summary, metadata.firstPrompt]) {
|
|
44964
45836
|
if (typeof value !== "string")
|
|
@@ -44980,7 +45852,7 @@ async function sourceFromMetadata(metadata, isRunning, signal, canonicalCwds, pr
|
|
|
44980
45852
|
];
|
|
44981
45853
|
let cwd = null;
|
|
44982
45854
|
for (const candidate2 of new Set(candidates)) {
|
|
44983
|
-
if (!
|
|
45855
|
+
if (!path12.isAbsolute(candidate2))
|
|
44984
45856
|
continue;
|
|
44985
45857
|
let canonical = canonicalCwds.get(candidate2);
|
|
44986
45858
|
if (!canonical) {
|
|
@@ -45057,20 +45929,22 @@ var ClaudeSessionImportIndex = class {
|
|
|
45057
45929
|
if (!metadata || metadata.sessionId !== nativeSessionId)
|
|
45058
45930
|
return null;
|
|
45059
45931
|
const preferredCwds = [];
|
|
45060
|
-
if (typeof metadata.cwd === "string" &&
|
|
45932
|
+
if (typeof metadata.cwd === "string" && path12.isAbsolute(metadata.cwd)) {
|
|
45061
45933
|
try {
|
|
45062
45934
|
const messages = await this.#dependencies.readSessionMessages({
|
|
45063
45935
|
cwd: metadata.cwd,
|
|
45064
45936
|
sessionId: nativeSessionId
|
|
45065
45937
|
});
|
|
45066
45938
|
signal.throwIfAborted();
|
|
45939
|
+
if (messages === null)
|
|
45940
|
+
return sourceFromMetadata(metadata, this.#dependencies.isRunning, signal, /* @__PURE__ */ new Map(), preferredCwds);
|
|
45067
45941
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
45068
45942
|
const message = messages[index];
|
|
45069
45943
|
if (typeof message !== "object" || message === null || Array.isArray(message) || typeof message.cwd !== "string") {
|
|
45070
45944
|
continue;
|
|
45071
45945
|
}
|
|
45072
45946
|
const cwd = message.cwd;
|
|
45073
|
-
if (
|
|
45947
|
+
if (path12.isAbsolute(cwd) && !preferredCwds.includes(cwd))
|
|
45074
45948
|
preferredCwds.push(cwd);
|
|
45075
45949
|
}
|
|
45076
45950
|
} catch {
|
|
@@ -45081,14 +45955,14 @@ var ClaudeSessionImportIndex = class {
|
|
|
45081
45955
|
};
|
|
45082
45956
|
|
|
45083
45957
|
// dist/claude-transcript.js
|
|
45084
|
-
import
|
|
45085
|
-
import
|
|
45958
|
+
import os5 from "node:os";
|
|
45959
|
+
import path13 from "node:path";
|
|
45086
45960
|
import { readFile as readFile4, readdir, stat as stat3 } from "node:fs/promises";
|
|
45087
45961
|
function projectDirectoryName(cwd) {
|
|
45088
45962
|
return cwd.replace(/[^A-Za-z0-9]/gu, "-");
|
|
45089
45963
|
}
|
|
45090
45964
|
function configDirectory(environment) {
|
|
45091
|
-
return environment.CLAUDE_CONFIG_DIR ?
|
|
45965
|
+
return environment.CLAUDE_CONFIG_DIR ? path13.resolve(environment.CLAUDE_CONFIG_DIR) : path13.join(os5.homedir(), ".claude");
|
|
45092
45966
|
}
|
|
45093
45967
|
async function existingFile(file2) {
|
|
45094
45968
|
try {
|
|
@@ -45098,8 +45972,8 @@ async function existingFile(file2) {
|
|
|
45098
45972
|
}
|
|
45099
45973
|
}
|
|
45100
45974
|
async function findTranscriptFile(environment, cwd, relativeName) {
|
|
45101
|
-
const projectsDirectory =
|
|
45102
|
-
const expected =
|
|
45975
|
+
const projectsDirectory = path13.join(configDirectory(environment), "projects");
|
|
45976
|
+
const expected = path13.join(projectsDirectory, projectDirectoryName(cwd), relativeName);
|
|
45103
45977
|
if (await existingFile(expected))
|
|
45104
45978
|
return expected;
|
|
45105
45979
|
let projects;
|
|
@@ -45108,18 +45982,18 @@ async function findTranscriptFile(environment, cwd, relativeName) {
|
|
|
45108
45982
|
} catch {
|
|
45109
45983
|
return null;
|
|
45110
45984
|
}
|
|
45111
|
-
for (const
|
|
45112
|
-
const candidate =
|
|
45985
|
+
for (const project2 of projects) {
|
|
45986
|
+
const candidate = path13.join(projectsDirectory, project2, relativeName);
|
|
45113
45987
|
if (await existingFile(candidate))
|
|
45114
45988
|
return candidate;
|
|
45115
45989
|
}
|
|
45116
45990
|
return null;
|
|
45117
45991
|
}
|
|
45118
|
-
function
|
|
45992
|
+
function isRecord7(value) {
|
|
45119
45993
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
45120
45994
|
}
|
|
45121
45995
|
function parseTranscriptRecords(contents, sessionId) {
|
|
45122
|
-
const messages =
|
|
45996
|
+
const messages = /* @__PURE__ */ new Map();
|
|
45123
45997
|
for (const line of contents.split("\n")) {
|
|
45124
45998
|
if (line.trim().length === 0)
|
|
45125
45999
|
continue;
|
|
@@ -45129,12 +46003,12 @@ function parseTranscriptRecords(contents, sessionId) {
|
|
|
45129
46003
|
} catch {
|
|
45130
46004
|
continue;
|
|
45131
46005
|
}
|
|
45132
|
-
if (!
|
|
46006
|
+
if (!isRecord7(entry) || entry.type !== "user" && entry.type !== "assistant" || typeof entry.uuid !== "string" || !isRecord7(entry.message)) {
|
|
45133
46007
|
continue;
|
|
45134
46008
|
}
|
|
45135
|
-
messages.
|
|
46009
|
+
messages.set(entry.uuid, { ...entry, session_id: sessionId });
|
|
45136
46010
|
}
|
|
45137
|
-
return messages;
|
|
46011
|
+
return [...messages.values()];
|
|
45138
46012
|
}
|
|
45139
46013
|
async function readClaudeTranscript(input) {
|
|
45140
46014
|
const transcript = await findTranscriptFile(input.environment, input.cwd, `${input.sessionId}.jsonl`);
|
|
@@ -45143,7 +46017,7 @@ async function readClaudeTranscript(input) {
|
|
|
45143
46017
|
return parseTranscriptRecords(await readFile4(transcript, "utf8"), input.sessionId);
|
|
45144
46018
|
}
|
|
45145
46019
|
async function readClaudeSubagentTranscript(input) {
|
|
45146
|
-
const relativeName =
|
|
46020
|
+
const relativeName = path13.join(input.sessionId, "subagents", `agent-${input.nativeSubagentId}.jsonl`);
|
|
45147
46021
|
const transcript = await findTranscriptFile(input.environment, input.cwd, relativeName);
|
|
45148
46022
|
if (!transcript)
|
|
45149
46023
|
return null;
|
|
@@ -45153,14 +46027,14 @@ async function readClaudeSubagentTranscript(input) {
|
|
|
45153
46027
|
// dist/long-context.js
|
|
45154
46028
|
import { randomUUID as randomUUID3 } from "node:crypto";
|
|
45155
46029
|
import { mkdir as mkdir2, readFile as readFile5, rename as rename2, rm as rm4, writeFile as writeFile2 } from "node:fs/promises";
|
|
45156
|
-
import
|
|
45157
|
-
import
|
|
46030
|
+
import os6 from "node:os";
|
|
46031
|
+
import path14 from "node:path";
|
|
45158
46032
|
var MILLION_CONTEXT_MODELS = [{ id: "claude-opus-5-5", aliases: ["claude-opus-5.5"] }];
|
|
45159
|
-
var MILLION_CONTEXT_MODEL_IDS = new Set(MILLION_CONTEXT_MODELS.flatMap((
|
|
46033
|
+
var MILLION_CONTEXT_MODEL_IDS = new Set(MILLION_CONTEXT_MODELS.flatMap((model2) => [model2.id, ...model2.aliases]));
|
|
45160
46034
|
var MILLION_CONTEXT_SUFFIX = /\[1m\]$/iu;
|
|
45161
46035
|
function claudeLongContextFile(environment) {
|
|
45162
|
-
const root = environment.CODEXHOST_DATA_DIR ?
|
|
45163
|
-
return
|
|
46036
|
+
const root = environment.CODEXHOST_DATA_DIR ? path14.resolve(environment.CODEXHOST_DATA_DIR) : path14.join(os6.homedir(), ".codexhost");
|
|
46037
|
+
return path14.join(root, "claude-code-long-context.json");
|
|
45164
46038
|
}
|
|
45165
46039
|
async function readClaudeLongContext(environment) {
|
|
45166
46040
|
try {
|
|
@@ -45174,7 +46048,7 @@ async function readClaudeLongContext(environment) {
|
|
|
45174
46048
|
}
|
|
45175
46049
|
async function writeClaudeLongContext(environment, enabled) {
|
|
45176
46050
|
const file2 = claudeLongContextFile(environment);
|
|
45177
|
-
await mkdir2(
|
|
46051
|
+
await mkdir2(path14.dirname(file2), { recursive: true, mode: 448 });
|
|
45178
46052
|
const temporary = `${file2}.${randomUUID3()}.tmp`;
|
|
45179
46053
|
try {
|
|
45180
46054
|
await writeFile2(temporary, `${JSON.stringify({ enabled })}
|
|
@@ -45185,10 +46059,10 @@ async function writeClaudeLongContext(environment, enabled) {
|
|
|
45185
46059
|
}
|
|
45186
46060
|
return enabled;
|
|
45187
46061
|
}
|
|
45188
|
-
function claudeSessionModel(
|
|
45189
|
-
if (!
|
|
46062
|
+
function claudeSessionModel(model2, enabled) {
|
|
46063
|
+
if (!model2)
|
|
45190
46064
|
return void 0;
|
|
45191
|
-
const bare =
|
|
46065
|
+
const bare = model2.replace(MILLION_CONTEXT_SUFFIX, "");
|
|
45192
46066
|
if (!enabled || !MILLION_CONTEXT_MODEL_IDS.has(bare))
|
|
45193
46067
|
return bare;
|
|
45194
46068
|
return `${bare}[1m]`;
|
|
@@ -45197,8 +46071,8 @@ function claudeSessionModel(model, enabled) {
|
|
|
45197
46071
|
// dist/model-catalog.js
|
|
45198
46072
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
45199
46073
|
import { readFile as readFile6 } from "node:fs/promises";
|
|
45200
|
-
import
|
|
45201
|
-
import
|
|
46074
|
+
import os7 from "node:os";
|
|
46075
|
+
import path15 from "node:path";
|
|
45202
46076
|
|
|
45203
46077
|
// dist/thinking-options.js
|
|
45204
46078
|
var option = (id, label) => ({
|
|
@@ -45280,7 +46154,7 @@ function decodeClaudeModelRef(ref) {
|
|
|
45280
46154
|
return value === "default" ? void 0 : value;
|
|
45281
46155
|
}
|
|
45282
46156
|
function resolveClaudeConfigDirectory(environment = process.env) {
|
|
45283
|
-
return
|
|
46157
|
+
return path15.resolve(environment.CLAUDE_CONFIG_DIR ?? path15.join(os7.homedir(), ".claude"));
|
|
45284
46158
|
}
|
|
45285
46159
|
function parseModelPickerOptions(value) {
|
|
45286
46160
|
if (!Array.isArray(value))
|
|
@@ -45322,7 +46196,7 @@ function parseClaudeModelPickerSettings(value) {
|
|
|
45322
46196
|
};
|
|
45323
46197
|
}
|
|
45324
46198
|
async function readClaudeUserModelPicker(environment = process.env) {
|
|
45325
|
-
const settingsPath =
|
|
46199
|
+
const settingsPath = path15.join(resolveClaudeConfigDirectory(environment), "settings.json");
|
|
45326
46200
|
let raw;
|
|
45327
46201
|
try {
|
|
45328
46202
|
raw = await readFile6(settingsPath, "utf8");
|
|
@@ -45523,7 +46397,7 @@ var CLAUDE_PERMISSION_MODE_CATALOGS = {
|
|
|
45523
46397
|
};
|
|
45524
46398
|
var autoModeModelInfoSchema = external_exports.object({ supportsAutoMode: external_exports.literal(true) });
|
|
45525
46399
|
function claudePermissionModeCatalogForModels(models, bypassPermissionsAvailable = true) {
|
|
45526
|
-
const supportsAutoMode = Array.isArray(models) && models.some((
|
|
46400
|
+
const supportsAutoMode = Array.isArray(models) && models.some((model2) => autoModeModelInfoSchema.safeParse(model2).success);
|
|
45527
46401
|
if (supportsAutoMode) {
|
|
45528
46402
|
return bypassPermissionsAvailable ? CLAUDE_PERMISSION_MODE_CATALOGS.auto : CLAUDE_PERMISSION_MODE_CATALOGS.autoWithoutBypass;
|
|
45529
46403
|
}
|
|
@@ -45652,7 +46526,7 @@ function projectClaudeAccountUsage(usage, account) {
|
|
|
45652
46526
|
|
|
45653
46527
|
// dist/gateway-models.js
|
|
45654
46528
|
import { readFile as readFile7 } from "node:fs/promises";
|
|
45655
|
-
import
|
|
46529
|
+
import path16 from "node:path";
|
|
45656
46530
|
var GATEWAY_MODELS_TIMEOUT_MS = 3e3;
|
|
45657
46531
|
var GATEWAY_MODELS_MAX_BYTES = 2 * 1024 * 1024;
|
|
45658
46532
|
var OFFICIAL_ANTHROPIC_HOST = "api.anthropic.com";
|
|
@@ -45694,14 +46568,14 @@ function claudeConfigDirectory(environment) {
|
|
|
45694
46568
|
if (configured)
|
|
45695
46569
|
return configured;
|
|
45696
46570
|
const home = trimmedEnv(environment, "HOME") ?? trimmedEnv(environment, "USERPROFILE");
|
|
45697
|
-
return home ?
|
|
46571
|
+
return home ? path16.join(home, ".claude") : void 0;
|
|
45698
46572
|
}
|
|
45699
46573
|
async function readClaudeUserSettingsEnv(environment) {
|
|
45700
46574
|
const configDir = claudeConfigDirectory(environment);
|
|
45701
46575
|
if (!configDir)
|
|
45702
46576
|
return {};
|
|
45703
46577
|
try {
|
|
45704
|
-
const raw = await readFile7(
|
|
46578
|
+
const raw = await readFile7(path16.join(configDir, "settings.json"), "utf8");
|
|
45705
46579
|
const parsed = JSON.parse(raw);
|
|
45706
46580
|
if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed))
|
|
45707
46581
|
return {};
|
|
@@ -45833,11 +46707,11 @@ async function applyGatewayModelCatalog(snapshot, environment, dependencies = {}
|
|
|
45833
46707
|
}
|
|
45834
46708
|
|
|
45835
46709
|
// dist/process-fence.js
|
|
45836
|
-
import { execFile as
|
|
45837
|
-
import
|
|
46710
|
+
import { execFile as execFile3 } from "node:child_process";
|
|
46711
|
+
import path17 from "node:path";
|
|
45838
46712
|
import { setTimeout as setTimeout2 } from "node:timers/promises";
|
|
45839
46713
|
import { promisify } from "node:util";
|
|
45840
|
-
var executeFile = promisify(
|
|
46714
|
+
var executeFile = promisify(execFile3);
|
|
45841
46715
|
function signalGroup(pid, signal) {
|
|
45842
46716
|
try {
|
|
45843
46717
|
process.kill(-pid, signal);
|
|
@@ -45858,9 +46732,9 @@ async function closeClaudeProcessGroup(child, timeoutMs) {
|
|
|
45858
46732
|
if (child.exitCode !== null || child.signalCode !== null)
|
|
45859
46733
|
throw new Error("Claude process tree cannot be confirmed after its Windows root exited");
|
|
45860
46734
|
const root = process.env.SystemRoot ?? process.env.SYSTEMROOT;
|
|
45861
|
-
if (!root || !
|
|
46735
|
+
if (!root || !path17.win32.isAbsolute(root))
|
|
45862
46736
|
throw new Error("Windows SystemRoot is unavailable");
|
|
45863
|
-
await executeFile(
|
|
46737
|
+
await executeFile(path17.win32.join(root, "System32", "taskkill.exe"), ["/PID", String(pid), "/T", "/F"], {
|
|
45864
46738
|
timeout: timeoutMs,
|
|
45865
46739
|
windowsHide: true
|
|
45866
46740
|
});
|
|
@@ -45944,7 +46818,7 @@ function rejectAfter(milliseconds, message) {
|
|
|
45944
46818
|
function processExited(child) {
|
|
45945
46819
|
return child.exitCode !== null || child.signalCode !== null;
|
|
45946
46820
|
}
|
|
45947
|
-
function
|
|
46821
|
+
function isRecord8(value) {
|
|
45948
46822
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
45949
46823
|
}
|
|
45950
46824
|
function safeNonNegativeInteger2(value) {
|
|
@@ -45964,13 +46838,13 @@ function userMessageContent(input) {
|
|
|
45964
46838
|
return blocks;
|
|
45965
46839
|
}
|
|
45966
46840
|
function permissionModeFromMessage(value) {
|
|
45967
|
-
if (!
|
|
46841
|
+
if (!isRecord8(value) || value.type !== "system" || value.subtype !== "init" && value.subtype !== "status" || !("permissionMode" in value) || value.permissionMode === void 0) {
|
|
45968
46842
|
return void 0;
|
|
45969
46843
|
}
|
|
45970
46844
|
return isClaudePermissionMode(value.permissionMode) ? value.permissionMode : void 0;
|
|
45971
46845
|
}
|
|
45972
46846
|
function parseContextApiUsage(value) {
|
|
45973
|
-
if (!
|
|
46847
|
+
if (!isRecord8(value))
|
|
45974
46848
|
return void 0;
|
|
45975
46849
|
const inputTokens = value.input_tokens;
|
|
45976
46850
|
const outputTokens = value.output_tokens;
|
|
@@ -45982,16 +46856,16 @@ function parseContextApiUsage(value) {
|
|
|
45982
46856
|
return { inputTokens, outputTokens, cacheCreationInputTokens, cacheReadInputTokens };
|
|
45983
46857
|
}
|
|
45984
46858
|
function parseContextUsage(value) {
|
|
45985
|
-
if (!
|
|
46859
|
+
if (!isRecord8(value))
|
|
45986
46860
|
throw new Error("Claude SDK context Usage is invalid");
|
|
45987
46861
|
const usedTokens = value.totalTokens;
|
|
45988
46862
|
const maxTokens = value.maxTokens;
|
|
45989
|
-
const
|
|
45990
|
-
if (typeof usedTokens !== "number" || !Number.isSafeInteger(usedTokens) || usedTokens < 0 || typeof maxTokens !== "number" || !Number.isSafeInteger(maxTokens) || maxTokens <= 0 || typeof
|
|
46863
|
+
const model2 = value.model;
|
|
46864
|
+
if (typeof usedTokens !== "number" || !Number.isSafeInteger(usedTokens) || usedTokens < 0 || typeof maxTokens !== "number" || !Number.isSafeInteger(maxTokens) || maxTokens <= 0 || typeof model2 !== "string" || model2.trim().length === 0 || model2.length > 256) {
|
|
45991
46865
|
throw new Error("Claude SDK context Usage contains invalid values");
|
|
45992
46866
|
}
|
|
45993
46867
|
const apiUsage = parseContextApiUsage(value.apiUsage);
|
|
45994
|
-
return { usedTokens, maxTokens, model, ...apiUsage ? { apiUsage } : {} };
|
|
46868
|
+
return { usedTokens, maxTokens, model: model2, ...apiUsage ? { apiUsage } : {} };
|
|
45995
46869
|
}
|
|
45996
46870
|
function parseQuestions(input) {
|
|
45997
46871
|
if (!Array.isArray(input.questions) || input.questions.length < 1 || input.questions.length > 4) {
|
|
@@ -46000,7 +46874,7 @@ function parseQuestions(input) {
|
|
|
46000
46874
|
const questions = [];
|
|
46001
46875
|
const questionTexts = /* @__PURE__ */ new Set();
|
|
46002
46876
|
for (const value of input.questions) {
|
|
46003
|
-
if (!
|
|
46877
|
+
if (!isRecord8(value))
|
|
46004
46878
|
return null;
|
|
46005
46879
|
const question = value.question;
|
|
46006
46880
|
const header = value.header;
|
|
@@ -46011,7 +46885,7 @@ function parseQuestions(input) {
|
|
|
46011
46885
|
const labels = /* @__PURE__ */ new Set();
|
|
46012
46886
|
const options = [];
|
|
46013
46887
|
for (const option2 of value.options) {
|
|
46014
|
-
if (!
|
|
46888
|
+
if (!isRecord8(option2) || typeof option2.label !== "string" || option2.label.length === 0 || labels.has(option2.label) || typeof option2.description !== "string") {
|
|
46015
46889
|
return null;
|
|
46016
46890
|
}
|
|
46017
46891
|
labels.add(option2.label);
|
|
@@ -46025,8 +46899,8 @@ function parseQuestions(input) {
|
|
|
46025
46899
|
function boundedDisplayText(value, maxLength) {
|
|
46026
46900
|
if (typeof value !== "string")
|
|
46027
46901
|
return null;
|
|
46028
|
-
const
|
|
46029
|
-
return
|
|
46902
|
+
const text2 = value.trim();
|
|
46903
|
+
return text2.length > 0 && text2.length <= maxLength ? text2 : null;
|
|
46030
46904
|
}
|
|
46031
46905
|
var SESSION_PERMISSION_DESTINATIONS = /* @__PURE__ */ new Set(["session", "cliArg"]);
|
|
46032
46906
|
var PERSISTENT_PERMISSION_DESTINATIONS = /* @__PURE__ */ new Set([
|
|
@@ -46053,7 +46927,7 @@ function permissionUpdateDestination(value) {
|
|
|
46053
46927
|
return void 0;
|
|
46054
46928
|
}
|
|
46055
46929
|
function isPermissionUpdate(value) {
|
|
46056
|
-
if (!
|
|
46930
|
+
if (!isRecord8(value) || !permissionUpdateDestination(value.destination))
|
|
46057
46931
|
return false;
|
|
46058
46932
|
if (value.type === "setMode") {
|
|
46059
46933
|
return typeof value.mode === "string" && PERMISSION_MODES.has(value.mode);
|
|
@@ -46062,7 +46936,7 @@ function isPermissionUpdate(value) {
|
|
|
46062
46936
|
return Array.isArray(value.directories) && value.directories.every((directory) => typeof directory === "string");
|
|
46063
46937
|
}
|
|
46064
46938
|
if (value.type === "addRules" || value.type === "replaceRules" || value.type === "removeRules") {
|
|
46065
|
-
return typeof value.behavior === "string" && PERMISSION_BEHAVIORS.has(value.behavior) && Array.isArray(value.rules) && value.rules.every((rule) =>
|
|
46939
|
+
return typeof value.behavior === "string" && PERMISSION_BEHAVIORS.has(value.behavior) && Array.isArray(value.rules) && value.rules.every((rule) => isRecord8(rule) && typeof rule.toolName === "string" && (rule.ruleContent === void 0 || typeof rule.ruleContent === "string"));
|
|
46066
46940
|
}
|
|
46067
46941
|
return false;
|
|
46068
46942
|
}
|
|
@@ -46116,6 +46990,35 @@ function canDeliverSettlementImmediately(event, pendingEvents) {
|
|
|
46116
46990
|
return event.callId !== void 0 && pending.callId === event.callId || pending.nativeSubagentId === event.nativeSubagentId;
|
|
46117
46991
|
});
|
|
46118
46992
|
}
|
|
46993
|
+
function isRootOutput(event) {
|
|
46994
|
+
switch (event.type) {
|
|
46995
|
+
case "compaction.started":
|
|
46996
|
+
case "compaction.completed":
|
|
46997
|
+
case "text.delta":
|
|
46998
|
+
case "reasoning.delta":
|
|
46999
|
+
case "reasoning.completed":
|
|
47000
|
+
case "message.completed":
|
|
47001
|
+
case "tool.started":
|
|
47002
|
+
case "tool.progress":
|
|
47003
|
+
case "tool.completed":
|
|
47004
|
+
case "subagent.started":
|
|
47005
|
+
case "subagent.completed":
|
|
47006
|
+
case "interaction.requested":
|
|
47007
|
+
case "interaction.closed":
|
|
47008
|
+
case "usage.result":
|
|
47009
|
+
return true;
|
|
47010
|
+
case "usage.request":
|
|
47011
|
+
case "segment.started":
|
|
47012
|
+
case "subagents.live":
|
|
47013
|
+
case "subagent.updated":
|
|
47014
|
+
case "subagent.settled":
|
|
47015
|
+
case "subagent.transcript.changed":
|
|
47016
|
+
return false;
|
|
47017
|
+
default:
|
|
47018
|
+
event;
|
|
47019
|
+
return false;
|
|
47020
|
+
}
|
|
47021
|
+
}
|
|
46119
47022
|
var ClaudeSdkTransport = class {
|
|
46120
47023
|
sessionId;
|
|
46121
47024
|
#children = [];
|
|
@@ -46239,7 +47142,7 @@ var ClaudeSdkTransport = class {
|
|
|
46239
47142
|
return { commands: this.#slashCommands, skillNames: this.#skillNames };
|
|
46240
47143
|
}
|
|
46241
47144
|
#observeSlashCommands(message) {
|
|
46242
|
-
if (!
|
|
47145
|
+
if (!isRecord8(message) || message.type !== "system")
|
|
46243
47146
|
return;
|
|
46244
47147
|
if (message.subtype === "init" && Array.isArray(message.skills)) {
|
|
46245
47148
|
this.#skillNames = new Set(message.skills.filter((name) => typeof name === "string"));
|
|
@@ -46258,11 +47161,11 @@ var ClaudeSdkTransport = class {
|
|
|
46258
47161
|
throw new Error("Claude SDK transport is not started");
|
|
46259
47162
|
return this.#permissionMode;
|
|
46260
47163
|
}
|
|
46261
|
-
async setModel(
|
|
47164
|
+
async setModel(model2) {
|
|
46262
47165
|
const activeQuery = this.#query;
|
|
46263
47166
|
if (!this.#started || !activeQuery)
|
|
46264
47167
|
throw new Error("Claude SDK transport is not started");
|
|
46265
|
-
await activeQuery.setModel(
|
|
47168
|
+
await activeQuery.setModel(model2);
|
|
46266
47169
|
}
|
|
46267
47170
|
async setThinkingOption(thinkingOptionId) {
|
|
46268
47171
|
const activeQuery = this.#query;
|
|
@@ -46293,8 +47196,11 @@ var ClaudeSdkTransport = class {
|
|
|
46293
47196
|
if (this.#closePromise || !this.#started || !this.#query) {
|
|
46294
47197
|
return Promise.reject(new Error("Claude SDK transport is not started"));
|
|
46295
47198
|
}
|
|
46296
|
-
if (this.#active)
|
|
47199
|
+
if (this.#active || this.#autonomous?.live) {
|
|
46297
47200
|
return Promise.reject(new Error("Claude SDK transport is busy"));
|
|
47201
|
+
}
|
|
47202
|
+
const unclaimed = this.#autonomous?.events ?? [];
|
|
47203
|
+
this.#autonomous = null;
|
|
46298
47204
|
const promise2 = new Promise((resolve2, reject) => {
|
|
46299
47205
|
this.#active = {
|
|
46300
47206
|
accumulator: new ClaudeNativeTurnAccumulator(this.#provider ? { provider: this.#provider } : {}),
|
|
@@ -46305,6 +47211,8 @@ var ClaudeSdkTransport = class {
|
|
|
46305
47211
|
reject
|
|
46306
47212
|
};
|
|
46307
47213
|
});
|
|
47214
|
+
for (const event of unclaimed)
|
|
47215
|
+
onEvent(event);
|
|
46308
47216
|
this.#input.push({
|
|
46309
47217
|
type: "user",
|
|
46310
47218
|
message: { role: "user", content: userMessageContent(input) },
|
|
@@ -46364,11 +47272,11 @@ var ClaudeSdkTransport = class {
|
|
|
46364
47272
|
return Promise.resolve();
|
|
46365
47273
|
}
|
|
46366
47274
|
async abort() {
|
|
46367
|
-
const
|
|
47275
|
+
const accumulator = this.#active?.accumulator ?? (this.#autonomous?.live ? this.#autonomous.accumulator : null);
|
|
46368
47276
|
const activeQuery = this.#query;
|
|
46369
|
-
if (!
|
|
47277
|
+
if (!accumulator || !activeQuery)
|
|
46370
47278
|
throw new Error("Claude SDK transport has no active Turn");
|
|
46371
|
-
|
|
47279
|
+
accumulator.requestCancel();
|
|
46372
47280
|
try {
|
|
46373
47281
|
await this.#stopRequest(activeQuery.interrupt(), INTERRUPT_TIMEOUT_MESSAGE);
|
|
46374
47282
|
} catch (error52) {
|
|
@@ -46538,16 +47446,23 @@ var ClaudeSdkTransport = class {
|
|
|
46538
47446
|
}
|
|
46539
47447
|
}
|
|
46540
47448
|
#observeBackgroundTasks(message) {
|
|
46541
|
-
if (!
|
|
47449
|
+
if (!isRecord8(message) || message.type !== "system")
|
|
46542
47450
|
return;
|
|
46543
47451
|
if (message.subtype === "background_tasks_changed" && Array.isArray(message.tasks)) {
|
|
46544
|
-
this.#backgroundTasks = new Set(message.tasks.flatMap((task) =>
|
|
47452
|
+
this.#backgroundTasks = new Set(message.tasks.flatMap((task) => isRecord8(task) && typeof task.task_id === "string" ? [task.task_id] : []));
|
|
46545
47453
|
} else if (message.subtype === "task_started" && typeof message.task_id === "string") {
|
|
46546
47454
|
this.#backgroundTasks.add(message.task_id);
|
|
46547
47455
|
} else if (message.subtype === "task_notification" && typeof message.task_id === "string" && ["completed", "failed", "stopped"].includes(String(message.status))) {
|
|
46548
47456
|
this.#backgroundTasks.delete(message.task_id);
|
|
46549
47457
|
}
|
|
46550
47458
|
}
|
|
47459
|
+
/** Starts the Segment's autonomous Turn and releases the events it held, in native order. */
|
|
47460
|
+
#startAutonomousTurn(autonomous, handler) {
|
|
47461
|
+
autonomous.live = true;
|
|
47462
|
+
handler.start(autonomous.nativeTurnKey ?? `autonomous-${Date.now()}`);
|
|
47463
|
+
for (const event of autonomous.events.splice(0))
|
|
47464
|
+
handler.onEvent(event);
|
|
47465
|
+
}
|
|
46551
47466
|
async #consume(activeQuery) {
|
|
46552
47467
|
try {
|
|
46553
47468
|
for await (const message of activeQuery) {
|
|
@@ -46584,36 +47499,35 @@ var ClaudeSdkTransport = class {
|
|
|
46584
47499
|
}
|
|
46585
47500
|
continue;
|
|
46586
47501
|
}
|
|
46587
|
-
|
|
47502
|
+
const handler = this.#autonomousTurnHandler;
|
|
47503
|
+
if (!handler)
|
|
46588
47504
|
continue;
|
|
46589
|
-
const observedAtMs = Date.now();
|
|
46590
47505
|
const autonomous = this.#autonomous ?? (this.#autonomous = {
|
|
46591
47506
|
accumulator: new ClaudeNativeTurnAccumulator(this.#provider ? { provider: this.#provider } : {}),
|
|
46592
47507
|
events: [],
|
|
46593
47508
|
nativeTurnKey: null,
|
|
46594
|
-
|
|
47509
|
+
live: false
|
|
46595
47510
|
});
|
|
46596
|
-
if (autonomous.nativeTurnKey === null &&
|
|
47511
|
+
if (autonomous.nativeTurnKey === null && isRecord8(message) && message.type === "user" && (message.parent_tool_use_id === null || message.parent_tool_use_id === void 0) && typeof message.uuid === "string" && message.uuid.length > 0) {
|
|
46597
47512
|
autonomous.nativeTurnKey = message.uuid;
|
|
46598
47513
|
}
|
|
46599
47514
|
const interpreted = autonomous.accumulator.consume(message);
|
|
46600
47515
|
for (const event of interpreted.events) {
|
|
46601
|
-
if (
|
|
47516
|
+
if (autonomous.live) {
|
|
47517
|
+
handler.onEvent(event);
|
|
47518
|
+
} else if (this.#threadEventHandler && canDeliverSettlementImmediately(event, autonomous.events)) {
|
|
46602
47519
|
this.#threadEventHandler(event);
|
|
46603
|
-
|
|
47520
|
+
} else {
|
|
47521
|
+
autonomous.events.push(event);
|
|
47522
|
+
if (isRootOutput(event))
|
|
47523
|
+
this.#startAutonomousTurn(autonomous, handler);
|
|
46604
47524
|
}
|
|
46605
|
-
autonomous.events.push({ ...event, observedAtMs });
|
|
46606
47525
|
}
|
|
46607
47526
|
if (interpreted.terminal) {
|
|
46608
47527
|
this.#autonomous = null;
|
|
46609
|
-
|
|
46610
|
-
|
|
46611
|
-
|
|
46612
|
-
events: autonomous.events,
|
|
46613
|
-
result: interpreted.terminal,
|
|
46614
|
-
startedAtMs: autonomous.startedAtMs,
|
|
46615
|
-
completedAtMs: observedAtMs
|
|
46616
|
-
});
|
|
47528
|
+
if (!autonomous.live)
|
|
47529
|
+
this.#startAutonomousTurn(autonomous, handler);
|
|
47530
|
+
handler.onTerminal(interpreted.terminal);
|
|
46617
47531
|
}
|
|
46618
47532
|
}
|
|
46619
47533
|
if (!this.#closePromise)
|
|
@@ -46942,11 +47856,11 @@ var ClaudeSubagentLifecycle = class {
|
|
|
46942
47856
|
};
|
|
46943
47857
|
|
|
46944
47858
|
// dist/task-tracker.js
|
|
46945
|
-
function
|
|
47859
|
+
function isRecord9(value) {
|
|
46946
47860
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
46947
47861
|
}
|
|
46948
47862
|
function stringField(value, keys) {
|
|
46949
|
-
if (!
|
|
47863
|
+
if (!isRecord9(value))
|
|
46950
47864
|
return void 0;
|
|
46951
47865
|
for (const key of keys) {
|
|
46952
47866
|
const field = value[key];
|
|
@@ -46981,7 +47895,7 @@ var ClaudeTaskTracker = class {
|
|
|
46981
47895
|
};
|
|
46982
47896
|
}
|
|
46983
47897
|
#create(args, result) {
|
|
46984
|
-
if (!
|
|
47898
|
+
if (!isRecord9(result) || !isRecord9(result.task))
|
|
46985
47899
|
return;
|
|
46986
47900
|
const id = stringField(result.task, ["id"]);
|
|
46987
47901
|
const subject = stringField(args, ["subject"]) ?? stringField(result.task, ["subject"]);
|
|
@@ -46999,7 +47913,7 @@ var ClaudeTaskTracker = class {
|
|
|
46999
47913
|
const id = stringField(args, ["taskId", "id", "task_id"]);
|
|
47000
47914
|
if (!id)
|
|
47001
47915
|
return;
|
|
47002
|
-
const status =
|
|
47916
|
+
const status = isRecord9(args) ? taskStatus2(args.status) : void 0;
|
|
47003
47917
|
if (status === "deleted") {
|
|
47004
47918
|
this.#tasks.delete(id);
|
|
47005
47919
|
return;
|
|
@@ -47017,13 +47931,13 @@ var ClaudeTaskTracker = class {
|
|
|
47017
47931
|
});
|
|
47018
47932
|
}
|
|
47019
47933
|
#replace(result) {
|
|
47020
|
-
if (!
|
|
47934
|
+
if (!isRecord9(result) || !Array.isArray(result.tasks))
|
|
47021
47935
|
return;
|
|
47022
47936
|
const next = /* @__PURE__ */ new Map();
|
|
47023
47937
|
for (const value of result.tasks) {
|
|
47024
47938
|
const id = stringField(value, ["id"]);
|
|
47025
47939
|
const subject = stringField(value, ["subject"]);
|
|
47026
|
-
const status =
|
|
47940
|
+
const status = isRecord9(value) ? taskStatus2(value.status) : void 0;
|
|
47027
47941
|
if (!id || !subject || !status || status === "deleted")
|
|
47028
47942
|
continue;
|
|
47029
47943
|
const existing = this.#tasks.get(id);
|
|
@@ -47071,7 +47985,7 @@ var ClaudeBackgroundCommandItems = class {
|
|
|
47071
47985
|
this.#outputLimit = options.outputLimit;
|
|
47072
47986
|
}
|
|
47073
47987
|
taskIds() {
|
|
47074
|
-
return [...this.#commands.values()].
|
|
47988
|
+
return [...this.#commands.values()].flatMap(({ command, outcome }) => outcome ? [] : [command.taskId]);
|
|
47075
47989
|
}
|
|
47076
47990
|
follow(command) {
|
|
47077
47991
|
const followed = {
|
|
@@ -47084,6 +47998,7 @@ var ClaudeBackgroundCommandItems = class {
|
|
|
47084
47998
|
truncated: false,
|
|
47085
47999
|
timer: null,
|
|
47086
48000
|
reading: Promise.resolve(),
|
|
48001
|
+
outcome: void 0,
|
|
47087
48002
|
completed: false
|
|
47088
48003
|
};
|
|
47089
48004
|
this.#commands.set(command.callId, followed);
|
|
@@ -47092,24 +48007,25 @@ var ClaudeBackgroundCommandItems = class {
|
|
|
47092
48007
|
followed.timer.unref();
|
|
47093
48008
|
}
|
|
47094
48009
|
}
|
|
47095
|
-
/** Returns whether the notification
|
|
48010
|
+
/** Returns whether the notification belongs to a followed command. */
|
|
47096
48011
|
settle(notification) {
|
|
47097
48012
|
const followed = notification.callId ? this.#commands.get(notification.callId) : void 0;
|
|
47098
48013
|
if (!followed)
|
|
47099
48014
|
return false;
|
|
47100
|
-
|
|
48015
|
+
if (followed.outcome)
|
|
48016
|
+
return true;
|
|
48017
|
+
const outcome = notificationOutcome(notification.status);
|
|
48018
|
+
followed.outcome = outcome;
|
|
47101
48019
|
if (followed.timer)
|
|
47102
48020
|
clearInterval(followed.timer);
|
|
47103
48021
|
followed.outputFile ??= notification.outputFile;
|
|
47104
|
-
void this.#poll(followed).then(() => this.#complete(followed,
|
|
48022
|
+
void this.#poll(followed).then(() => this.#complete(followed, outcome));
|
|
47105
48023
|
return true;
|
|
47106
48024
|
}
|
|
47107
48025
|
/** The native process is gone; no notification can arrive any more. */
|
|
47108
48026
|
abandonAll(reason) {
|
|
47109
48027
|
for (const followed of this.#commands.values()) {
|
|
47110
|
-
|
|
47111
|
-
clearInterval(followed.timer);
|
|
47112
|
-
this.#complete(followed, { status: "cancelled", reason });
|
|
48028
|
+
this.#complete(followed, followed.outcome ?? { status: "cancelled", reason });
|
|
47113
48029
|
}
|
|
47114
48030
|
this.#commands.clear();
|
|
47115
48031
|
}
|
|
@@ -47118,7 +48034,7 @@ var ClaudeBackgroundCommandItems = class {
|
|
|
47118
48034
|
return followed.reading;
|
|
47119
48035
|
}
|
|
47120
48036
|
async #read(followed) {
|
|
47121
|
-
if (!followed.outputFile || followed.truncated)
|
|
48037
|
+
if (!followed.outputFile || followed.truncated || followed.completed)
|
|
47122
48038
|
return;
|
|
47123
48039
|
let handle;
|
|
47124
48040
|
try {
|
|
@@ -47129,8 +48045,10 @@ var ClaudeBackgroundCommandItems = class {
|
|
|
47129
48045
|
followed.opened = true;
|
|
47130
48046
|
try {
|
|
47131
48047
|
const buffer = Buffer.alloc(READ_CHUNK_BYTES);
|
|
47132
|
-
|
|
48048
|
+
while (!followed.completed) {
|
|
47133
48049
|
const { bytesRead } = await handle.read(buffer, 0, buffer.length, followed.offset);
|
|
48050
|
+
if (followed.completed)
|
|
48051
|
+
return;
|
|
47134
48052
|
if (bytesRead === 0)
|
|
47135
48053
|
return;
|
|
47136
48054
|
followed.offset += bytesRead;
|
|
@@ -47144,12 +48062,12 @@ var ClaudeBackgroundCommandItems = class {
|
|
|
47144
48062
|
await handle.close().catch(() => void 0);
|
|
47145
48063
|
}
|
|
47146
48064
|
}
|
|
47147
|
-
#append(followed,
|
|
47148
|
-
if (
|
|
48065
|
+
#append(followed, text2) {
|
|
48066
|
+
if (text2.length === 0 || followed.completed)
|
|
47149
48067
|
return;
|
|
47150
48068
|
const room = this.#outputLimit - followed.output.length;
|
|
47151
|
-
const accepted =
|
|
47152
|
-
if (
|
|
48069
|
+
const accepted = text2.length > room ? text2.slice(0, Math.max(0, room)) : text2;
|
|
48070
|
+
if (text2.length > room)
|
|
47153
48071
|
followed.truncated = true;
|
|
47154
48072
|
if (accepted.length === 0)
|
|
47155
48073
|
return;
|
|
@@ -47162,8 +48080,13 @@ var ClaudeBackgroundCommandItems = class {
|
|
|
47162
48080
|
});
|
|
47163
48081
|
}
|
|
47164
48082
|
#complete(followed, outcome) {
|
|
48083
|
+
if (followed.completed)
|
|
48084
|
+
return;
|
|
47165
48085
|
const { command } = followed;
|
|
47166
48086
|
followed.completed = true;
|
|
48087
|
+
if (followed.timer)
|
|
48088
|
+
clearInterval(followed.timer);
|
|
48089
|
+
this.#commands.delete(command.callId);
|
|
47167
48090
|
const output = followed.output.length > 0 ? followed.output : followed.opened ? void 0 : UNAVAILABLE_OUTPUT;
|
|
47168
48091
|
this.#emit({
|
|
47169
48092
|
type: "item.completed",
|
|
@@ -47181,11 +48104,11 @@ var ClaudeBackgroundCommandItems = class {
|
|
|
47181
48104
|
};
|
|
47182
48105
|
|
|
47183
48106
|
// dist/tool-lifecycle.js
|
|
47184
|
-
function
|
|
48107
|
+
function isRecord10(value) {
|
|
47185
48108
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
47186
48109
|
}
|
|
47187
48110
|
function stringField2(value, key) {
|
|
47188
|
-
return
|
|
48111
|
+
return isRecord10(value) && typeof value[key] === "string" ? value[key] : void 0;
|
|
47189
48112
|
}
|
|
47190
48113
|
function toolFailure(toolName) {
|
|
47191
48114
|
return {
|
|
@@ -47194,17 +48117,17 @@ function toolFailure(toolName) {
|
|
|
47194
48117
|
retryable: false
|
|
47195
48118
|
};
|
|
47196
48119
|
}
|
|
47197
|
-
function boundedToolOutput(
|
|
47198
|
-
if (!
|
|
48120
|
+
function boundedToolOutput(text2, limit) {
|
|
48121
|
+
if (!text2 || text2.length === 0)
|
|
47199
48122
|
return void 0;
|
|
47200
|
-
const truncated =
|
|
48123
|
+
const truncated = text2.length > limit;
|
|
47201
48124
|
return {
|
|
47202
|
-
content: [{ type: "text", text: truncated ?
|
|
48125
|
+
content: [{ type: "text", text: truncated ? text2.slice(0, limit) : text2 }],
|
|
47203
48126
|
...truncated ? { truncated: true } : {}
|
|
47204
48127
|
};
|
|
47205
48128
|
}
|
|
47206
48129
|
function toolOutputText(output) {
|
|
47207
|
-
return output?.content.filter((content) => content.type === "text").map(({ text }) =>
|
|
48130
|
+
return output?.content.filter((content) => content.type === "text").map(({ text: text2 }) => text2).join("") ?? "";
|
|
47208
48131
|
}
|
|
47209
48132
|
var ClaudeToolLifecycle = class {
|
|
47210
48133
|
#cwd;
|
|
@@ -47330,11 +48253,11 @@ var ClaudeToolLifecycle = class {
|
|
|
47330
48253
|
|
|
47331
48254
|
// dist/usage-estimate.js
|
|
47332
48255
|
var PER_MILLION = 1e6;
|
|
47333
|
-
function normalizedModel(
|
|
47334
|
-
return
|
|
48256
|
+
function normalizedModel(model2) {
|
|
48257
|
+
return model2.trim().toLowerCase().replaceAll("_", "-");
|
|
47335
48258
|
}
|
|
47336
|
-
function firstPartyPrice(
|
|
47337
|
-
const value = normalizedModel(
|
|
48259
|
+
function firstPartyPrice(model2) {
|
|
48260
|
+
const value = normalizedModel(model2);
|
|
47338
48261
|
if (/claude-opus-(?:5|4-(?:5|6|7|8))(?:-|$)/u.test(value)) {
|
|
47339
48262
|
return { input: 5, cacheWrite: 6.25, cacheRead: 0.5, output: 25 };
|
|
47340
48263
|
}
|
|
@@ -47451,7 +48374,7 @@ var CONTEXT_USAGE_TTL_MS = 1e4;
|
|
|
47451
48374
|
var CONTEXT_USAGE_FAILURE_COOLDOWN_MS = 5e3;
|
|
47452
48375
|
var REQUEST_USAGE_RETRY_DELAYS_MS = [0, 100, 250, 500, 1e3];
|
|
47453
48376
|
var DEFAULT_CONTINUATION_QUIESCENCE_MS = 2e3;
|
|
47454
|
-
function
|
|
48377
|
+
function isRecord11(value) {
|
|
47455
48378
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
47456
48379
|
}
|
|
47457
48380
|
function safeNonNegativeInteger3(value) {
|
|
@@ -47460,7 +48383,7 @@ function safeNonNegativeInteger3(value) {
|
|
|
47460
48383
|
function transcriptRequestUsage(messages, messageId) {
|
|
47461
48384
|
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
47462
48385
|
const entry = messages[index];
|
|
47463
|
-
if (!
|
|
48386
|
+
if (!isRecord11(entry) || entry.type !== "assistant" || entry.parent_tool_use_id !== null && entry.parent_tool_use_id !== void 0 || !isRecord11(entry.message) || entry.message.id !== messageId || !isRecord11(entry.message.usage)) {
|
|
47464
48387
|
continue;
|
|
47465
48388
|
}
|
|
47466
48389
|
const inputTokens = entry.message.usage.input_tokens;
|
|
@@ -47509,8 +48432,8 @@ function startupFailure(error52) {
|
|
|
47509
48432
|
if (error52 instanceof ClaudeCodeExecutableError) {
|
|
47510
48433
|
return { code: "notInstalled", message: error52.message, retryable: false };
|
|
47511
48434
|
}
|
|
47512
|
-
const
|
|
47513
|
-
if (
|
|
48435
|
+
const text2 = error52 instanceof Error ? error52.message.toLowerCase() : "";
|
|
48436
|
+
if (text2.includes("not logged in") || text2.includes("authentication") || text2.includes("api key")) {
|
|
47514
48437
|
return {
|
|
47515
48438
|
code: "authenticationRequired",
|
|
47516
48439
|
message: "Claude Code authentication is required",
|
|
@@ -47555,9 +48478,10 @@ function claudePermissionModeSelectionFailure(permissionMode, error52) {
|
|
|
47555
48478
|
};
|
|
47556
48479
|
}
|
|
47557
48480
|
}
|
|
48481
|
+
const detail = sanitizeDiagnosticTail(error52 instanceof Error ? error52.message : String(error52));
|
|
47558
48482
|
return {
|
|
47559
48483
|
code: "nativeFailure",
|
|
47560
|
-
message:
|
|
48484
|
+
message: `Claude Code rejected the Permission Mode selection${detail ? `: ${detail}` : ""}`,
|
|
47561
48485
|
retryable: true
|
|
47562
48486
|
};
|
|
47563
48487
|
}
|
|
@@ -47684,12 +48608,8 @@ var ClaudeHarnessSession = class {
|
|
|
47684
48608
|
#contextUsageCooldownUntilMs = 0;
|
|
47685
48609
|
#requestUsageBoundary = 0;
|
|
47686
48610
|
#autonomousOrdinal = 0;
|
|
47687
|
-
/**
|
|
47688
|
-
|
|
47689
|
-
* from a buffered autonomous Turn; null during live delivery. Read by the Item
|
|
47690
|
-
* lifecycle to stamp replayed reasoning/agentMessage durations.
|
|
47691
|
-
*/
|
|
47692
|
-
#replayObservedAtMs = null;
|
|
48611
|
+
/** The Host Turn that receives the native Segment Claude started on its own. */
|
|
48612
|
+
#autonomousTarget = null;
|
|
47693
48613
|
#occupancy = new ClaudeBackgroundOccupancy();
|
|
47694
48614
|
#cancelEscalation = null;
|
|
47695
48615
|
#continuationQuiescence = null;
|
|
@@ -47738,6 +48658,13 @@ var ClaudeHarnessSession = class {
|
|
|
47738
48658
|
this.#state = this.initialState;
|
|
47739
48659
|
this.#statePublished = durable;
|
|
47740
48660
|
this.outputs = this.#channel.outputs;
|
|
48661
|
+
for (const request of options.usageHistory.requests) {
|
|
48662
|
+
this.#event({ type: "usage.request", request });
|
|
48663
|
+
}
|
|
48664
|
+
this.#event({ type: "usage.history", complete: options.usageHistory.complete });
|
|
48665
|
+
}
|
|
48666
|
+
get nativeWriterRef() {
|
|
48667
|
+
return this.#nativeRef;
|
|
47741
48668
|
}
|
|
47742
48669
|
async readSnapshot() {
|
|
47743
48670
|
if (this.#phase !== "open") {
|
|
@@ -47764,8 +48691,8 @@ var ClaudeHarnessSession = class {
|
|
|
47764
48691
|
messages = await this.#readSessionMessages({
|
|
47765
48692
|
cwd: this.#cwd,
|
|
47766
48693
|
sessionId: this.#sessionId
|
|
47767
|
-
});
|
|
47768
|
-
const ids = new Set(messages.flatMap((message) =>
|
|
48694
|
+
}) ?? [];
|
|
48695
|
+
const ids = new Set(messages.flatMap((message) => isRecord11(message) && typeof message.uuid === "string" ? [message.uuid] : []));
|
|
47769
48696
|
if (this.#unpersistedMessageIds.every((id) => ids.has(id))) {
|
|
47770
48697
|
this.#unpersistedMessageIds = [];
|
|
47771
48698
|
break;
|
|
@@ -47870,8 +48797,8 @@ var ClaudeHarnessSession = class {
|
|
|
47870
48797
|
textParts2.push(part.text);
|
|
47871
48798
|
}
|
|
47872
48799
|
}
|
|
47873
|
-
const
|
|
47874
|
-
if (
|
|
48800
|
+
const text2 = textParts2.join("\n");
|
|
48801
|
+
if (text2.length === 0 && imageParts.length === 0) {
|
|
47875
48802
|
return {
|
|
47876
48803
|
ok: false,
|
|
47877
48804
|
error: {
|
|
@@ -47881,7 +48808,7 @@ var ClaudeHarnessSession = class {
|
|
|
47881
48808
|
}
|
|
47882
48809
|
};
|
|
47883
48810
|
}
|
|
47884
|
-
const turnInput = imageParts.length === 0 ?
|
|
48811
|
+
const turnInput = imageParts.length === 0 ? text2 : [...text2.length > 0 ? [{ type: "text", text: text2 }] : [], ...imageParts];
|
|
47885
48812
|
this.#acceptingTurn = true;
|
|
47886
48813
|
const startingTransport = this.#transport === null;
|
|
47887
48814
|
let transport;
|
|
@@ -47895,6 +48822,16 @@ var ClaudeHarnessSession = class {
|
|
|
47895
48822
|
if (this.#phase !== "open") {
|
|
47896
48823
|
return { ok: false, error: invalidState("Claude Code Session closed during startup") };
|
|
47897
48824
|
}
|
|
48825
|
+
if (this.#active) {
|
|
48826
|
+
return {
|
|
48827
|
+
ok: false,
|
|
48828
|
+
error: {
|
|
48829
|
+
code: "sessionBusy",
|
|
48830
|
+
message: "Claude Code Session already has an active Turn",
|
|
48831
|
+
retryable: true
|
|
48832
|
+
}
|
|
48833
|
+
};
|
|
48834
|
+
}
|
|
47898
48835
|
if (startingTransport)
|
|
47899
48836
|
this.#publishState();
|
|
47900
48837
|
this.#usageGeneration += 1;
|
|
@@ -48011,6 +48948,16 @@ var ClaudeHarnessSession = class {
|
|
|
48011
48948
|
if (this.#phase !== "open") {
|
|
48012
48949
|
return { ok: false, error: invalidState("Claude Code Session closed during startup") };
|
|
48013
48950
|
}
|
|
48951
|
+
if (this.#active) {
|
|
48952
|
+
return {
|
|
48953
|
+
ok: false,
|
|
48954
|
+
error: {
|
|
48955
|
+
code: "sessionBusy",
|
|
48956
|
+
message: "Claude Code Session already has an active operation",
|
|
48957
|
+
retryable: true
|
|
48958
|
+
}
|
|
48959
|
+
};
|
|
48960
|
+
}
|
|
48014
48961
|
if (startingTransport)
|
|
48015
48962
|
this.#publishState();
|
|
48016
48963
|
this.#usageGeneration += 1;
|
|
@@ -48161,9 +49108,9 @@ var ClaudeHarnessSession = class {
|
|
|
48161
49108
|
}
|
|
48162
49109
|
};
|
|
48163
49110
|
}
|
|
48164
|
-
let
|
|
49111
|
+
let model2;
|
|
48165
49112
|
try {
|
|
48166
|
-
|
|
49113
|
+
model2 = decodeClaudeModelRef(command.model);
|
|
48167
49114
|
} catch {
|
|
48168
49115
|
return {
|
|
48169
49116
|
ok: false,
|
|
@@ -48185,7 +49132,7 @@ var ClaudeHarnessSession = class {
|
|
|
48185
49132
|
const transport = this.#transport;
|
|
48186
49133
|
if (transport) {
|
|
48187
49134
|
try {
|
|
48188
|
-
const sessionModel = claudeSessionModel(
|
|
49135
|
+
const sessionModel = claudeSessionModel(model2, await this.#longContextEnabled());
|
|
48189
49136
|
await transport.setModel(sessionModel);
|
|
48190
49137
|
this.#sdkModel = sessionModel;
|
|
48191
49138
|
} catch {
|
|
@@ -48526,8 +49473,8 @@ var ClaudeHarnessSession = class {
|
|
|
48526
49473
|
throw new Error("Claude Code Session closed during startup");
|
|
48527
49474
|
}
|
|
48528
49475
|
const selectedModel = this.#requestedModel ?? (this.#openMode === "create" ? CLAUDE_DEFAULT_MODEL_REF : void 0);
|
|
48529
|
-
const
|
|
48530
|
-
this.#sdkModel =
|
|
49476
|
+
const model2 = claudeSessionModel(selectedModel ? decodeClaudeModelRef(selectedModel) : void 0, await this.#longContextEnabled());
|
|
49477
|
+
this.#sdkModel = model2;
|
|
48531
49478
|
const permissionMode = decodeClaudePermissionModeId(this.#requestedPermissionModeId);
|
|
48532
49479
|
let transport;
|
|
48533
49480
|
try {
|
|
@@ -48535,7 +49482,7 @@ var ClaudeHarnessSession = class {
|
|
|
48535
49482
|
cwd: this.#cwd,
|
|
48536
49483
|
sessionId: this.#sessionId,
|
|
48537
49484
|
openMode: this.#openMode,
|
|
48538
|
-
...
|
|
49485
|
+
...model2 ? { model: model2 } : {},
|
|
48539
49486
|
thinkingOptionId: this.#requestedThinkingOptionId,
|
|
48540
49487
|
permissionMode,
|
|
48541
49488
|
allowDangerouslySkipPermissions: this.#bypassPermissionsAvailable,
|
|
@@ -48544,21 +49491,24 @@ var ClaudeHarnessSession = class {
|
|
|
48544
49491
|
onPlanLimit: (planLimit) => this.#handlePlanLimit(planLimit)
|
|
48545
49492
|
});
|
|
48546
49493
|
this.#transport = transport;
|
|
48547
|
-
transport.setAutonomousTurnHandler(
|
|
49494
|
+
transport.setAutonomousTurnHandler({
|
|
49495
|
+
start: (nativeTurnKey) => {
|
|
49496
|
+
this.#autonomousTarget = this.#startAutonomousTurn(nativeTurnKey);
|
|
49497
|
+
},
|
|
49498
|
+
onEvent: (event) => this.#deliverLiveEvent(this.#autonomousTarget, event),
|
|
49499
|
+
onTerminal: (result) => {
|
|
49500
|
+
const target = this.#autonomousTarget;
|
|
49501
|
+
this.#autonomousTarget = null;
|
|
49502
|
+
if (target)
|
|
49503
|
+
this.#finishResult(target, result);
|
|
49504
|
+
}
|
|
49505
|
+
});
|
|
48548
49506
|
transport.setThreadEventHandler((event) => {
|
|
48549
49507
|
if (event.type === "subagent.settled")
|
|
48550
49508
|
this.#settleNativeTask(event);
|
|
48551
49509
|
});
|
|
48552
49510
|
transport.setIdleTurnHandler({
|
|
48553
|
-
onEvent: (event) =>
|
|
48554
|
-
const active = this.#active;
|
|
48555
|
-
if (active) {
|
|
48556
|
-
this.#handleTurnEvent(active, event);
|
|
48557
|
-
return;
|
|
48558
|
-
}
|
|
48559
|
-
if (event.type === "subagent.settled")
|
|
48560
|
-
this.#settleNativeTask(event);
|
|
48561
|
-
},
|
|
49511
|
+
onEvent: (event) => this.#deliverLiveEvent(this.#active, event),
|
|
48562
49512
|
onTerminal: (result) => {
|
|
48563
49513
|
const active = this.#active;
|
|
48564
49514
|
if (active)
|
|
@@ -48635,6 +49585,11 @@ var ClaudeHarnessSession = class {
|
|
|
48635
49585
|
this.#publishState({ ...this.#state, effectivePermissionModeId });
|
|
48636
49586
|
}
|
|
48637
49587
|
#handleTurnEvent(active, event) {
|
|
49588
|
+
if (event.type === "usage.request") {
|
|
49589
|
+
if (this.#phase !== "closed" && this.#phase !== "faulted")
|
|
49590
|
+
this.#meterUsage(event.record);
|
|
49591
|
+
return;
|
|
49592
|
+
}
|
|
48638
49593
|
if (this.#active !== active || this.#phase === "closed" || this.#phase === "faulted")
|
|
48639
49594
|
return;
|
|
48640
49595
|
switch (event.type) {
|
|
@@ -48758,6 +49713,13 @@ var ClaudeHarnessSession = class {
|
|
|
48758
49713
|
return;
|
|
48759
49714
|
}
|
|
48760
49715
|
}
|
|
49716
|
+
/** Publishes one live request to Host metering; an unusable one marks history incomplete. */
|
|
49717
|
+
#meterUsage(record2) {
|
|
49718
|
+
if (record2.kind === "request")
|
|
49719
|
+
this.#event({ type: "usage.request", request: record2.request });
|
|
49720
|
+
else
|
|
49721
|
+
this.#event({ type: "usage.history", complete: false });
|
|
49722
|
+
}
|
|
48761
49723
|
#startCompaction(active) {
|
|
48762
49724
|
if (active.compactionItem)
|
|
48763
49725
|
throw new Error("Claude Code Compaction started more than once");
|
|
@@ -48909,8 +49871,8 @@ var ClaudeHarnessSession = class {
|
|
|
48909
49871
|
this.#activateAssistantMessage(active, messageId);
|
|
48910
49872
|
if (!active.item)
|
|
48911
49873
|
throw new Error("Claude Assistant text has no active Item");
|
|
48912
|
-
if (active.agentMessageStartedAtMs === null
|
|
48913
|
-
active.agentMessageStartedAtMs =
|
|
49874
|
+
if (active.agentMessageStartedAtMs === null) {
|
|
49875
|
+
active.agentMessageStartedAtMs = Date.now();
|
|
48914
49876
|
}
|
|
48915
49877
|
active.item = { ...active.item, text: active.item.text + delta };
|
|
48916
49878
|
this.#event({
|
|
@@ -48926,7 +49888,7 @@ var ClaudeHarnessSession = class {
|
|
|
48926
49888
|
if (!item || !completeEmpty && item.text.length === 0)
|
|
48927
49889
|
return;
|
|
48928
49890
|
active.item = null;
|
|
48929
|
-
const durationMs = this.#
|
|
49891
|
+
const durationMs = this.#itemDurationMs(active.agentMessageStartedAtMs);
|
|
48930
49892
|
active.agentMessageStartedAtMs = null;
|
|
48931
49893
|
this.#event({
|
|
48932
49894
|
type: "item.completed",
|
|
@@ -48935,14 +49897,13 @@ var ClaudeHarnessSession = class {
|
|
|
48935
49897
|
});
|
|
48936
49898
|
}
|
|
48937
49899
|
/**
|
|
48938
|
-
* Elapsed
|
|
48939
|
-
*
|
|
48940
|
-
* observation. Undefined for live delivery or when either endpoint is unknown.
|
|
49900
|
+
* Elapsed time between the first live delta and native Item completion.
|
|
49901
|
+
* Autonomous Segments now stream live, so they share the same clock as requested Turns.
|
|
48941
49902
|
*/
|
|
48942
|
-
#
|
|
48943
|
-
if (startedAtMs === null
|
|
49903
|
+
#itemDurationMs(startedAtMs) {
|
|
49904
|
+
if (startedAtMs === null)
|
|
48944
49905
|
return void 0;
|
|
48945
|
-
const durationMs =
|
|
49906
|
+
const durationMs = Date.now() - startedAtMs;
|
|
48946
49907
|
return durationMs >= 0 ? durationMs : void 0;
|
|
48947
49908
|
}
|
|
48948
49909
|
#appendReasoning(active, messageId, delta) {
|
|
@@ -48957,9 +49918,7 @@ var ClaudeHarnessSession = class {
|
|
|
48957
49918
|
text: ""
|
|
48958
49919
|
};
|
|
48959
49920
|
active.reasoningItems.set(messageId, item);
|
|
48960
|
-
|
|
48961
|
-
active.reasoningStartedAtMs.set(messageId, this.#replayObservedAtMs);
|
|
48962
|
-
}
|
|
49921
|
+
active.reasoningStartedAtMs.set(messageId, Date.now());
|
|
48963
49922
|
this.#event({ type: "item.started", turnId: active.command.turnId, item });
|
|
48964
49923
|
}
|
|
48965
49924
|
item = { ...item, text: item.text + delta };
|
|
@@ -48976,7 +49935,7 @@ var ClaudeHarnessSession = class {
|
|
|
48976
49935
|
if (!item)
|
|
48977
49936
|
return;
|
|
48978
49937
|
active.reasoningItems.delete(messageId);
|
|
48979
|
-
const durationMs = this.#
|
|
49938
|
+
const durationMs = this.#itemDurationMs(active.reasoningStartedAtMs.get(messageId) ?? null);
|
|
48980
49939
|
active.reasoningStartedAtMs.delete(messageId);
|
|
48981
49940
|
this.#event({
|
|
48982
49941
|
type: "item.completed",
|
|
@@ -48984,23 +49943,26 @@ var ClaudeHarnessSession = class {
|
|
|
48984
49943
|
snapshot: { item: durationMs === void 0 ? item : { ...item, durationMs }, outcome }
|
|
48985
49944
|
});
|
|
48986
49945
|
}
|
|
48987
|
-
|
|
49946
|
+
/**
|
|
49947
|
+
* Claude started Root output in a Segment no requested Turn owns. A held Turn continues with
|
|
49948
|
+
* it; otherwise it becomes a live autonomous Turn, so the Thread shows it running and a new
|
|
49949
|
+
* request waits instead of absorbing it.
|
|
49950
|
+
*/
|
|
49951
|
+
#startAutonomousTurn(segmentKey) {
|
|
48988
49952
|
if (this.#phase !== "open")
|
|
48989
|
-
return;
|
|
48990
|
-
const
|
|
48991
|
-
if (
|
|
48992
|
-
|
|
48993
|
-
|
|
48994
|
-
|
|
48995
|
-
if (this.#active)
|
|
48996
|
-
return;
|
|
49953
|
+
return null;
|
|
49954
|
+
const current = this.#active;
|
|
49955
|
+
if (current?.held)
|
|
49956
|
+
return current;
|
|
49957
|
+
if (current)
|
|
49958
|
+
return null;
|
|
48997
49959
|
this.#autonomousOrdinal += 1;
|
|
48998
49960
|
const turnId = hostTurnIdSchema.parse(this.#randomUUID());
|
|
48999
49961
|
let resolveCompletion = () => void 0;
|
|
49000
49962
|
const completion = new Promise((resolve2) => {
|
|
49001
49963
|
resolveCompletion = resolve2;
|
|
49002
49964
|
});
|
|
49003
|
-
const nativeTurnKey =
|
|
49965
|
+
const nativeTurnKey = segmentKey || `autonomous-${this.#autonomousOrdinal}`;
|
|
49004
49966
|
const item = {
|
|
49005
49967
|
type: "agentMessage",
|
|
49006
49968
|
itemId: claudeTranscriptItemId(nativeTurnKey, "agentMessage", 1),
|
|
@@ -49060,33 +50022,24 @@ var ClaudeHarnessSession = class {
|
|
|
49060
50022
|
type: "turn.autonomous.started",
|
|
49061
50023
|
turnId,
|
|
49062
50024
|
input: [],
|
|
49063
|
-
|
|
50025
|
+
startedAtMs: Date.now()
|
|
49064
50026
|
});
|
|
49065
50027
|
this.#event({ type: "turn.started", turnId });
|
|
49066
50028
|
this.#event({ type: "item.started", turnId, item });
|
|
49067
|
-
|
|
50029
|
+
return active;
|
|
49068
50030
|
}
|
|
49069
|
-
|
|
49070
|
-
|
|
49071
|
-
|
|
49072
|
-
|
|
49073
|
-
|
|
49074
|
-
|
|
49075
|
-
|
|
49076
|
-
|
|
49077
|
-
|
|
49078
|
-
#replayAutonomousEvents(active, turn) {
|
|
49079
|
-
if (turn.completedAtMs !== void 0)
|
|
49080
|
-
active.completedAtMs = turn.completedAtMs;
|
|
49081
|
-
try {
|
|
49082
|
-
for (const event of turn.events) {
|
|
49083
|
-
this.#replayObservedAtMs = event.observedAtMs ?? null;
|
|
49084
|
-
this.#handleTurnEvent(active, event);
|
|
49085
|
-
}
|
|
49086
|
-
} finally {
|
|
49087
|
-
this.#replayObservedAtMs = null;
|
|
50031
|
+
/** Live native events outside a requested Root Segment; settlements stay Thread-level. */
|
|
50032
|
+
#deliverLiveEvent(target, event) {
|
|
50033
|
+
if (event.type === "usage.request") {
|
|
50034
|
+
this.#meterUsage(event.record);
|
|
50035
|
+
return;
|
|
50036
|
+
}
|
|
50037
|
+
if (target && this.#active === target) {
|
|
50038
|
+
this.#handleTurnEvent(target, event);
|
|
50039
|
+
return;
|
|
49088
50040
|
}
|
|
49089
|
-
|
|
50041
|
+
if (event.type === "subagent.settled")
|
|
50042
|
+
this.#settleNativeTask(event);
|
|
49090
50043
|
}
|
|
49091
50044
|
/**
|
|
49092
50045
|
* A native `task_notification` names the tool call that started its task: a
|
|
@@ -49226,7 +50179,7 @@ var ClaudeHarnessSession = class {
|
|
|
49226
50179
|
if (this.#phase !== "open" || this.#usageGeneration !== request.generation || this.#requestUsageBoundary !== request.boundary) {
|
|
49227
50180
|
return;
|
|
49228
50181
|
}
|
|
49229
|
-
const usage = transcriptRequestUsage(messages, request.messageId);
|
|
50182
|
+
const usage = transcriptRequestUsage(messages ?? [], request.messageId);
|
|
49230
50183
|
if (!usage)
|
|
49231
50184
|
continue;
|
|
49232
50185
|
const active = this.#active;
|
|
@@ -49294,11 +50247,11 @@ var ClaudeHarnessSession = class {
|
|
|
49294
50247
|
let outputTokens = 0;
|
|
49295
50248
|
let cachedInputTokens = 0;
|
|
49296
50249
|
let cacheWriteInputTokens = 0;
|
|
49297
|
-
for (const
|
|
49298
|
-
inputTokens +=
|
|
49299
|
-
outputTokens +=
|
|
49300
|
-
cachedInputTokens +=
|
|
49301
|
-
cacheWriteInputTokens +=
|
|
50250
|
+
for (const model2 of event.modelUsage) {
|
|
50251
|
+
inputTokens += model2.inputTokens;
|
|
50252
|
+
outputTokens += model2.outputTokens;
|
|
50253
|
+
cachedInputTokens += model2.cacheReadInputTokens;
|
|
50254
|
+
cacheWriteInputTokens += model2.cacheCreationInputTokens;
|
|
49302
50255
|
}
|
|
49303
50256
|
if (Number.isSafeInteger(inputTokens) && Number.isSafeInteger(outputTokens)) {
|
|
49304
50257
|
this.#calibratedInputTokens = inputTokens;
|
|
@@ -49545,6 +50498,14 @@ var ClaudeCodeAdapter = class {
|
|
|
49545
50498
|
commandCatalog = claudeCommandCatalog;
|
|
49546
50499
|
liveCommandCatalog = true;
|
|
49547
50500
|
harnessId = claudeCodeHarnessId2;
|
|
50501
|
+
sessionImport = Object.freeze({
|
|
50502
|
+
listCandidates: async () => {
|
|
50503
|
+
const result = await this.#importScope.read((signal) => this.#importIndex.list(signal));
|
|
50504
|
+
return result.ok ? { ok: true, value: result.value.map(({ candidate }) => candidate) } : result;
|
|
50505
|
+
},
|
|
50506
|
+
resolveCandidate: (nativeSessionId) => this.#importScope.resolve((signal) => this.#importIndex.resolve(nativeSessionId, signal))
|
|
50507
|
+
});
|
|
50508
|
+
usageStatistics;
|
|
49548
50509
|
subagents = {
|
|
49549
50510
|
readSnapshot: async (input) => {
|
|
49550
50511
|
if (input.parent.harnessId !== this.harnessId || input.nativeSubagentId.trim().length === 0) {
|
|
@@ -49571,7 +50532,7 @@ var ClaudeCodeAdapter = class {
|
|
|
49571
50532
|
]);
|
|
49572
50533
|
return {
|
|
49573
50534
|
ok: true,
|
|
49574
|
-
value: mapClaudeSubagentSnapshot(messages, input.parent.nativeSessionId, input.nativeSubagentId, parentMessages)
|
|
50535
|
+
value: mapClaudeSubagentSnapshot(messages, input.parent.nativeSessionId, input.nativeSubagentId, parentMessages ?? [])
|
|
49575
50536
|
};
|
|
49576
50537
|
} catch {
|
|
49577
50538
|
return {
|
|
@@ -49585,31 +50546,15 @@ var ClaudeCodeAdapter = class {
|
|
|
49585
50546
|
}
|
|
49586
50547
|
}
|
|
49587
50548
|
};
|
|
49588
|
-
sessionImport = Object.freeze({
|
|
49589
|
-
listCandidates: async () => {
|
|
49590
|
-
const result = await this.#readImport((signal) => this.#importIndex.list(signal));
|
|
49591
|
-
return result.ok ? { ok: true, value: result.value.map(({ candidate }) => candidate) } : result;
|
|
49592
|
-
},
|
|
49593
|
-
resolveCandidate: async (nativeSessionId) => {
|
|
49594
|
-
const result = await this.#readImport((signal) => this.#importIndex.resolve(nativeSessionId, signal));
|
|
49595
|
-
if (!result.ok)
|
|
49596
|
-
return result;
|
|
49597
|
-
return result.value ? { ok: true, value: result.value } : {
|
|
49598
|
-
ok: false,
|
|
49599
|
-
error: {
|
|
49600
|
-
code: "sessionNotFound",
|
|
49601
|
-
message: "Claude Code Session is no longer importable",
|
|
49602
|
-
retryable: false
|
|
49603
|
-
}
|
|
49604
|
-
};
|
|
49605
|
-
}
|
|
49606
|
-
});
|
|
49607
50549
|
#cancelTimeoutMs;
|
|
49608
50550
|
#closeTimeoutMs;
|
|
49609
50551
|
#dependencies;
|
|
49610
|
-
#importAbort = new AbortController();
|
|
49611
50552
|
#importIndex;
|
|
49612
|
-
#
|
|
50553
|
+
#importScope = new SessionImportScope({
|
|
50554
|
+
closedMessage: "Claude Code Adapter is closed",
|
|
50555
|
+
unavailableMessage: "Claude Code Session discovery failed; check storage access and duplicate Session identities, then retry after closing native clients",
|
|
50556
|
+
notFoundMessage: "Claude Code Session is no longer importable"
|
|
50557
|
+
});
|
|
49613
50558
|
#pendingSessions;
|
|
49614
50559
|
#toolOutputLimit;
|
|
49615
50560
|
#continuationQuiescenceMs;
|
|
@@ -49624,6 +50569,7 @@ var ClaudeCodeAdapter = class {
|
|
|
49624
50569
|
constructor(options = {}, dependencies) {
|
|
49625
50570
|
const environment = options.environment ?? process.env;
|
|
49626
50571
|
this.#environment = environment;
|
|
50572
|
+
this.usageStatistics = createClaudeUsageStatistics(environment);
|
|
49627
50573
|
this.#pendingSessions = new ClaudePendingSessions(environment);
|
|
49628
50574
|
this.#closeTimeoutMs = options.closeTimeoutMs ?? DEFAULT_CLOSE_TIMEOUT_MS;
|
|
49629
50575
|
this.#cancelTimeoutMs = options.cancelTimeoutMs ?? DEFAULT_CANCEL_TIMEOUT_MS;
|
|
@@ -49674,7 +50620,7 @@ var ClaudeCodeAdapter = class {
|
|
|
49674
50620
|
environment: options.environment ?? process.env,
|
|
49675
50621
|
sessionId
|
|
49676
50622
|
});
|
|
49677
|
-
return transcript
|
|
50623
|
+
return transcript;
|
|
49678
50624
|
},
|
|
49679
50625
|
readSubagentMessages: async ({ cwd, sessionId, nativeSubagentId: nativeSubagentId2 }) => {
|
|
49680
50626
|
const transcript = await readClaudeSubagentTranscript({
|
|
@@ -49695,24 +50641,6 @@ var ClaudeCodeAdapter = class {
|
|
|
49695
50641
|
readSessionMessages: (input) => this.#dependencies.readSessionMessages(input)
|
|
49696
50642
|
});
|
|
49697
50643
|
}
|
|
49698
|
-
#readImport(operation) {
|
|
49699
|
-
if (this.#importAbort.signal.aborted) {
|
|
49700
|
-
return Promise.resolve({
|
|
49701
|
-
ok: false,
|
|
49702
|
-
error: invalidState("Claude Code Adapter is closed")
|
|
49703
|
-
});
|
|
49704
|
-
}
|
|
49705
|
-
const request = operation(this.#importAbort.signal).then((value) => ({ ok: true, value })).catch(() => ({
|
|
49706
|
-
ok: false,
|
|
49707
|
-
error: {
|
|
49708
|
-
code: "unavailable",
|
|
49709
|
-
message: "Claude Code Session discovery failed; check native storage access and duplicate Session identities, then retry after closing native clients",
|
|
49710
|
-
retryable: true
|
|
49711
|
-
}
|
|
49712
|
-
})).finally(() => this.#importRequests.delete(request));
|
|
49713
|
-
this.#importRequests.add(request);
|
|
49714
|
-
return request;
|
|
49715
|
-
}
|
|
49716
50644
|
async inspect(input = {}) {
|
|
49717
50645
|
if (this.#closePromise) {
|
|
49718
50646
|
return {
|
|
@@ -49720,7 +50648,7 @@ var ClaudeCodeAdapter = class {
|
|
|
49720
50648
|
error: invalidState("Claude Code Adapter is closing")
|
|
49721
50649
|
};
|
|
49722
50650
|
}
|
|
49723
|
-
const cwd =
|
|
50651
|
+
const cwd = path18.resolve(input.cwd ?? process.cwd());
|
|
49724
50652
|
if (!input.refresh) {
|
|
49725
50653
|
const cached2 = this.#inspectionCache.get(cwd);
|
|
49726
50654
|
if (cached2)
|
|
@@ -49916,7 +50844,7 @@ var ClaudeCodeAdapter = class {
|
|
|
49916
50844
|
}
|
|
49917
50845
|
requestedPermissionModeId = CLAUDE_DEFAULT_PERMISSION_MODE_ID;
|
|
49918
50846
|
}
|
|
49919
|
-
const cwd =
|
|
50847
|
+
const cwd = path18.resolve(input.cwd);
|
|
49920
50848
|
if (input.kind === "rollbackLastTurn") {
|
|
49921
50849
|
for (const source of this.#sessions) {
|
|
49922
50850
|
const ready = await source.prepareRollback(input.sourceRef.nativeSessionId);
|
|
@@ -49963,7 +50891,7 @@ var ClaudeCodeAdapter = class {
|
|
|
49963
50891
|
cwd,
|
|
49964
50892
|
sessionId: durableRef.nativeSessionId
|
|
49965
50893
|
});
|
|
49966
|
-
if (messages
|
|
50894
|
+
if ((messages?.length ?? 0) > 0 || input.kind === "resume" && input.knownTurnRefs?.length)
|
|
49967
50895
|
throw new Error("Pending Session unexpectedly contains history");
|
|
49968
50896
|
openMode = "create";
|
|
49969
50897
|
}
|
|
@@ -49990,6 +50918,8 @@ var ClaudeCodeAdapter = class {
|
|
|
49990
50918
|
};
|
|
49991
50919
|
}
|
|
49992
50920
|
}
|
|
50921
|
+
const sessionId = forked?.ok ? forked.value.sessionId : nativeRef?.success ? nativeRef.data.nativeSessionId : this.#dependencies.randomUUID();
|
|
50922
|
+
const usageHistory = await this.#readUsageHistory(cwd, sessionId, openMode);
|
|
49993
50923
|
const session = new ClaudeHarnessSession(cwd, this.#dependencies, this.#closeTimeoutMs, () => this.#sessions.delete(session), (planLimit) => this.#recordPlanLimit(session, planLimit), {
|
|
49994
50924
|
...input.environment ? { environment: input.environment } : {},
|
|
49995
50925
|
bypassPermissionsAvailable,
|
|
@@ -49997,7 +50927,8 @@ var ClaudeCodeAdapter = class {
|
|
|
49997
50927
|
pendingSessions: this.#pendingSessions,
|
|
49998
50928
|
knownConfiguration: input.kind === "rollbackLastTurn" || input.kind === "resume" && Boolean(input.model || input.thinkingOptionId) || Boolean(durableRef && isPendingClaudeSession(durableRef)),
|
|
49999
50929
|
...durableRef ? { nativeRef: durableRef } : {},
|
|
50000
|
-
sessionId
|
|
50930
|
+
sessionId,
|
|
50931
|
+
usageHistory,
|
|
50001
50932
|
...requestedModel ? { requestedModel } : {},
|
|
50002
50933
|
longContextEnabled: () => readClaudeLongContext(this.#environment),
|
|
50003
50934
|
requestedPermissionModeId,
|
|
@@ -50009,6 +50940,20 @@ var ClaudeCodeAdapter = class {
|
|
|
50009
50940
|
this.#sessions.add(session);
|
|
50010
50941
|
return { ok: true, value: session };
|
|
50011
50942
|
}
|
|
50943
|
+
/**
|
|
50944
|
+
* Every request already in the native transcript, for Host usage metering. A new Session has
|
|
50945
|
+
* none; an unreadable transcript is an incomplete history rather than an empty one.
|
|
50946
|
+
*/
|
|
50947
|
+
async #readUsageHistory(cwd, sessionId, openMode) {
|
|
50948
|
+
if (openMode === "create")
|
|
50949
|
+
return { requests: [], complete: true };
|
|
50950
|
+
try {
|
|
50951
|
+
const messages = await this.#dependencies.readSessionMessages({ cwd, sessionId });
|
|
50952
|
+
return messages === null ? { requests: [], complete: false } : claudeUsageHistory(messages);
|
|
50953
|
+
} catch {
|
|
50954
|
+
return { requests: [], complete: false };
|
|
50955
|
+
}
|
|
50956
|
+
}
|
|
50012
50957
|
/** Account-level plan windows are shared, but only stable native pushes may update them. */
|
|
50013
50958
|
#recordPlanLimit(origin, planLimit) {
|
|
50014
50959
|
const next = { ...this.#latestPlanLimit ?? {} };
|
|
@@ -50038,10 +50983,9 @@ var ClaudeCodeAdapter = class {
|
|
|
50038
50983
|
}
|
|
50039
50984
|
close() {
|
|
50040
50985
|
if (!this.#closePromise) {
|
|
50041
|
-
this.#importAbort.abort();
|
|
50042
50986
|
this.#inspectionCache.clear();
|
|
50043
50987
|
this.#closePromise = Promise.all([
|
|
50044
|
-
|
|
50988
|
+
this.#importScope.close(),
|
|
50045
50989
|
...[...this.#inspectors].map((inspector) => inspector.close()),
|
|
50046
50990
|
...[...this.#sessions].map((session) => session.close()),
|
|
50047
50991
|
...this.#inspectionInFlight.values()
|
|
@@ -50054,14 +50998,14 @@ var ClaudeCodeAdapter = class {
|
|
|
50054
50998
|
// dist/installation.js
|
|
50055
50999
|
import { readFile as readFile8, realpath as realpath3 } from "node:fs/promises";
|
|
50056
51000
|
import { homedir as homedir2 } from "node:os";
|
|
50057
|
-
import
|
|
51001
|
+
import path19 from "node:path";
|
|
50058
51002
|
async function readSettings(file2) {
|
|
50059
|
-
const
|
|
51003
|
+
const text2 = await readFile8(file2, "utf8").catch((error52) => {
|
|
50060
51004
|
if (error52.code === "ENOENT")
|
|
50061
51005
|
return "{}";
|
|
50062
51006
|
throw error52;
|
|
50063
51007
|
});
|
|
50064
|
-
const settings = JSON.parse(
|
|
51008
|
+
const settings = JSON.parse(text2);
|
|
50065
51009
|
if (!settings || typeof settings !== "object" || Array.isArray(settings))
|
|
50066
51010
|
throw new Error("Claude update settings are invalid");
|
|
50067
51011
|
return settings;
|
|
@@ -50075,9 +51019,9 @@ function createClaudeInstallation(environment, command) {
|
|
|
50075
51019
|
...command ? { command } : {}
|
|
50076
51020
|
});
|
|
50077
51021
|
const home = environment.HOME ?? environment.USERPROFILE ?? homedir2();
|
|
50078
|
-
const config2 = environment.CLAUDE_CONFIG_DIR ?
|
|
50079
|
-
const managedFile = process.platform === "darwin" ? "/Library/Application Support/ClaudeCode/managed-settings.json" : process.platform === "win32" ?
|
|
50080
|
-
const user = await readSettings(
|
|
51022
|
+
const config2 = environment.CLAUDE_CONFIG_DIR ? path19.resolve(home, environment.CLAUDE_CONFIG_DIR) : path19.join(home, ".claude");
|
|
51023
|
+
const managedFile = process.platform === "darwin" ? "/Library/Application Support/ClaudeCode/managed-settings.json" : process.platform === "win32" ? path19.join(environment.ProgramFiles ?? "C:\\Program Files", "ClaudeCode", "managed-settings.json") : "/etc/claude-code/managed-settings.json";
|
|
51024
|
+
const user = await readSettings(path19.join(config2, "settings.json"));
|
|
50081
51025
|
const managed = await readSettings(managedFile);
|
|
50082
51026
|
const settings = { ...user, ...managed, env: { ...user.env, ...managed.env } };
|
|
50083
51027
|
const env = { ...environment, ...settings.env };
|
|
@@ -50090,10 +51034,10 @@ function createClaudeInstallation(environment, command) {
|
|
|
50090
51034
|
throw new Error("Unknown Claude release channel");
|
|
50091
51035
|
const latestVersion = installationVersion(await fetchInstallationText(`https://downloads.claude.ai/claude-code-releases/${channel}`));
|
|
50092
51036
|
const npm = await npmInstallation(executable, ["@anthropic-ai/claude-code"], env);
|
|
50093
|
-
const launcher =
|
|
51037
|
+
const launcher = path19.join(home, ".local", "bin", process.platform === "win32" ? "claude.exe" : "claude");
|
|
50094
51038
|
const selected = await realpath3(executable);
|
|
50095
|
-
const versions =
|
|
50096
|
-
const native =
|
|
51039
|
+
const versions = path19.join(home, ".local", "share", "claude", "versions") + path19.sep;
|
|
51040
|
+
const native = path19.resolve(executable) === launcher && (selected.startsWith(versions) || process.platform === "win32" && selected === launcher);
|
|
50097
51041
|
const blocked = !!env.DISABLE_UPDATES && env.DISABLE_UPDATES !== "0" || !!settings.minimumVersion && newerInstallationVersion(latestVersion, installationVersion(settings.minimumVersion)) || !!settings.requiredMaximumVersion && newerInstallationVersion(installationVersion(settings.requiredMaximumVersion), latestVersion);
|
|
50098
51042
|
const canUpdate = !blocked && (npm?.canUpdate ?? native);
|
|
50099
51043
|
update = async () => {
|
|
@@ -50118,8 +51062,8 @@ function createClaudeInstallation(environment, command) {
|
|
|
50118
51062
|
}
|
|
50119
51063
|
|
|
50120
51064
|
// dist/user-shell-environment.js
|
|
50121
|
-
import
|
|
50122
|
-
import { execFile as
|
|
51065
|
+
import path20 from "node:path";
|
|
51066
|
+
import { execFile as execFile4 } from "node:child_process";
|
|
50123
51067
|
var ENVIRONMENT_MARKER = Buffer.from("\0CODEXHOST_USER_SHELL_ENV_V1\0");
|
|
50124
51068
|
var ENVIRONMENT_COMMAND = "printf '\\0CODEXHOST_USER_SHELL_ENV_V1\\0'; /usr/bin/env -0";
|
|
50125
51069
|
var SHELL_ENVIRONMENT_TIMEOUT_MS = 3e3;
|
|
@@ -50161,14 +51105,14 @@ async function withUserShellEnvironment(environment, dependencies) {
|
|
|
50161
51105
|
if (platform === "win32" || !environment.HOME)
|
|
50162
51106
|
return environment;
|
|
50163
51107
|
const shell = environment.SHELL?.trim() || defaultShell(platform);
|
|
50164
|
-
if (!shell || !SUPPORTED_SHELLS.has(
|
|
51108
|
+
if (!shell || !SUPPORTED_SHELLS.has(path20.basename(shell)))
|
|
50165
51109
|
return environment;
|
|
50166
51110
|
const cacheKey = `${platform}\0${shell}\0${environment.HOME}`;
|
|
50167
51111
|
const cached2 = dependencies ? void 0 : shellEnvironmentCache.get(cacheKey);
|
|
50168
51112
|
if (cached2)
|
|
50169
51113
|
return mergeMissingEnvironment(environment, cached2);
|
|
50170
51114
|
const run = dependencies?.run ?? ((command, arguments_, options) => new Promise((resolve2) => {
|
|
50171
|
-
const child =
|
|
51115
|
+
const child = execFile4(command, arguments_, {
|
|
50172
51116
|
...options,
|
|
50173
51117
|
encoding: "buffer",
|
|
50174
51118
|
killSignal: "SIGKILL"
|
|
@@ -50202,6 +51146,17 @@ async function createHarnessAdapter(context) {
|
|
|
50202
51146
|
commandCatalog: claudeCommandCatalog,
|
|
50203
51147
|
liveCommandCatalog: true,
|
|
50204
51148
|
environment,
|
|
51149
|
+
isInstalled: () => {
|
|
51150
|
+
try {
|
|
51151
|
+
resolveClaudeCodeExecutable({
|
|
51152
|
+
...environment[CLAUDE_CODE_COMMAND_ENV] ? { command: environment[CLAUDE_CODE_COMMAND_ENV] } : {},
|
|
51153
|
+
environment
|
|
51154
|
+
});
|
|
51155
|
+
return true;
|
|
51156
|
+
} catch (error52) {
|
|
51157
|
+
return !(error52 instanceof ClaudeCodeExecutableError);
|
|
51158
|
+
}
|
|
51159
|
+
},
|
|
50205
51160
|
...context.brokerDescriptorPath ? { descriptorPath: context.brokerDescriptorPath } : {}
|
|
50206
51161
|
});
|
|
50207
51162
|
}
|
|
@@ -50217,6 +51172,8 @@ async function createHarnessAdapter(context) {
|
|
|
50217
51172
|
});
|
|
50218
51173
|
}
|
|
50219
51174
|
async function warmup(adapter) {
|
|
51175
|
+
if (adapter instanceof BrokeredHarnessAdapter)
|
|
51176
|
+
return;
|
|
50220
51177
|
try {
|
|
50221
51178
|
await adapter.inspect();
|
|
50222
51179
|
} catch {
|