Merge PR #7612: chore(ts): enforce noImplicitOverride (@metaphorics)
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export class CompactionCancelledError extends Error {
|
export class CompactionCancelledError extends Error {
|
||||||
readonly name = "CompactionCancelledError" as const;
|
override readonly name = "CompactionCancelledError" as const;
|
||||||
|
|
||||||
constructor(message = "Compaction cancelled") {
|
constructor(message = "Compaction cancelled") {
|
||||||
super(message);
|
super(message);
|
||||||
@@ -27,7 +27,7 @@ export class CompactionCancelledError extends Error {
|
|||||||
* ordinary summarization errors and must not fall through to another provider.
|
* ordinary summarization errors and must not fall through to another provider.
|
||||||
*/
|
*/
|
||||||
export class NativeCompactionError extends Error {
|
export class NativeCompactionError extends Error {
|
||||||
readonly name = "NativeCompactionError" as const;
|
override readonly name = "NativeCompactionError" as const;
|
||||||
|
|
||||||
constructor(cause: unknown) {
|
constructor(cause: unknown) {
|
||||||
super(cause instanceof Error ? cause.message : String(cause), { cause });
|
super(cause instanceof Error ? cause.message : String(cause), { cause });
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class DevinOAuthFlow extends OAuthCallbackFlow {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
generateState(): string {
|
override generateState(): string {
|
||||||
return crypto.randomUUID();
|
return crypto.randomUUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -409,7 +409,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
this.emitCodexResponse({ messageId: "msg_opaque", responseId: "resp_opaque", text: "pong" });
|
this.emitCodexResponse({ messageId: "msg_opaque", responseId: "resp_opaque", text: "pong" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1316,7 +1316,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
const added = encodeWebSocketMessage({
|
const added = encodeWebSocketMessage({
|
||||||
type: "response.output_item.added",
|
type: "response.output_item.added",
|
||||||
item: { type: "message", id: "msg_ws", role: "assistant", status: "in_progress", content: [] },
|
item: { type: "message", id: "msg_ws", role: "assistant", status: "in_progress", content: [] },
|
||||||
@@ -1374,7 +1374,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
this.emitCodexResponse({ messageId: "msg_obs", responseId: "resp_obs", text: "Observed" });
|
this.emitCodexResponse({ messageId: "msg_obs", responseId: "resp_obs", text: "Observed" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1431,7 +1431,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
this.sendJson({
|
this.sendJson({
|
||||||
type: "response.done",
|
type: "response.done",
|
||||||
response: {
|
response: {
|
||||||
@@ -1484,7 +1484,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
this.sendJson({
|
this.sendJson({
|
||||||
type: "response.done",
|
type: "response.done",
|
||||||
response: {
|
response: {
|
||||||
@@ -1638,7 +1638,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(data: string): void {
|
override send(data: string): void {
|
||||||
sentRequests.push(JSON.parse(data) as Record<string, unknown>);
|
sentRequests.push(JSON.parse(data) as Record<string, unknown>);
|
||||||
this.emitCodexResponse({ messageId: "msg_lite", responseId: "resp_lite", text: "Hi" });
|
this.emitCodexResponse({ messageId: "msg_lite", responseId: "resp_lite", text: "Hi" });
|
||||||
}
|
}
|
||||||
@@ -2876,7 +2876,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(data: string): void {
|
override send(data: string): void {
|
||||||
websocketRequestCount += 1;
|
websocketRequestCount += 1;
|
||||||
const body: unknown = JSON.parse(data);
|
const body: unknown = JSON.parse(data);
|
||||||
if (websocketRequestCount === 1) {
|
if (websocketRequestCount === 1) {
|
||||||
@@ -3064,7 +3064,7 @@ describe("openai-codex streaming", () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
send(_data: string): void {
|
override send(_data: string): void {
|
||||||
websocketRequestCount += 1;
|
websocketRequestCount += 1;
|
||||||
this.emitCodexResponse({
|
this.emitCodexResponse({
|
||||||
messageId: `msg_pre_turn_${websocketRequestCount}`,
|
messageId: `msg_pre_turn_${websocketRequestCount}`,
|
||||||
@@ -3184,7 +3184,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(data: string): void {
|
override send(data: string): void {
|
||||||
sentRequests.push(JSON.parse(data) as Record<string, unknown>);
|
sentRequests.push(JSON.parse(data) as Record<string, unknown>);
|
||||||
this.sendJson({
|
this.sendJson({
|
||||||
type: "response.output_item.added",
|
type: "response.output_item.added",
|
||||||
@@ -3269,7 +3269,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(data: string): void {
|
override send(data: string): void {
|
||||||
sentRequests.push(JSON.parse(data) as Record<string, unknown>);
|
sentRequests.push(JSON.parse(data) as Record<string, unknown>);
|
||||||
const responseIndex = sentRequests.length;
|
const responseIndex = sentRequests.length;
|
||||||
this.emitCodexResponse({
|
this.emitCodexResponse({
|
||||||
@@ -3409,7 +3409,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(data: string): void {
|
override send(data: string): void {
|
||||||
sentRequests.push(JSON.parse(data) as Record<string, unknown>);
|
sentRequests.push(JSON.parse(data) as Record<string, unknown>);
|
||||||
if (sentRequests.length === 1) {
|
if (sentRequests.length === 1) {
|
||||||
this.sendJson({
|
this.sendJson({
|
||||||
@@ -3508,7 +3508,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
this.sendJson({
|
this.sendJson({
|
||||||
type: "response.completed",
|
type: "response.completed",
|
||||||
response: {
|
response: {
|
||||||
@@ -3564,7 +3564,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
this.#sendCount += 1;
|
this.#sendCount += 1;
|
||||||
if (this.#sendCount === 1) {
|
if (this.#sendCount === 1) {
|
||||||
this.emitCodexResponse({
|
this.emitCodexResponse({
|
||||||
@@ -3653,7 +3653,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(data: string): void {
|
override send(data: string): void {
|
||||||
sentRequests.push(JSON.parse(data) as Record<string, unknown>);
|
sentRequests.push(JSON.parse(data) as Record<string, unknown>);
|
||||||
const responseIndex = sentRequests.length;
|
const responseIndex = sentRequests.length;
|
||||||
this.emitCodexResponse({
|
this.emitCodexResponse({
|
||||||
@@ -3770,7 +3770,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(data: string): void {
|
override send(data: string): void {
|
||||||
const request = JSON.parse(data) as Record<string, unknown>;
|
const request = JSON.parse(data) as Record<string, unknown>;
|
||||||
sentRequests.push(request);
|
sentRequests.push(request);
|
||||||
const requestIndex = sentRequests.length;
|
const requestIndex = sentRequests.length;
|
||||||
@@ -3878,7 +3878,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(data: string): void {
|
override send(data: string): void {
|
||||||
const request = JSON.parse(data) as Record<string, unknown>;
|
const request = JSON.parse(data) as Record<string, unknown>;
|
||||||
sentRequests.push(request);
|
sentRequests.push(request);
|
||||||
const requestIndex = sentRequests.length;
|
const requestIndex = sentRequests.length;
|
||||||
@@ -3996,7 +3996,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
this.emitCodexResponse({ messageId: "msg_v2", responseId: "resp_v2", text: "Hello v2" });
|
this.emitCodexResponse({ messageId: "msg_v2", responseId: "resp_v2", text: "Hello v2" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4053,7 +4053,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
sendCount += 1;
|
sendCount += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4113,7 +4113,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
sendCount += 1;
|
sendCount += 1;
|
||||||
this.sendJson({
|
this.sendJson({
|
||||||
type: "response.output_item.added",
|
type: "response.output_item.added",
|
||||||
@@ -4143,7 +4143,7 @@ describe("openai-codex streaming", () => {
|
|||||||
}, 2);
|
}, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
close(): void {
|
override close(): void {
|
||||||
if (interval) clearInterval(interval);
|
if (interval) clearInterval(interval);
|
||||||
super.close();
|
super.close();
|
||||||
}
|
}
|
||||||
@@ -4190,7 +4190,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
sendCount += 1;
|
sendCount += 1;
|
||||||
this.sendJson({
|
this.sendJson({
|
||||||
type: "response.output_item.added",
|
type: "response.output_item.added",
|
||||||
@@ -4213,7 +4213,7 @@ describe("openai-codex streaming", () => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
close(): void {
|
override close(): void {
|
||||||
closeCount += 1;
|
closeCount += 1;
|
||||||
super.close();
|
super.close();
|
||||||
}
|
}
|
||||||
@@ -4257,7 +4257,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
if (this.#index === 0) {
|
if (this.#index === 0) {
|
||||||
// First attempt: a function call whose arguments are only whitespace.
|
// First attempt: a function call whose arguments are only whitespace.
|
||||||
// A completed reasoning item lands in nativeOutputItems before the
|
// A completed reasoning item lands in nativeOutputItems before the
|
||||||
@@ -4313,7 +4313,7 @@ describe("openai-codex streaming", () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
close(): void {
|
override close(): void {
|
||||||
closeCount += 1;
|
closeCount += 1;
|
||||||
super.close();
|
super.close();
|
||||||
}
|
}
|
||||||
@@ -4384,7 +4384,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
sendCount += 1;
|
sendCount += 1;
|
||||||
this.sendJson({
|
this.sendJson({
|
||||||
type: "response.output_item.added",
|
type: "response.output_item.added",
|
||||||
@@ -4436,7 +4436,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
// Every frame lands in the connection queue synchronously, before the
|
// Every frame lands in the connection queue synchronously, before the
|
||||||
// consumer microtask drains any of them; the close event used to wipe
|
// consumer microtask drains any of them; the close event used to wipe
|
||||||
// the queued terminal event and turn success into a transport error.
|
// the queued terminal event and turn success into a transport error.
|
||||||
@@ -4479,7 +4479,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
this.sendJson({
|
this.sendJson({
|
||||||
type: "response.output_item.added",
|
type: "response.output_item.added",
|
||||||
item: { type: "function_call", id: "fc_limit", call_id: "call_limit", name: "todo", arguments: "" },
|
item: { type: "function_call", id: "fc_limit", call_id: "call_limit", name: "todo", arguments: "" },
|
||||||
@@ -4534,13 +4534,13 @@ describe("openai-codex streaming", () => {
|
|||||||
this.emit("open", new Event("open"));
|
this.emit("open", new Event("open"));
|
||||||
}
|
}
|
||||||
|
|
||||||
close(): void {
|
override close(): void {
|
||||||
const wasPending = this.readyState === MockWebSocket.CONNECTING;
|
const wasPending = this.readyState === MockWebSocket.CONNECTING;
|
||||||
super.close();
|
super.close();
|
||||||
if (wasPending) this.emit("close", { code: 1000 } as unknown as Event);
|
if (wasPending) this.emit("close", { code: 1000 } as unknown as Event);
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
this.emitCodexResponse({ messageId: "msg_join", responseId: "resp_join", text: "Joined" });
|
this.emitCodexResponse({ messageId: "msg_join", responseId: "resp_join", text: "Joined" });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -4597,7 +4597,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
sendCount += 1;
|
sendCount += 1;
|
||||||
this.sendJson({
|
this.sendJson({
|
||||||
type: "response.output_item.added",
|
type: "response.output_item.added",
|
||||||
@@ -4669,7 +4669,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(data: string): void {
|
override send(data: string): void {
|
||||||
const request = JSON.parse(data) as { type?: string };
|
const request = JSON.parse(data) as { type?: string };
|
||||||
const requestType = typeof request.type === "string" ? request.type : "";
|
const requestType = typeof request.type === "string" ? request.type : "";
|
||||||
sentTypesByConnection[this.#connectionIndex]?.push(requestType);
|
sentTypesByConnection[this.#connectionIndex]?.push(requestType);
|
||||||
@@ -4796,7 +4796,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(): void {
|
override send(): void {
|
||||||
this.sendJson({
|
this.sendJson({
|
||||||
type: "response.output_item.added",
|
type: "response.output_item.added",
|
||||||
item: {
|
item: {
|
||||||
@@ -4886,7 +4886,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(data: string): void {
|
override send(data: string): void {
|
||||||
this.#sendCount += 1;
|
this.#sendCount += 1;
|
||||||
const request = JSON.parse(data) as { type?: string };
|
const request = JSON.parse(data) as { type?: string };
|
||||||
requestTypes.push(typeof request.type === "string" ? request.type : "");
|
requestTypes.push(typeof request.type === "string" ? request.type : "");
|
||||||
@@ -4979,7 +4979,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(data: string): void {
|
override send(data: string): void {
|
||||||
sendCount += 1;
|
sendCount += 1;
|
||||||
const request = JSON.parse(data) as Record<string, unknown>;
|
const request = JSON.parse(data) as Record<string, unknown>;
|
||||||
expect(typeof request.type).toBe("string");
|
expect(typeof request.type).toBe("string");
|
||||||
@@ -5272,7 +5272,7 @@ describe("openai-codex streaming", () => {
|
|||||||
this.scheduleOpen();
|
this.scheduleOpen();
|
||||||
}
|
}
|
||||||
|
|
||||||
send(_data: string): void {
|
override send(_data: string): void {
|
||||||
sendCount += 1;
|
sendCount += 1;
|
||||||
if (sendCount === 1) {
|
if (sendCount === 1) {
|
||||||
this.emitCodexResponse({
|
this.emitCodexResponse({
|
||||||
|
|||||||
@@ -109,11 +109,11 @@ export class ConfigError extends Error {
|
|||||||
this.#message = message;
|
this.#message = message;
|
||||||
}
|
}
|
||||||
|
|
||||||
get message(): string {
|
override get message(): string {
|
||||||
return this.#message;
|
return this.#message;
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(): string {
|
override toString(): string {
|
||||||
return this.message;
|
return this.message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -607,12 +607,12 @@ export class KeybindingsManager extends TuiKeybindingsManager {
|
|||||||
this.setUserBindings(mergeKeybindingsConfig(inheritedConfig, profileConfig));
|
this.setUserBindings(mergeKeybindingsConfig(inheritedConfig, profileConfig));
|
||||||
}
|
}
|
||||||
|
|
||||||
setUserBindings(userBindings: KeybindingsConfig): void {
|
override setUserBindings(userBindings: KeybindingsConfig): void {
|
||||||
this.#userBindings = userBindings;
|
this.#userBindings = userBindings;
|
||||||
super.setUserBindings(userBindings);
|
super.setUserBindings(userBindings);
|
||||||
}
|
}
|
||||||
|
|
||||||
getKeys(keybinding: Keybinding): KeyId[] {
|
override getKeys(keybinding: Keybinding): KeyId[] {
|
||||||
const keys = super.getKeys(keybinding);
|
const keys = super.getKeys(keybinding);
|
||||||
const fallbackKey = getFallbackKey(keybinding);
|
const fallbackKey = getFallbackKey(keybinding);
|
||||||
if (fallbackKey === undefined || this.#userBindings[keybinding] !== undefined) return keys;
|
if (fallbackKey === undefined || this.#userBindings[keybinding] !== undefined) return keys;
|
||||||
@@ -620,7 +620,7 @@ export class KeybindingsManager extends TuiKeybindingsManager {
|
|||||||
return removeKey(keys, fallbackKey);
|
return removeKey(keys, fallbackKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
getResolvedBindings(): KeybindingsConfig {
|
override getResolvedBindings(): KeybindingsConfig {
|
||||||
const resolved = super.getResolvedBindings();
|
const resolved = super.getResolvedBindings();
|
||||||
resolved[FOLLOW_UP_KEYBINDING] = keyConfigValue(this.getKeys(FOLLOW_UP_KEYBINDING));
|
resolved[FOLLOW_UP_KEYBINDING] = keyConfigValue(this.getKeys(FOLLOW_UP_KEYBINDING));
|
||||||
return resolved;
|
return resolved;
|
||||||
|
|||||||
@@ -87,11 +87,11 @@ export class HashlineFilesystem extends Filesystem {
|
|||||||
return resolvePlanPath(this.session, relativePath);
|
return resolvePlanPath(this.session, relativePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
canonicalPath(relativePath: string): string {
|
override canonicalPath(relativePath: string): string {
|
||||||
return canonicalSnapshotKey(this.resolveAbsolute(relativePath));
|
return canonicalSnapshotKey(this.resolveAbsolute(relativePath));
|
||||||
}
|
}
|
||||||
|
|
||||||
allowTagPathRecovery(authoredPath: string, resolvedPath: string): boolean {
|
override allowTagPathRecovery(authoredPath: string, resolvedPath: string): boolean {
|
||||||
// Internal-URL authored targets (`local://`, `vault://`, …) are approved
|
// Internal-URL authored targets (`local://`, `vault://`, …) are approved
|
||||||
// at the lower "read" privilege; never let one redirect onto a "write".
|
// at the lower "read" privilege; never let one redirect onto a "write".
|
||||||
if (isInternalUrlPath(authoredPath)) return false;
|
if (isInternalUrlPath(authoredPath)) return false;
|
||||||
@@ -125,7 +125,7 @@ export class HashlineFilesystem extends Filesystem {
|
|||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
async readBinary(relativePath: string): Promise<Uint8Array | undefined> {
|
override async readBinary(relativePath: string): Promise<Uint8Array | undefined> {
|
||||||
const absolutePath = this.resolveAbsolute(relativePath);
|
const absolutePath = this.resolveAbsolute(relativePath);
|
||||||
if (isNotebookPath(absolutePath)) return undefined;
|
if (isNotebookPath(absolutePath)) return undefined;
|
||||||
try {
|
try {
|
||||||
@@ -136,7 +136,7 @@ export class HashlineFilesystem extends Filesystem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async preflightWrite(relativePath: string, options?: PreflightWriteOptions): Promise<void> {
|
override async preflightWrite(relativePath: string, options?: PreflightWriteOptions): Promise<void> {
|
||||||
const fileOp = options?.fileOp;
|
const fileOp = options?.fileOp;
|
||||||
if (fileOp?.kind === "rem") {
|
if (fileOp?.kind === "rem") {
|
||||||
enforcePlanModeWrite(this.session, relativePath, { op: "delete" });
|
enforcePlanModeWrite(this.session, relativePath, { op: "delete" });
|
||||||
@@ -149,7 +149,7 @@ export class HashlineFilesystem extends Filesystem {
|
|||||||
enforcePlanModeWrite(this.session, relativePath, { op: "update" });
|
enforcePlanModeWrite(this.session, relativePath, { op: "update" });
|
||||||
}
|
}
|
||||||
|
|
||||||
async delete(relativePath: string): Promise<void> {
|
override async delete(relativePath: string): Promise<void> {
|
||||||
enforcePlanModeWrite(this.session, relativePath, { op: "delete" });
|
enforcePlanModeWrite(this.session, relativePath, { op: "delete" });
|
||||||
const absolutePath = this.resolveAbsolute(relativePath);
|
const absolutePath = this.resolveAbsolute(relativePath);
|
||||||
try {
|
try {
|
||||||
@@ -168,7 +168,7 @@ export class HashlineFilesystem extends Filesystem {
|
|||||||
invalidateFsScanAfterWrite(absolutePath);
|
invalidateFsScanAfterWrite(absolutePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
async move(fromRelative: string, toRelative: string, content?: string): Promise<void> {
|
override async move(fromRelative: string, toRelative: string, content?: string): Promise<void> {
|
||||||
enforcePlanModeWrite(this.session, fromRelative, { op: "update", move: toRelative });
|
enforcePlanModeWrite(this.session, fromRelative, { op: "update", move: toRelative });
|
||||||
const fromAbsolute = this.resolveAbsolute(fromRelative);
|
const fromAbsolute = this.resolveAbsolute(fromRelative);
|
||||||
const toAbsolute = this.resolveAbsolute(toRelative);
|
const toAbsolute = this.resolveAbsolute(toRelative);
|
||||||
@@ -240,7 +240,7 @@ export class HashlineFilesystem extends Filesystem {
|
|||||||
return { text: content };
|
return { text: content };
|
||||||
}
|
}
|
||||||
|
|
||||||
async exists(relativePath: string): Promise<boolean> {
|
override async exists(relativePath: string): Promise<boolean> {
|
||||||
const absolutePath = this.resolveAbsolute(relativePath);
|
const absolutePath = this.resolveAbsolute(relativePath);
|
||||||
return Bun.file(absolutePath).exists();
|
return Bun.file(absolutePath).exists();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -258,7 +258,7 @@ export class AgentHubOverlayComponent extends Container {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Tear down every subscription and timer. Called by the overlay owner on close. */
|
/** Tear down every subscription and timer. Called by the overlay owner on close. */
|
||||||
dispose(): void {
|
override dispose(): void {
|
||||||
for (const unsubscribe of this.#unsubscribers.splice(0)) unsubscribe();
|
for (const unsubscribe of this.#unsubscribers.splice(0)) unsubscribe();
|
||||||
if (this.#ageTimer) {
|
if (this.#ageTimer) {
|
||||||
clearInterval(this.#ageTimer);
|
clearInterval(this.#ageTimer);
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export class BorderedLoader extends Container {
|
|||||||
this.#loader.handleInput(data);
|
this.#loader.handleInput(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose(): void {
|
override dispose(): void {
|
||||||
this.#loader.dispose();
|
this.#loader.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -466,7 +466,7 @@ export class CustomEditor extends Editor {
|
|||||||
/** Decorate magic keywords, attachments, and the queue-composer header/list markers.
|
/** Decorate magic keywords, attachments, and the queue-composer header/list markers.
|
||||||
* Queue shorthand reserves its first logical line as a dim `Queueing` label; sequential
|
* Queue shorthand reserves its first logical line as a dim `Queueing` label; sequential
|
||||||
* item markers use the accent color so separate follow-ups remain visible while composing. */
|
* item markers use the accent color so separate follow-ups remain visible while composing. */
|
||||||
decorateText = (text: string): string => {
|
override decorateText = (text: string): string => {
|
||||||
const editorText = this.getText();
|
const editorText = this.getText();
|
||||||
const animated = this.focused && this.#shimmerEnabled() && hasMagicKeyword(editorText);
|
const animated = this.focused && this.#shimmerEnabled() && hasMagicKeyword(editorText);
|
||||||
const phase = animated ? (Date.now() % CustomEditor.SHIMMER_PERIOD_MS) / CustomEditor.SHIMMER_PERIOD_MS : 0;
|
const phase = animated ? (Date.now() % CustomEditor.SHIMMER_PERIOD_MS) / CustomEditor.SHIMMER_PERIOD_MS : 0;
|
||||||
@@ -775,7 +775,7 @@ export class CustomEditor extends Editor {
|
|||||||
void promise.then(this.#onPasteSettled, this.#onPasteSettled);
|
void promise.then(this.#onPasteSettled, this.#onPasteSettled);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleInput(data: string): void {
|
override handleInput(data: string): void {
|
||||||
// Serialize behind any in-flight async paste so a trailing Enter / follow-up key can't
|
// Serialize behind any in-flight async paste so a trailing Enter / follow-up key can't
|
||||||
// submit before the clipboard image reaches `pendingImages` (Codex PR #3602 review).
|
// submit before the clipboard image reaches `pendingImages` (Codex PR #3602 review).
|
||||||
if (this.#pasteInFlight > 0) {
|
if (this.#pasteInFlight > 0) {
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ export class HookInputComponent extends Container {
|
|||||||
this.#input.pasteText(text);
|
this.#input.pasteText(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose(): void {
|
override dispose(): void {
|
||||||
this.#countdown?.dispose();
|
this.#countdown?.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -135,7 +135,7 @@ class OutlinedList extends Container {
|
|||||||
this.invalidate();
|
this.invalidate();
|
||||||
}
|
}
|
||||||
|
|
||||||
render(width: number): readonly string[] {
|
override render(width: number): readonly string[] {
|
||||||
const borderColor = (text: string) => theme.fg("border", text);
|
const borderColor = (text: string) => theme.fg("border", text);
|
||||||
const horizontal = borderColor(theme.boxRound.horizontal.repeat(Math.max(1, width)));
|
const horizontal = borderColor(theme.boxRound.horizontal.repeat(Math.max(1, width)));
|
||||||
const innerWidth = Math.max(1, width - 2);
|
const innerWidth = Math.max(1, width - 2);
|
||||||
@@ -685,7 +685,7 @@ export class HookSelectorComponent extends Container {
|
|||||||
return super.render(renderWidth);
|
return super.render(renderWidth);
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose(): void {
|
override dispose(): void {
|
||||||
this.#countdown?.dispose();
|
this.#countdown?.dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -905,7 +905,7 @@ export class SessionSelectorComponent extends Container {
|
|||||||
* is mounted the list is detached from the child tree, so Container's
|
* is mounted the list is detached from the child tree, so Container's
|
||||||
* child-walking dispose would miss its pending history-merge timer.
|
* child-walking dispose would miss its pending history-merge timer.
|
||||||
*/
|
*/
|
||||||
dispose(): void {
|
override dispose(): void {
|
||||||
this.#sessionList.dispose();
|
this.#sessionList.dispose();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
@@ -971,7 +971,7 @@ export class SessionSelectorComponent extends Container {
|
|||||||
* footer is always visible and never drifts as the list window resizes. The
|
* footer is always visible and never drifts as the list window resizes. The
|
||||||
* in-editor selector just appends the footer directly.
|
* in-editor selector just appends the footer directly.
|
||||||
*/
|
*/
|
||||||
render(width: number): readonly string[] {
|
override render(width: number): readonly string[] {
|
||||||
const lines: string[] = [];
|
const lines: string[] = [];
|
||||||
for (const child of this.children) {
|
for (const child of this.children) {
|
||||||
const childLines = child.render(width);
|
const childLines = child.render(width);
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ export class AgentParsingError extends Error {
|
|||||||
this.name = "AgentParsingError";
|
this.name = "AgentParsingError";
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(): string {
|
override toString(): string {
|
||||||
const details: string[] = [this.message];
|
const details: string[] = [this.message];
|
||||||
if (this.source !== undefined) {
|
if (this.source !== undefined) {
|
||||||
details.push(`Source: ${JSON.stringify(this.source)}`);
|
details.push(`Source: ${JSON.stringify(this.source)}`);
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ function createStopOnTextCriteria(
|
|||||||
this.#text = text;
|
this.#text = text;
|
||||||
}
|
}
|
||||||
|
|
||||||
_call(inputIds: number[][]): boolean[] {
|
override _call(inputIds: number[][]): boolean[] {
|
||||||
return inputIds.map(ids => {
|
return inputIds.map(ids => {
|
||||||
const tail = ids.slice(-STOP_DECODE_WINDOW_TOKENS);
|
const tail = ids.slice(-STOP_DECODE_WINDOW_TOKENS);
|
||||||
const decoded = this.#tokenizer.decode(tail, {
|
const decoded = this.#tokenizer.decode(tail, {
|
||||||
|
|||||||
@@ -372,7 +372,7 @@ export class DuckDuckGoProvider extends SearchProvider {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
override isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ export class EcosiaProvider extends SearchProvider {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
override isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -458,7 +458,7 @@ export class ExaProvider extends SearchProvider {
|
|||||||
* still uses {@link isAvailable} so an unrelated configured provider
|
* still uses {@link isAvailable} so an unrelated configured provider
|
||||||
* keeps priority over the public fallback.
|
* keeps priority over the public fallback.
|
||||||
*/
|
*/
|
||||||
isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
override isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
||||||
return this.#settingsAllowSearch();
|
return this.#settingsAllowSearch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ export class FirecrawlProvider extends SearchProvider {
|
|||||||
* Firecrawl supports keyless mode, so an explicit user selection
|
* Firecrawl supports keyless mode, so an explicit user selection
|
||||||
* (`webSearch: firecrawl`) works without any credential configured.
|
* (`webSearch: firecrawl`) works without any credential configured.
|
||||||
*/
|
*/
|
||||||
isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
override isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ export class MojeekProvider extends SearchProvider {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
override isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -973,7 +973,7 @@ export class PerplexityProvider extends SearchProvider {
|
|||||||
* configured provider keeps priority over the anonymous/OpenRouter
|
* configured provider keeps priority over the anonymous/OpenRouter
|
||||||
* fallbacks.
|
* fallbacks.
|
||||||
*/
|
*/
|
||||||
isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
override isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -189,7 +189,7 @@ export class PublicWebProvider extends SearchProvider {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
override isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ export class StartpageProvider extends SearchProvider {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
override isExplicitlyAvailable(_authStorage: AuthStorage): boolean {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,7 +27,10 @@ class DetachingRewriteStorage extends MemorySessionStorage {
|
|||||||
guardRejections = 0;
|
guardRejections = 0;
|
||||||
readonly #writers = new Set<DetachableWriter>();
|
readonly #writers = new Set<DetachableWriter>();
|
||||||
|
|
||||||
openWriter(path: string, options?: { flags?: "a" | "w"; onError?: (err: Error) => void }): SessionStorageWriter {
|
override openWriter(
|
||||||
|
path: string,
|
||||||
|
options?: { flags?: "a" | "w"; onError?: (err: Error) => void },
|
||||||
|
): SessionStorageWriter {
|
||||||
const inner = super.openWriter(path, options);
|
const inner = super.openWriter(path, options);
|
||||||
const writers = this.#writers;
|
const writers = this.#writers;
|
||||||
const detachedLines = this.detachedLines;
|
const detachedLines = this.detachedLines;
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import * as snapcompact from "@oh-my-pi/snapcompact";
|
|||||||
class CountingMemorySessionStorage extends MemorySessionStorage {
|
class CountingMemorySessionStorage extends MemorySessionStorage {
|
||||||
writeTextSyncCalls = 0;
|
writeTextSyncCalls = 0;
|
||||||
|
|
||||||
writeTextSync(filePath: string, content: string): void {
|
override writeTextSync(filePath: string, content: string): void {
|
||||||
this.writeTextSyncCalls++;
|
this.writeTextSyncCalls++;
|
||||||
super.writeTextSync(filePath, content);
|
super.writeTextSync(filePath, content);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -150,11 +150,11 @@ export class InMemoryFilesystem extends Filesystem {
|
|||||||
return { text: content };
|
return { text: content };
|
||||||
}
|
}
|
||||||
|
|
||||||
async delete(path: string): Promise<void> {
|
override async delete(path: string): Promise<void> {
|
||||||
if (!this.#files.delete(path)) throw new NotFoundError(path);
|
if (!this.#files.delete(path)) throw new NotFoundError(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
async move(from: string, to: string, content?: string): Promise<void> {
|
override async move(from: string, to: string, content?: string): Promise<void> {
|
||||||
const existing = this.#files.get(from);
|
const existing = this.#files.get(from);
|
||||||
if (existing === undefined) throw new NotFoundError(from);
|
if (existing === undefined) throw new NotFoundError(from);
|
||||||
const finalContent = content ?? existing;
|
const finalContent = content ?? existing;
|
||||||
@@ -162,7 +162,7 @@ export class InMemoryFilesystem extends Filesystem {
|
|||||||
this.#files.delete(from);
|
this.#files.delete(from);
|
||||||
}
|
}
|
||||||
|
|
||||||
async exists(path: string): Promise<boolean> {
|
override async exists(path: string): Promise<boolean> {
|
||||||
return this.#files.has(path);
|
return this.#files.has(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,7 +199,7 @@ export class NodeFilesystem extends Filesystem {
|
|||||||
return file.text();
|
return file.text();
|
||||||
}
|
}
|
||||||
|
|
||||||
async readBinary(path: string): Promise<Uint8Array> {
|
override async readBinary(path: string): Promise<Uint8Array> {
|
||||||
try {
|
try {
|
||||||
return await fs.readFile(path);
|
return await fs.readFile(path);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -213,7 +213,7 @@ export class NodeFilesystem extends Filesystem {
|
|||||||
return { text: content };
|
return { text: content };
|
||||||
}
|
}
|
||||||
|
|
||||||
async delete(path: string): Promise<void> {
|
override async delete(path: string): Promise<void> {
|
||||||
try {
|
try {
|
||||||
await fs.rm(path);
|
await fs.rm(path);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@@ -222,7 +222,7 @@ export class NodeFilesystem extends Filesystem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async move(from: string, to: string, content?: string): Promise<void> {
|
override async move(from: string, to: string, content?: string): Promise<void> {
|
||||||
if (content !== undefined) {
|
if (content !== undefined) {
|
||||||
await Bun.write(to, content);
|
await Bun.write(to, content);
|
||||||
await this.delete(from);
|
await this.delete(from);
|
||||||
@@ -236,11 +236,11 @@ export class NodeFilesystem extends Filesystem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
canonicalPath(path: string): string {
|
override canonicalPath(path: string): string {
|
||||||
return pathModule.resolve(path);
|
return pathModule.resolve(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
async exists(path: string): Promise<boolean> {
|
override async exists(path: string): Promise<boolean> {
|
||||||
return Bun.file(path).exists();
|
return Bun.file(path).exists();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ export class InMemorySnapshotStore extends SnapshotStore {
|
|||||||
return history?.find(version => version.text === fullText) ?? null;
|
return history?.find(version => version.text === fullText) ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
findByHash(hash: string): Snapshot[] {
|
override findByHash(hash: string): Snapshot[] {
|
||||||
const matches: Snapshot[] = [];
|
const matches: Snapshot[] = [];
|
||||||
for (const history of this.#versions.values()) {
|
for (const history of this.#versions.values()) {
|
||||||
for (const version of history) {
|
for (const version of history) {
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ class BlockingFilesystem extends InMemoryFilesystem {
|
|||||||
for (const filePath of blocked) this.#blocked.add(filePath);
|
for (const filePath of blocked) this.#blocked.add(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
async preflightWrite(filePath: string): Promise<void> {
|
override async preflightWrite(filePath: string): Promise<void> {
|
||||||
if (this.#blocked.has(filePath)) throw new Error(`blocked write: ${filePath}`);
|
if (this.#blocked.has(filePath)) throw new Error(`blocked write: ${filePath}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,7 +158,7 @@ describe("Patcher snapshot tag integrity", () => {
|
|||||||
// call returned), but `writeText` echoes back a *reformatted* copy — spaces
|
// call returned), but `writeText` echoes back a *reformatted* copy — spaces
|
||||||
// turned into tabs, exactly the corruption reported against the ACP bridge.
|
// turned into tabs, exactly the corruption reported against the ACP bridge.
|
||||||
class DriftingFilesystem extends InMemoryFilesystem {
|
class DriftingFilesystem extends InMemoryFilesystem {
|
||||||
async writeText(path: string, content: string): Promise<WriteResult> {
|
override async writeText(path: string, content: string): Promise<WriteResult> {
|
||||||
const drifted = content.replace(/^ {4}/gm, "\t");
|
const drifted = content.replace(/^ {4}/gm, "\t");
|
||||||
await super.writeText(path, drifted);
|
await super.writeText(path, drifted);
|
||||||
return { text: drifted };
|
return { text: drifted };
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ function withFrozenNow<T>(iso: string, fn: () => T): T {
|
|||||||
else super(value);
|
else super(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static now(): number {
|
static override now(): number {
|
||||||
return fixedMs;
|
return fixedMs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ export class CancellableLoader extends Loader {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dispose(): void {
|
override dispose(): void {
|
||||||
this.stop();
|
this.stop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export class Loader extends Text {
|
|||||||
this.start();
|
this.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
render(width: number): readonly string[] {
|
override render(width: number): readonly string[] {
|
||||||
const source = super.render(width);
|
const source = super.render(width);
|
||||||
if (source !== this.#layoutSource) {
|
if (source !== this.#layoutSource) {
|
||||||
const paddingX = getPaddingX(1);
|
const paddingX = getPaddingX(1);
|
||||||
|
|||||||
@@ -804,11 +804,11 @@ markdownParser.use({
|
|||||||
// (no `m` flag), and stickiness only removes the futile later attempts. The
|
// (no `m` flag), and stickiness only removes the futile later attempts. The
|
||||||
// flags/anchor guard below skips any rule a future marked version changes.
|
// flags/anchor guard below skips any rule a future marked version changes.
|
||||||
class AnchoredAtZero extends RegExp {
|
class AnchoredAtZero extends RegExp {
|
||||||
exec(str: string): RegExpExecArray | null {
|
override exec(str: string): RegExpExecArray | null {
|
||||||
this.lastIndex = 0; // sticky matches set lastIndex; rules are shared
|
this.lastIndex = 0; // sticky matches set lastIndex; rules are shared
|
||||||
return super.exec(str);
|
return super.exec(str);
|
||||||
}
|
}
|
||||||
test(str: string): boolean {
|
override test(str: string): boolean {
|
||||||
this.lastIndex = 0;
|
this.lastIndex = 0;
|
||||||
return super.test(str);
|
return super.test(str);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ class WrappingLinesComponent implements Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class UnknownViewportTerminal extends VirtualTerminal {
|
class UnknownViewportTerminal extends VirtualTerminal {
|
||||||
isNativeViewportAtBottom(): undefined {
|
override isNativeViewportAtBottom(): undefined {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -96,7 +96,7 @@ class StaleBottomViewportTerminal extends VirtualTerminal {
|
|||||||
#previous: boolean | undefined;
|
#previous: boolean | undefined;
|
||||||
#returnStale = false;
|
#returnStale = false;
|
||||||
|
|
||||||
isNativeViewportAtBottom(): boolean | undefined {
|
override isNativeViewportAtBottom(): boolean | undefined {
|
||||||
const current = super.isNativeViewportAtBottom();
|
const current = super.isNativeViewportAtBottom();
|
||||||
if (this.#returnStale) {
|
if (this.#returnStale) {
|
||||||
this.#returnStale = false;
|
this.#returnStale = false;
|
||||||
@@ -113,18 +113,18 @@ class StaleBottomViewportTerminal extends VirtualTerminal {
|
|||||||
class CountingViewportTerminal extends VirtualTerminal {
|
class CountingViewportTerminal extends VirtualTerminal {
|
||||||
viewportProbeCount = 0;
|
viewportProbeCount = 0;
|
||||||
|
|
||||||
isNativeViewportAtBottom(): boolean | undefined {
|
override isNativeViewportAtBottom(): boolean | undefined {
|
||||||
this.viewportProbeCount += 1;
|
this.viewportProbeCount += 1;
|
||||||
return super.isNativeViewportAtBottom();
|
return super.isNativeViewportAtBottom();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class LegacyKeyboardVirtualTerminal extends VirtualTerminal {
|
class LegacyKeyboardVirtualTerminal extends VirtualTerminal {
|
||||||
get keyboardEnhancementEnterSequence(): string | null {
|
override get keyboardEnhancementEnterSequence(): string | null {
|
||||||
return undefined as unknown as string | null;
|
return undefined as unknown as string | null;
|
||||||
}
|
}
|
||||||
|
|
||||||
get keyboardEnhancementExitSequence(): string | null {
|
override get keyboardEnhancementExitSequence(): string | null {
|
||||||
return undefined as unknown as string | null;
|
return undefined as unknown as string | null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -425,7 +425,7 @@ const BURST_STEP_METADATA = {
|
|||||||
} satisfies Record<BurstStepKind, BurstStepMetadata>;
|
} satisfies Record<BurstStepKind, BurstStepMetadata>;
|
||||||
|
|
||||||
class UnknownViewportTerminal extends VirtualTerminal {
|
class UnknownViewportTerminal extends VirtualTerminal {
|
||||||
isNativeViewportAtBottom(): undefined {
|
override isNativeViewportAtBottom(): undefined {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -433,7 +433,7 @@ class UnknownViewportTerminal extends VirtualTerminal {
|
|||||||
class IntermittentUnknownViewportTerminal extends VirtualTerminal {
|
class IntermittentUnknownViewportTerminal extends VirtualTerminal {
|
||||||
#probeCount = 0;
|
#probeCount = 0;
|
||||||
|
|
||||||
isNativeViewportAtBottom(): boolean | undefined {
|
override isNativeViewportAtBottom(): boolean | undefined {
|
||||||
this.#probeCount += 1;
|
this.#probeCount += 1;
|
||||||
return this.#probeCount % 3 === 0 ? undefined : super.isNativeViewportAtBottom();
|
return this.#probeCount % 3 === 0 ? undefined : super.isNativeViewportAtBottom();
|
||||||
}
|
}
|
||||||
@@ -443,7 +443,7 @@ class StaleBottomTerminal extends VirtualTerminal {
|
|||||||
#previous: boolean | undefined;
|
#previous: boolean | undefined;
|
||||||
#returnStale = false;
|
#returnStale = false;
|
||||||
|
|
||||||
isNativeViewportAtBottom(): boolean | undefined {
|
override isNativeViewportAtBottom(): boolean | undefined {
|
||||||
const current = super.isNativeViewportAtBottom();
|
const current = super.isNativeViewportAtBottom();
|
||||||
if (this.#returnStale) {
|
if (this.#returnStale) {
|
||||||
this.#returnStale = false;
|
this.#returnStale = false;
|
||||||
|
|||||||
@@ -489,7 +489,7 @@ class CallArgumentSwapMutation extends BaseAstMutation {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutate(content: string, rng: () => number): [string, MutationInfo] {
|
override mutate(content: string, rng: () => number): [string, MutationInfo] {
|
||||||
const parsed = parseCode(content);
|
const parsed = parseCode(content);
|
||||||
if (!parsed) return [content, noopInfo()];
|
if (!parsed) return [content, noopInfo()];
|
||||||
const candidates = this.collectCandidates(parsed);
|
const candidates = this.collectCandidates(parsed);
|
||||||
@@ -722,7 +722,7 @@ class IdentifierMultiEditMutation extends BaseAstMutation {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutate(content: string, rng: () => number): [string, MutationInfo] {
|
override mutate(content: string, rng: () => number): [string, MutationInfo] {
|
||||||
const parsed = parseCode(content);
|
const parsed = parseCode(content);
|
||||||
if (!parsed) return [content, noopInfo()];
|
if (!parsed) return [content, noopInfo()];
|
||||||
const candidates = this.collectCandidates(parsed);
|
const candidates = this.collectCandidates(parsed);
|
||||||
@@ -1036,7 +1036,7 @@ class SwapAdjacentLinesMutation extends BaseAstMutation {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutate(content: string, rng: () => number): [string, MutationInfo] {
|
override mutate(content: string, rng: () => number): [string, MutationInfo] {
|
||||||
const parsed = parseCode(content);
|
const parsed = parseCode(content);
|
||||||
if (!parsed) return [content, noopInfo()];
|
if (!parsed) return [content, noopInfo()];
|
||||||
const candidates = this.collectCandidates(parsed);
|
const candidates = this.collectCandidates(parsed);
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ export class FrontmatterError extends Error {
|
|||||||
this.name = "FrontmatterError";
|
this.name = "FrontmatterError";
|
||||||
}
|
}
|
||||||
|
|
||||||
toString(): string {
|
override toString(): string {
|
||||||
// Format the error with stack and detail, including the error message, stack, and source if present
|
// Format the error with stack and detail, including the error message, stack, and source if present
|
||||||
const details: string[] = [this.message];
|
const details: string[] = [this.message];
|
||||||
if (this.source !== undefined) {
|
if (this.source !== undefined) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class FixedDate extends NativeDate {
|
|||||||
super(value === undefined ? fixtureNow() : value);
|
super(value === undefined ? fixtureNow() : value);
|
||||||
}
|
}
|
||||||
|
|
||||||
static now(): number {
|
static override now(): number {
|
||||||
return fixtureNow();
|
return fixtureNow();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
"moduleResolution": "Bundler",
|
"moduleResolution": "Bundler",
|
||||||
"moduleDetection": "force",
|
"moduleDetection": "force",
|
||||||
"strict": true,
|
"strict": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true,
|
||||||
"allowArbitraryExtensions": true,
|
"allowArbitraryExtensions": true,
|
||||||
"verbatimModuleSyntax": true,
|
"verbatimModuleSyntax": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user