mirror of
https://github.com/VibedByKaKi/t3-code-android-nightly.git
synced 2026-10-10 12:21:16 +02:00
Co-authored-by: maria-rcks <maria@kuuro.net> Co-authored-by: Bilal Bakr <62337003+Bil0000@users.noreply.github.com> Co-authored-by: shivam <91240327+shivamhwp@users.noreply.github.com> Co-authored-by: Vitalii Yehorov <vitalyiegorov@gmail.com> Co-authored-by: Jake Leventhal <jakeleventhal@me.com> Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> Co-authored-by: Alex Southwell <saphid@gmail.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Nicholas Wasmiller <derped@mineperial.com> Co-authored-by: PB <poilmb@gmail.com> Co-authored-by: Exotic <118054752+extoci@users.noreply.github.com> Co-authored-by: Yash Singh <saiansh2525@gmail.com> Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Theo Browne <me@t3.gg> Co-authored-by: Gabriel De Andrade <30420087+gabrielelpidio@users.noreply.github.com> Co-authored-by: Dara Adedeji <76637177+SunkenInTime@users.noreply.github.com> Co-authored-by: scratchyone <scratchywon@gmail.com> Co-authored-by: Dominic Roy <dominic@sdko.org> Co-authored-by: chukfinley <chuk@chuk.dev> Co-authored-by: Primož Ajdišek <bigpod@bigpod.si> Co-authored-by: benthecarman <benthecarman@live.com> Co-authored-by: NaveDanan <nave0712@gmail.com> Co-authored-by: aaditagrawal <103925638+aaditagrawal@users.noreply.github.com> Co-authored-by: Aditya Garud <153842990+yashranaway@users.noreply.github.com> Co-authored-by: Nick Anisimov <n.anisimov.23@gmail.com> Co-authored-by: MacKinley Smith <smithmackinley@gmail.com> Co-authored-by: Yordis Prieto <yordis.prieto@gmail.com> Co-authored-by: t3-code[bot] <269035359+t3-code[bot]@users.noreply.github.com> Co-authored-by: AKolenda <akole779@mtroyal.ca> Co-authored-by: Guillermo Casanova <75276669+Gigioxx@users.noreply.github.com> Co-authored-by: Otavio Salvador <otavio@ossystems.com.br> Co-authored-by: Shirish Pothi <183252392+shirishpothi@users.noreply.github.com> Co-authored-by: Ishaan Kothari <ishaanko.mail@gmail.com> Co-authored-by: Bob Fowler <bob@rjf.ca> Co-authored-by: Anton Bezdenezhnykh <gamer392@yandex.ru> Co-authored-by: ValeraZSD <48602572+ValeraZSD@users.noreply.github.com> Co-authored-by: Ephraim <ephraim39hr14m@gmail.com> Co-authored-by: Ryan Ilano <ryanilano@users.noreply.github.com> Co-authored-by: Alex <me@pixp.cc> Co-authored-by: maco <gosarmarcel7@gmail.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Tristan Knight <admin@snappeh.com> Co-authored-by: PR Batch Tester <agent@local.test> Co-authored-by: oliver <97427849+flamboh@users.noreply.github.com> Co-authored-by: kamkm <99585688+Kamkmgamer@users.noreply.github.com> Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
74 lines
2.3 KiB
TypeScript
74 lines
2.3 KiB
TypeScript
import type { ProviderDriverKind } from "@t3tools/contracts";
|
|
export const TRANSFER_HISTORY_TURN_COUNT = 10;
|
|
export const TRANSFER_HISTORY_TOOLS_PER_TURN = 5;
|
|
export const TRANSFER_MEASURED_TOOLS = 20;
|
|
export const TRANSFER_HISTORY_MCP_RESULT_BYTES = 900_000;
|
|
export const TRANSFER_MEASURED_MCP_RESULT_BYTES = 1_100_000;
|
|
|
|
const sourceModules = [
|
|
"connection/session.ts",
|
|
"connection/supervisor.ts",
|
|
"rpc/client.ts",
|
|
"rpc/protocol.ts",
|
|
"state/threads.ts",
|
|
"state/threadReducer.ts",
|
|
"state/threadSnapshotHttp.ts",
|
|
"orchestration/http.ts",
|
|
"orchestration/Normalizer.ts",
|
|
"orchestration/ActivityPayloadProjection.ts",
|
|
"provider/ProviderService.ts",
|
|
"provider/ProviderRuntimeIngestion.ts",
|
|
"persistence/ProjectionSnapshotQuery.ts",
|
|
"persistence/OrchestrationEventStore.ts",
|
|
"checkpointing/CheckpointStore.ts",
|
|
"checkpointing/CheckpointDiffQuery.ts",
|
|
"server.ts",
|
|
] as const;
|
|
|
|
function mix(value: number): number {
|
|
let mixed = value | 0;
|
|
mixed ^= mixed >>> 16;
|
|
mixed = Math.imul(mixed, 0x7feb352d);
|
|
mixed ^= mixed >>> 15;
|
|
mixed = Math.imul(mixed, 0x846ca68b);
|
|
mixed ^= mixed >>> 16;
|
|
return mixed >>> 0;
|
|
}
|
|
|
|
function digest(seed: number): string {
|
|
return [0, 1, 2, 3]
|
|
.map((offset) =>
|
|
mix(seed + offset * 0x9e3779b9)
|
|
.toString(16)
|
|
.padStart(8, "0"),
|
|
)
|
|
.join("");
|
|
}
|
|
|
|
/** Produces safe, deterministic output with enough entropy to exercise gzip. */
|
|
export function diagnosticOutput(input: {
|
|
readonly provider: ProviderDriverKind;
|
|
readonly turnIndex: number;
|
|
readonly toolIndex: number;
|
|
readonly targetBytes: number;
|
|
}): string {
|
|
const chunks: string[] = [];
|
|
const providerSeed = input.provider === "codex" ? 0x43_4f_44_45 : 0x43_4c_41_55;
|
|
let length = 0;
|
|
let lineIndex = 0;
|
|
|
|
while (length < input.targetBytes) {
|
|
const modulePath = sourceModules[(input.toolIndex + lineIndex) % sourceModules.length];
|
|
const seed =
|
|
providerSeed + input.turnIndex * 100_003 + input.toolIndex * 10_007 + lineIndex * 101;
|
|
const line =
|
|
`${String(lineIndex + 1).padStart(6, "0")} ${modulePath} ` +
|
|
`operation=project-transfer-${input.turnIndex + 1}-${input.toolIndex + 1} ` +
|
|
`cursor=${mix(seed)} digest=${digest(seed)} status=completed\n`;
|
|
chunks.push(line);
|
|
length += line.length;
|
|
lineIndex += 1;
|
|
}
|
|
|
|
return chunks.join("").slice(0, input.targetBytes);
|
|
}
|