From 8f6fe0dc28439ede5eea561fd3bcdb9db49831e2 Mon Sep 17 00:00:00 2001 From: rhit-lid2 <59123825+NeoLi00@users.noreply.github.com> Date: Sun, 19 Jul 2026 22:18:42 +0530 Subject: [PATCH] chore: fix linting issues --- .../config/ProviderInstancesConfig.tsx | 10 +- apps/gui/src/components/play/HandoffModal.tsx | 111 ++++++++++-------- apps/gui/src/components/play/InteractView.tsx | 8 +- apps/gui/src/components/play/PromptModal.tsx | 6 +- .../src/components/play/PromptSwitcher.tsx | 2 +- apps/gui/src/components/ui/combobox.tsx | 1 - apps/gui/src/components/ui/input-group.tsx | 5 +- apps/gui/src/lib/simulation-types.ts | 9 +- apps/gui/src/lib/simulation/alias-handoff.ts | 2 +- apps/gui/src/lib/simulation/turn-executor.ts | 7 +- packages/actor/src/actor-prompt-builder.ts | 1 - packages/intent/tests/intent.test.ts | 2 +- packages/llm/src/llm.ts | 4 +- packages/llm/src/providers/mock.ts | 1 + packages/llm/tests/openai.test.ts | 1 + packages/memory/src/buffer.ts | 2 +- packages/memory/src/handoff.ts | 8 +- packages/voice/src/dehydration.ts | 6 +- packages/voice/src/hydration.ts | 10 +- tests/integration/actor-monologue.test.ts | 1 - tests/integration/game-loop.test.ts | 2 +- 21 files changed, 105 insertions(+), 94 deletions(-) diff --git a/apps/gui/src/components/config/ProviderInstancesConfig.tsx b/apps/gui/src/components/config/ProviderInstancesConfig.tsx index f405581..ad84f2b 100644 --- a/apps/gui/src/components/config/ProviderInstancesConfig.tsx +++ b/apps/gui/src/components/config/ProviderInstancesConfig.tsx @@ -43,13 +43,7 @@ import { CardTitle, CardAction, } from "@/components/ui/card"; -import { - Item, - ItemContent, - ItemGroup, - ItemTitle, - ItemDescription, -} from "@/components/ui/item"; +import { Item, ItemContent, ItemGroup, ItemTitle } from "@/components/ui/item"; import { Empty, EmptyTitle, EmptyDescription } from "@/components/ui/empty"; import { cn } from "@/lib/utils"; import { RefreshCwIcon } from "lucide-react"; @@ -200,14 +194,12 @@ export function ProviderInstancesConfig({ fetchModelsForExistingInstance(selectedInstanceId); } } - // eslint-disable-next-line react-hooks/exhaustive-deps }, [selectedInstanceId, instances, availableProviders]); // Re-fetch models when provider/key/endpoint changes on new instance form useEffect(() => { if (selectedInstanceId !== "new") return; fetchModelsForNewInstance(editProvider, editKey, editEndpointUrl); - // eslint-disable-next-line react-hooks/exhaustive-deps }, [editProvider, editKey, editEndpointUrl, selectedInstanceId]); const handleProviderChange = (providerId: string | null) => { diff --git a/apps/gui/src/components/play/HandoffModal.tsx b/apps/gui/src/components/play/HandoffModal.tsx index c8186a4..55af187 100644 --- a/apps/gui/src/components/play/HandoffModal.tsx +++ b/apps/gui/src/components/play/HandoffModal.tsx @@ -126,66 +126,73 @@ export function HandoffModal({ entry, onClose }: HandoffModalProps) {

Memory Ledger Additions

