diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 5862155..47370b2 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -5,9 +5,9 @@ on: branches: - master paths: - - 'web/docs/**' - - 'pnpm-lock.yaml' - - '.github/workflows/deploy-docs.yml' + - "web/docs/**" + - "pnpm-lock.yaml" + - ".github/workflows/deploy-docs.yml" workflow_dispatch: jobs: @@ -28,7 +28,7 @@ jobs: uses: actions/setup-node@v4 with: node-version: 22 - cache: 'pnpm' + cache: "pnpm" - name: Install Dependencies run: pnpm install --frozen-lockfile @@ -41,4 +41,4 @@ jobs: with: apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} - workingDirectory: 'web/docs' + workingDirectory: "web/docs" diff --git a/apps/gui/src/app/actions.ts b/apps/gui/src/app/actions.ts index 4503301..eefc5c1 100644 --- a/apps/gui/src/app/actions.ts +++ b/apps/gui/src/app/actions.ts @@ -4,7 +4,12 @@ import path from "path"; import fs from "fs"; import { simulationManager } from "@/lib/simulation"; import type { SimSnapshot } from "@/lib/simulation"; -import { ProviderManager, ModelProviderInstance, AVAILABLE_PROVIDERS, ModelProviderMeta } from "@omnia/llm"; +import { + ProviderManager, + ModelProviderInstance, + AVAILABLE_PROVIDERS, + ModelProviderMeta, +} from "@omnia/llm"; function resolveScenarioPath(relative: string): string { const cwd = process.cwd(); @@ -25,8 +30,7 @@ function resolveScenarioPath(relative: string): string { } type ActionResult = - | { ok: true; snapshot: SimSnapshot } - | { ok: false; error: string }; + { ok: true; snapshot: SimSnapshot } | { ok: false; error: string }; export async function startSimulation(input: { scenario?: string; @@ -168,8 +172,7 @@ export async function getConfigStatus(): Promise<{ } export async function listSavedSimulations(): Promise< - | { ok: true; sessions: SimSnapshot[] } - | { ok: false; error: string } + { ok: true; sessions: SimSnapshot[] } | { ok: false; error: string } > { try { const sessions = simulationManager.listSavedSessions(); @@ -197,7 +200,9 @@ export async function resumeSimulation(simId: string): Promise { } } -export async function getScenarioEntities(scenarioPath: string): Promise< +export async function getScenarioEntities( + scenarioPath: string, +): Promise< | { ok: true; entities: { id: string; name: string }[] } | { ok: false; error: string } > { @@ -207,10 +212,12 @@ export async function getScenarioEntities(scenarioPath: string): Promise< return { ok: false, error: `Scenario file not found: ${scenarioPath}` }; } const content = JSON.parse(fs.readFileSync(resolved, "utf-8")); - const entities = (content.entities || []).map((e: { id: string; name?: string }) => ({ - id: e.id, - name: e.name || e.id, - })); + const entities = (content.entities || []).map( + (e: { id: string; name?: string }) => ({ + id: e.id, + name: e.name || e.id, + }), + ); return { ok: true, entities }; } catch (err) { return { @@ -220,9 +227,9 @@ export async function getScenarioEntities(scenarioPath: string): Promise< } } -export async function deleteSimulation(simId: string): Promise< - { ok: true } | { ok: false; error: string } -> { +export async function deleteSimulation( + simId: string, +): Promise<{ ok: true } | { ok: false; error: string }> { try { simulationManager.deleteSession(simId); return { ok: true }; @@ -234,7 +241,9 @@ export async function deleteSimulation(simId: string): Promise< } } -export async function listProviderInstances(): Promise { +export async function listProviderInstances(): Promise< + ModelProviderInstance[] +> { return ProviderManager.list(); } @@ -246,7 +255,14 @@ export async function createProviderInstance( type: "generative" | "embedding" = "generative", maxContext?: number, ): Promise { - return ProviderManager.create(name, providerName, apiKey, modelName, type, maxContext); + return ProviderManager.create( + name, + providerName, + apiKey, + modelName, + type, + maxContext, + ); } export async function deleteProviderInstance(id: string): Promise { @@ -266,7 +282,15 @@ export async function updateProviderInstance( type: "generative" | "embedding" = "generative", maxContext?: number, ): Promise { - ProviderManager.update(id, name, providerName, apiKey, modelName, type, maxContext); + ProviderManager.update( + id, + name, + providerName, + apiKey, + modelName, + type, + maxContext, + ); } export async function getProviderMappings(): Promise> { @@ -284,6 +308,8 @@ export async function getAvailableProviders(): Promise { return AVAILABLE_PROVIDERS; } -export async function regenerateEmbeddings(newProviderInstanceId?: string): Promise { +export async function regenerateEmbeddings( + newProviderInstanceId?: string, +): Promise { await simulationManager.regenerateAllEmbeddings(newProviderInstanceId); } diff --git a/apps/gui/src/app/builder/page.tsx b/apps/gui/src/app/builder/page.tsx index b8b973c..0d397b7 100644 --- a/apps/gui/src/app/builder/page.tsx +++ b/apps/gui/src/app/builder/page.tsx @@ -4,7 +4,9 @@ export default function BuilderPage() { return (
-

Scenario Builder

+

+ Scenario Builder +

Scenario builder interface coming soon... diff --git a/apps/gui/src/app/play/page.tsx b/apps/gui/src/app/play/page.tsx index b7d5487..b4b327c 100644 --- a/apps/gui/src/app/play/page.tsx +++ b/apps/gui/src/app/play/page.tsx @@ -5,11 +5,13 @@ import { Suspense } from "react"; export default function PlayPage() { return ( - -

Loading...
-
- }> + +
Loading...
+
+ } + > ); diff --git a/apps/gui/src/components/config/ConfigView.tsx b/apps/gui/src/components/config/ConfigView.tsx index f4ec9ee..fc060ff 100644 --- a/apps/gui/src/components/config/ConfigView.tsx +++ b/apps/gui/src/components/config/ConfigView.tsx @@ -224,7 +224,8 @@ export function ConfigView() { {instances .filter( - (inst) => (inst.type || "generative") === task.type, + (inst) => + (inst.type || "generative") === task.type, ) .map((inst) => ( diff --git a/apps/gui/src/components/config/ProviderInstancesConfig.tsx b/apps/gui/src/components/config/ProviderInstancesConfig.tsx index f57c209..4b9da0e 100644 --- a/apps/gui/src/components/config/ProviderInstancesConfig.tsx +++ b/apps/gui/src/components/config/ProviderInstancesConfig.tsx @@ -282,7 +282,9 @@ export function ProviderInstancesConfig({ {inst.providerName}
{inst.isActive && Active} - {inst.type === "generative" ? "gen" : "embed"} + + {inst.type === "generative" ? "gen" : "embed"} +
diff --git a/apps/gui/src/components/play/PlayView.tsx b/apps/gui/src/components/play/PlayView.tsx index dccd739..a8d8a92 100644 --- a/apps/gui/src/components/play/PlayView.tsx +++ b/apps/gui/src/components/play/PlayView.tsx @@ -422,242 +422,247 @@ export function PlayView() {

- {/* Simulation Global Controls */} -
- {snapshot.status !== "done" && snapshot.status !== "error" && ( - <> - {snapshot.status === "running" && - (loading ? ( - - ) : ( - - ))} - - - )} -
- -
- - Status:{" "} - - {getUnifiedStatus()} - - - - Turn:{" "} - {snapshot.turn} - -
- {statusMessage() && ( -

- {loading && "⏳ "} - {statusMessage()} -

- )} - - - {/* Scrollable Center Viewport */} -
- {activeTab === "interact" ? ( -
- {(() => { - const playerEntity = snapshot.entities.find((e) => e.isPlayer); - return snapshot.log.map((entry, i) => ( - - )); - })()} - {loading && ( -
- - {statusText || "Processing..."} -
- )} -
-
- ) : ( -
- {/* Simulation Info */} -
-

- Simulation Info -

-
-
- - Session ID - - - {snapshot.id} - -
-
- - Max Turns - - - {snapshot.maxTurns} - -
-
- - Turn Count - - - {snapshot.turn} - -
-
- - Entities Registered - - - {snapshot.entities.length} - -
-
-
- - {/* Entities Involved */} -
-

- Entities Involved -

-
- {snapshot.entities.map((ent) => ( -
-
- - {ent.name} - - - ID: {ent.id} - -
-
- {ent.isPlayer ? ( - - PLAYER - - ) : ( - - NPC - - )} -
-
- ))} -
-
-
- )} -
- - {/* Sticky Chat / Interaction Input Footer */} - {activeTab === "interact" && ( -