Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4825.js (118.4 MB)
105 lines
3.3 KiB
TypeScript
105 lines
3.3 KiB
TypeScript
// Module ID: 16842
|
|
// Function ID: 16843
|
|
// Name: vibegrations/VibegrationsTraceFormat
|
|
// Dependencies: [1115, 3593, 2]
|
|
// Exports: categoryLabel, formatDuration, formatTokens, omissionLabel, statusLabel, traceRichStatusLabel
|
|
|
|
// Module 16842 (vibegrations/VibegrationsTraceFormat)
|
|
import util from "util" /* 1115 */;
|
|
import _modDef3593 from "module_3593" /* 3593 */;
|
|
import size from "module_2" /* 2 */;
|
|
|
|
let result = size.fileFinishedImporting("modules/vibegrations/lib/VibegrationsTraceFormat.tsx");
|
|
|
|
export const formatDuration = function formatDuration(arg0) {
|
|
if (arg0 < 1000) {
|
|
const _HermesInternal2 = HermesInternal;
|
|
let combined = "" + arg0 + "ms";
|
|
} else {
|
|
const result = arg0 / 1000;
|
|
const _HermesInternal = HermesInternal;
|
|
combined = "" + result.toFixed(1) + "s";
|
|
}
|
|
return combined;
|
|
};
|
|
export const formatTokens = function formatTokens(promptTokens) {
|
|
if (promptTokens < 1000) {
|
|
const _String = String;
|
|
return String(promptTokens);
|
|
} else {
|
|
const result = promptTokens / 1000;
|
|
if (result < 10) {
|
|
let toFixedResult = result.toFixed(1);
|
|
} else {
|
|
const _Math = Math;
|
|
toFixedResult = Math.round(result);
|
|
}
|
|
const _HermesInternal = HermesInternal;
|
|
return "" + toFixedResult + "k";
|
|
}
|
|
};
|
|
export const categoryLabel = function categoryLabel(traceCategoryResult) {
|
|
if ("subagent" === traceCategoryResult) {
|
|
const intl5 = util.intl;
|
|
return intl5.string(_modDef3593["EoY7D+"]);
|
|
} else if ("context" === traceCategoryResult) {
|
|
const intl4 = util.intl;
|
|
return intl4.string(_modDef3593.KVFrD3);
|
|
} else if ("tool" === traceCategoryResult) {
|
|
const intl3 = util.intl;
|
|
return intl3.string(_modDef3593["/N6ZU9"]);
|
|
} else if ("delegated" === traceCategoryResult) {
|
|
const intl2 = util.intl;
|
|
return intl2.string(_modDef3593.HcEbf2);
|
|
} else {
|
|
const intl = util.intl;
|
|
return intl.string(_modDef3593.AhOqQs);
|
|
}
|
|
};
|
|
export const statusLabel = function statusLabel(status) {
|
|
if ("started" === status) {
|
|
const intl3 = util.intl;
|
|
return intl3.string(_modDef3593.HpKDyl);
|
|
} else if ("error" === status) {
|
|
const intl2 = util.intl;
|
|
return intl2.string(_modDef3593["5T4Dd0"]);
|
|
} else {
|
|
const intl = util.intl;
|
|
return intl.string(_modDef3593.VbEmf0);
|
|
}
|
|
};
|
|
export const omissionLabel = function omissionLabel(content) {
|
|
if ("prose" === content) {
|
|
const intl3 = util.intl;
|
|
return intl3.string(_modDef3593.xO6bcQ);
|
|
} else if ("content" === content) {
|
|
const intl2 = util.intl;
|
|
return intl2.string(_modDef3593.gpBZRr);
|
|
} else {
|
|
const intl = util.intl;
|
|
return intl.string(_modDef3593.OZvPXt);
|
|
}
|
|
};
|
|
export const traceRichStatusLabel = function traceRichStatusLabel(vibegrationsTraceDetail) {
|
|
let tmp = null;
|
|
if (null != vibegrationsTraceDetail) {
|
|
tmp = null;
|
|
if ("loaded" !== vibegrationsTraceDetail.status) {
|
|
tmp = null;
|
|
if ("forbidden" !== vibegrationsTraceDetail.status) {
|
|
let tmp5 = dependencyMap;
|
|
const intl = util.intl;
|
|
if ("loading" === vibegrationsTraceDetail.status) {
|
|
tmp5 = _modDef3593;
|
|
let fj5wM8 = tmp5["vBF/0G"];
|
|
} else if ("unavailable" === vibegrationsTraceDetail.status) {
|
|
fj5wM8 = _modDef3593.jEQTot;
|
|
} else {
|
|
fj5wM8 = _modDef3593.fj5wM8;
|
|
}
|
|
intl.string(fj5wM8);
|
|
}
|
|
}
|
|
}
|
|
return tmp;
|
|
};
|