- {chunks.map((chunk: any, index: number) => ( -
-
-
- {chunk.content} -
- - Importance: {chunk.importance} - -
- - {chunk.quotes && chunk.quotes.length > 0 && ( -
- {chunk.quotes.map((quote: string, qIdx: number) => ( -
“{quote}”
- ))} -
- )} - -
- {chunk.retainInBuffer ? ( + {chunks.map( + ( + chunk: { content: string; importance: number }, + index: number, + ) => ( +
+
+
+ {chunk.content} +
- Pinned in Buffer - - ) : ( - - Pruned from Buffer + Importance: {chunk.importance} +
+ + {chunk.quotes && chunk.quotes.length > 0 && ( +
+ {chunk.quotes.map((quote: string, qIdx: number) => ( +
“{quote}”
+ ))} +
)} - {chunk.involvedEntityIds && - chunk.involvedEntityIds.length > 0 && ( -
- Entities: - {chunk.involvedEntityIds.map((entId: string) => ( - - {entId} - - ))} -
+
+ {chunk.retainInBuffer ? ( + + Pinned in Buffer + + ) : ( + + Pruned from Buffer + )} + + {chunk.involvedEntityIds && + chunk.involvedEntityIds.length > 0 && ( +
+ Entities: + {chunk.involvedEntityIds.map( + (entId: string) => ( + + {entId} + + ), + )} +
+ )} +
-
- ))} + ), + )}
)} diff --git a/apps/gui/src/components/play/InteractView.tsx b/apps/gui/src/components/play/InteractView.tsx index 68ae954..503b484 100644 --- a/apps/gui/src/components/play/InteractView.tsx +++ b/apps/gui/src/components/play/InteractView.tsx @@ -17,13 +17,11 @@ import { function IntentTag({ intent, - isSelf, playerAliases, playerId, entities, }: { intent: SimSnapshot["log"][number]["intents"][number]; - isSelf?: boolean; playerAliases: Record; playerId: string; entities: SimSnapshot["entities"]; @@ -59,7 +57,10 @@ function IntentTag({ aliases: viewerAliasesMap, }; - const textToDisplay = hydrate(intent.content, viewerEntityMock as any); + const textToDisplay = hydrate( + intent.content, + viewerEntityMock as unknown as Parameters[1], + ); const modifiersStr = intent.modifiers && intent.modifiers.length > 0 ? ( @@ -147,7 +148,6 @@ function LogEntryCard({ { if (!promptBreakdown) return []; @@ -66,7 +66,7 @@ export function PromptModal({ entry, onClose }: PromptModalProps) { return ( !open && onClose()}> - + Raw Prompts & Token Usage ({entry.entityName}) diff --git a/apps/gui/src/components/play/PromptSwitcher.tsx b/apps/gui/src/components/play/PromptSwitcher.tsx index 05ce8a6..b03677c 100644 --- a/apps/gui/src/components/play/PromptSwitcher.tsx +++ b/apps/gui/src/components/play/PromptSwitcher.tsx @@ -2,7 +2,7 @@ interface PromptSwitcherProps { activeTab: string; - onTabChange: (tab: any) => void; + onTabChange: (tab: string) => void; hasActor: boolean; hasDecoder: boolean; validatorCalls?: { intentIndex: number; intentContent: string }[]; diff --git a/apps/gui/src/components/ui/combobox.tsx b/apps/gui/src/components/ui/combobox.tsx index 52d5399..a4d0ebe 100644 --- a/apps/gui/src/components/ui/combobox.tsx +++ b/apps/gui/src/components/ui/combobox.tsx @@ -5,7 +5,6 @@ import { Combobox as ComboboxPrimitive } from "@base-ui/react"; import { CheckIcon, ChevronDownIcon, XIcon } from "lucide-react"; import { cn } from "@/lib/utils"; -import { Button } from "@/components/ui/button"; import { InputGroup, InputGroupAddon, diff --git a/apps/gui/src/components/ui/input-group.tsx b/apps/gui/src/components/ui/input-group.tsx index d005a09..2caa3ed 100644 --- a/apps/gui/src/components/ui/input-group.tsx +++ b/apps/gui/src/components/ui/input-group.tsx @@ -99,12 +99,13 @@ function InputGroupButton({ return React.cloneElement(render, { className: cn( inputGroupButtonVariants({ size }), - (render.props as any)?.className, + (render.props as Record)?.className as + string | undefined, className, ), type, ...props, - } as any); + } as Record as React.HTMLAttributes); } return ( diff --git a/apps/gui/src/lib/simulation-types.ts b/apps/gui/src/lib/simulation-types.ts index c1e53c2..81037f3 100644 --- a/apps/gui/src/lib/simulation-types.ts +++ b/apps/gui/src/lib/simulation-types.ts @@ -38,6 +38,13 @@ export interface ValidatorCall { }; } +export interface HandoffResult { + chunks: { + content: string; + importance: number; + }[]; +} + export interface LogEntry { turn: number; entityId: string; @@ -46,7 +53,7 @@ export interface LogEntry { intents: IntentInfo[]; timestamp: string; isHandoff?: boolean; - handoffResult?: any; + handoffResult?: HandoffResult; decodedIntents?: IntentInfo[]; validatorCalls?: ValidatorCall[]; rawPrompt?: PromptBreakdown; diff --git a/apps/gui/src/lib/simulation/alias-handoff.ts b/apps/gui/src/lib/simulation/alias-handoff.ts index 22e6ebe..f80bc03 100644 --- a/apps/gui/src/lib/simulation/alias-handoff.ts +++ b/apps/gui/src/lib/simulation/alias-handoff.ts @@ -39,7 +39,7 @@ export async function runHandoffResolution(session: SimSession): Promise { worldState.clock.get(), ); if (ran) { - const lastResult = (handoffEngine as any).lastResult; + const lastResult = handoffEngine.lastResult; const lastCall = session.handoffProvider.lastCalls?.[ (session.handoffProvider.lastCalls?.length || 0) - 1 diff --git a/apps/gui/src/lib/simulation/turn-executor.ts b/apps/gui/src/lib/simulation/turn-executor.ts index 60dcb8c..edaa2b9 100644 --- a/apps/gui/src/lib/simulation/turn-executor.ts +++ b/apps/gui/src/lib/simulation/turn-executor.ts @@ -68,11 +68,8 @@ async function processIntents( minutesToAdvance: outcome.timeDelta?.minutesToAdvance, }); - if ( - intent.type === "action" && - (session.architect.validator as any).lastResult - ) { - const lastResult = (session.architect.validator as any).lastResult; + if (intent.type === "action" && session.architect.validator.lastResult) { + const lastResult = session.architect.validator.lastResult; let usage = undefined; if ( session.validatorProvider.lastCalls && diff --git a/packages/actor/src/actor-prompt-builder.ts b/packages/actor/src/actor-prompt-builder.ts index 2cd0676..ab4ff82 100644 --- a/packages/actor/src/actor-prompt-builder.ts +++ b/packages/actor/src/actor-prompt-builder.ts @@ -4,7 +4,6 @@ import { WorldState, naturalizeTime, serializeSubjectiveWorldState, - resolveAlias, } from "@omnia/core"; import { BufferEntry, diff --git a/packages/intent/tests/intent.test.ts b/packages/intent/tests/intent.test.ts index b9ed1b3..88a1e88 100644 --- a/packages/intent/tests/intent.test.ts +++ b/packages/intent/tests/intent.test.ts @@ -1,7 +1,7 @@ import { describe, test, expect } from "vitest"; import { WorldState, Entity } from "@omnia/core"; import { MockLLMProvider } from "@omnia/llm"; -import { IntentDecoder, IntentSequence } from "@omnia/intent"; +import { IntentDecoder } from "@omnia/intent"; describe("IntentDecoder Unit Tests (Tier 1)", () => { test("decodes prose with a single action intent", async () => { diff --git a/packages/llm/src/llm.ts b/packages/llm/src/llm.ts index f470fe2..fb7b1ca 100644 --- a/packages/llm/src/llm.ts +++ b/packages/llm/src/llm.ts @@ -13,7 +13,7 @@ export interface PromptBreakdown { components?: PromptComponent[]; } -export interface IPromptBuilder { +export interface IPromptBuilder { build(...args: TArgs): PromptBreakdown; } @@ -49,7 +49,7 @@ export interface LLMCallRecord { providerInstanceName?: string; maxContext?: number; }; - response?: any; + response?: unknown; } export interface ILLMProvider { diff --git a/packages/llm/src/providers/mock.ts b/packages/llm/src/providers/mock.ts index 116cffb..8c2fde0 100644 --- a/packages/llm/src/providers/mock.ts +++ b/packages/llm/src/providers/mock.ts @@ -30,6 +30,7 @@ export class MockLLMProvider implements ILLMProvider { registerGenerative("mock", () => new MockLLMProvider([])); } + // eslint-disable-next-line @typescript-eslint/no-unused-vars static create(inst: ModelProviderInstance): ILLMProvider { return new MockLLMProvider([]); } diff --git a/packages/llm/tests/openai.test.ts b/packages/llm/tests/openai.test.ts index b09f2a7..0a01413 100644 --- a/packages/llm/tests/openai.test.ts +++ b/packages/llm/tests/openai.test.ts @@ -66,6 +66,7 @@ vi.mock("@langchain/openai", () => { constructor(config: unknown) { this.config = config; } + // eslint-disable-next-line @typescript-eslint/no-unused-vars embedQuery = vi.fn().mockImplementation(async (text: string) => { return [0.1, 0.2, 0.3]; }); diff --git a/packages/memory/src/buffer.ts b/packages/memory/src/buffer.ts index 9bef288..a3c981e 100644 --- a/packages/memory/src/buffer.ts +++ b/packages/memory/src/buffer.ts @@ -1,5 +1,5 @@ import Database from "better-sqlite3"; -import { Entity, resolveAlias } from "@omnia/core"; +import { Entity } from "@omnia/core"; import { Intent } from "@omnia/intent"; import { hydrate } from "@omnia/voice"; diff --git a/packages/memory/src/handoff.ts b/packages/memory/src/handoff.ts index a51ba10..a31309c 100644 --- a/packages/memory/src/handoff.ts +++ b/packages/memory/src/handoff.ts @@ -208,7 +208,7 @@ export interface HandoffRunResult { systemPrompt?: string; userContext?: string; promptComponents?: PromptComponent[]; - response?: any; + response?: unknown; } export class HandoffEngine { @@ -267,7 +267,11 @@ export class HandoffEngine { }; const result = response.data; - const db = (this.bufferRepo as any).db; + const db = ( + this.bufferRepo as unknown as { + db: { transaction: (fn: () => void) => () => void }; + } + ).db; const ledgerEntries: LedgerEntry[] = []; for (const chunk of result.chunks) { diff --git a/packages/voice/src/dehydration.ts b/packages/voice/src/dehydration.ts index 53f3557..d0de255 100644 --- a/packages/voice/src/dehydration.ts +++ b/packages/voice/src/dehydration.ts @@ -10,7 +10,6 @@ export function splitQuotes(text: string): Segment[] { const segments: Segment[] = []; let current = ""; let inQuote = false; - let quoteChar = ""; for (let i = 0; i < text.length; i++) { const char = text[i]; @@ -78,7 +77,10 @@ export function dehydrate( // 2. Replace names and aliases with entity@[name] sortedNames.forEach((name) => { const id = nameToId.get(name)!; - const escapedName = name.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); + const escapedName = name.replace( + new RegExp("[-/\\\\^$*+?.()|[\\]{}]", "g"), + "\\$&", + ); const regex = new RegExp(`\\b${escapedName}\\b`, "gi"); text = text.replace(regex, (matched) => { diff --git a/packages/voice/src/hydration.ts b/packages/voice/src/hydration.ts index 741d158..be01709 100644 --- a/packages/voice/src/hydration.ts +++ b/packages/voice/src/hydration.ts @@ -48,7 +48,7 @@ export function hydrate(content: string, viewer: Entity): string { return seg.text.replace(regex, (matchStr, id, original, followingWord) => { const isSelf = id === viewer.id; const lowerOriginal = original.toLowerCase(); - let resolvedSubject = ""; + let resolvedSubject: string; let isThirdPersonSingular = false; if (isSelf) { @@ -129,7 +129,8 @@ export function hydrate(content: string, viewer: Entity): string { if (followingWord) { if (isThirdPersonSingular) { - const conj = nlp(followingWord).verbs().conjugate()[0] as any; + const conj = nlp(followingWord).verbs().conjugate()[0] as + { Infinitive?: string; PresentTense?: string } | undefined; if (conj && conj.Infinitive === followingWord && conj.PresentTense) { return `${resolvedSubject} ${conj.PresentTense}`; } @@ -194,7 +195,7 @@ export function hydrateObjective( const entity = worldState.getEntity(id); const name = entity?.attributes.get("name")?.getValue() || id; const lowerOriginal = original.toLowerCase(); - let resolvedSubject = ""; + let resolvedSubject: string; let isThirdPersonSingular = false; if (firstPersonSet.has(lowerOriginal)) { @@ -220,7 +221,8 @@ export function hydrateObjective( if (followingWord) { if (isThirdPersonSingular) { - const conj = nlp(followingWord).verbs().conjugate()[0] as any; + const conj = nlp(followingWord).verbs().conjugate()[0] as + { Infinitive?: string; PresentTense?: string } | undefined; if (conj && conj.Infinitive === followingWord && conj.PresentTense) { return `${resolvedSubject} ${conj.PresentTense}`; } diff --git a/tests/integration/actor-monologue.test.ts b/tests/integration/actor-monologue.test.ts index 2dffc44..9f713cc 100644 --- a/tests/integration/actor-monologue.test.ts +++ b/tests/integration/actor-monologue.test.ts @@ -7,7 +7,6 @@ import { AttributeVisibility, } from "@omnia/core"; import { MockLLMProvider } from "@omnia/llm"; -import { IntentSequence } from "@omnia/intent"; import { Architect } from "@omnia/architect"; import { BufferRepository, BufferEntry } from "@omnia/memory"; import { diff --git a/tests/integration/game-loop.test.ts b/tests/integration/game-loop.test.ts index 422dbe9..852cadd 100644 --- a/tests/integration/game-loop.test.ts +++ b/tests/integration/game-loop.test.ts @@ -2,7 +2,7 @@ import { describe, test, expect } from "vitest"; import Database from "better-sqlite3"; import { WorldState, Entity, SQLiteRepository } from "@omnia/core"; import { MockLLMProvider } from "@omnia/llm"; -import { IntentDecoder, IntentSequence } from "@omnia/intent"; +import { IntentDecoder } from "@omnia/intent"; import { Architect } from "@omnia/architect"; describe("Game Loop Integration Tests (Tier 2)", () => {