mirror of
https://github.com/sortedcord/omnia.git
synced 2026-07-22 03:52:48 +05:30
Compare commits
9 Commits
ee25bf4a4c
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 814f216ea7 | |||
| 7f74617077 | |||
| 264a5ea0fe | |||
| a8b2d425a1 | |||
|
|
8f6fe0dc28 | ||
| 01ec062194 | |||
| 8ff1650657 | |||
| 7baf583b13 | |||
|
|
82fb3c34f7 |
21
.dockerignore
Normal file
21
.dockerignore
Normal file
@@ -0,0 +1,21 @@
|
||||
node_modules/
|
||||
.git/
|
||||
.gitignore
|
||||
.gitattributes
|
||||
*.md
|
||||
.editorconfig
|
||||
.prettierrc
|
||||
.prettierignore
|
||||
eslint.config.mjs
|
||||
.env
|
||||
.env*
|
||||
tests/
|
||||
content/
|
||||
docs/
|
||||
web/landing/
|
||||
web/docs/
|
||||
vitest.config.ts
|
||||
*.tsbuildinfo
|
||||
.next/
|
||||
dist/
|
||||
.astro/
|
||||
65
.github/workflows/build-image.yml
vendored
Normal file
65
.github/workflows/build-image.yml
vendored
Normal file
@@ -0,0 +1,65 @@
|
||||
name: Build Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
tags: ["v*"]
|
||||
paths-ignore:
|
||||
- "web/docs/**"
|
||||
- "web/landing/**"
|
||||
- "content/**"
|
||||
- "README.md"
|
||||
- "CONTRIBUTING.md"
|
||||
- ".github/workflows/deploy-docs.yml"
|
||||
pull_request:
|
||||
branches: [master]
|
||||
paths-ignore:
|
||||
- "web/docs/**"
|
||||
- "web/landing/**"
|
||||
- "content/**"
|
||||
- "*.md"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
|
||||
- name: Log in to GitHub Container Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ghcr.io/${{ github.repository }}/omnia-gui
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=pr
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
type=sha,format=short
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
file: apps/gui/Dockerfile
|
||||
push: ${{ github.event_name != 'pull_request' }}
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
provenance: false
|
||||
59
apps/gui/Dockerfile
Normal file
59
apps/gui/Dockerfile
Normal file
@@ -0,0 +1,59 @@
|
||||
FROM node:22-slim AS base
|
||||
ENV PNPM_HOME="/pnpm" \
|
||||
PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable && corepack prepare pnpm@11.15.1 --activate
|
||||
WORKDIR /app
|
||||
|
||||
FROM base AS build-deps
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install -qq -y --no-install-recommends \
|
||||
python3 make g++ && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
COPY package.json tsconfig.json tsconfig.base.json ./
|
||||
COPY apps/gui/package.json apps/gui/package.json
|
||||
COPY apps/gui/tsconfig.json apps/gui/tsconfig.json
|
||||
COPY apps/gui/next.config.ts apps/gui/next.config.ts
|
||||
COPY apps/gui/postcss.config.mjs apps/gui/postcss.config.mjs
|
||||
COPY apps/gui/components.json apps/gui/components.json
|
||||
COPY packages/actor/package.json packages/actor/package.json
|
||||
COPY packages/architect/package.json packages/architect/package.json
|
||||
COPY packages/core/package.json packages/core/package.json
|
||||
COPY packages/intent/package.json packages/intent/package.json
|
||||
COPY packages/llm/package.json packages/llm/package.json
|
||||
COPY packages/memory/package.json packages/memory/package.json
|
||||
COPY packages/scenario/package.json packages/scenario/package.json
|
||||
COPY packages/spatial/package.json packages/spatial/package.json
|
||||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
||||
pnpm install --frozen-lockfile
|
||||
|
||||
FROM build-deps AS pkg-builder
|
||||
COPY packages/ ./packages/
|
||||
RUN pnpm build
|
||||
|
||||
FROM pkg-builder AS gui-builder
|
||||
COPY apps/gui/src ./apps/gui/src
|
||||
COPY apps/gui/public ./apps/gui/public
|
||||
RUN pnpm --filter @omnia/gui build
|
||||
|
||||
FROM base AS runner
|
||||
ENV NODE_ENV=production
|
||||
RUN apt-get update -qq && \
|
||||
apt-get install -qq -y --no-install-recommends \
|
||||
python3 make g++ && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=gui-builder /app/package.json /app/pnpm-workspace.yaml ./
|
||||
COPY --from=gui-builder /app/node_modules ./node_modules
|
||||
COPY --from=gui-builder /app/packages ./packages
|
||||
COPY --from=gui-builder /app/apps/gui/package.json \
|
||||
/app/apps/gui/next.config.ts \
|
||||
/app/apps/gui/postcss.config.mjs \
|
||||
./apps/gui/
|
||||
COPY --from=gui-builder /app/apps/gui/.next ./apps/gui/.next
|
||||
COPY --from=gui-builder /app/apps/gui/public ./apps/gui/public
|
||||
|
||||
WORKDIR /app/apps/gui
|
||||
EXPOSE 3000
|
||||
CMD ["pnpm", "start"]
|
||||
2
apps/gui/next-env.d.ts
vendored
2
apps/gui/next-env.d.ts
vendored
@@ -1,6 +1,6 @@
|
||||
/// <reference types="next" />
|
||||
/// <reference types="next/image-types/global" />
|
||||
import "./.next/dev/types/routes.d.ts";
|
||||
import "./.next/types/routes.d.ts";
|
||||
|
||||
// NOTE: This file should not be edited
|
||||
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
|
||||
|
||||
BIN
apps/gui/public/calendar_logo.png
Normal file
BIN
apps/gui/public/calendar_logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 607 B |
BIN
apps/gui/public/clock_day_icon.png
Normal file
BIN
apps/gui/public/clock_day_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
BIN
apps/gui/public/clock_night_icon.png
Normal file
BIN
apps/gui/public/clock_night_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.4 KiB |
BIN
apps/gui/public/map_pointer_icon.png
Normal file
BIN
apps/gui/public/map_pointer_icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 463 B |
@@ -271,6 +271,12 @@ export async function createProviderInstance(
|
||||
);
|
||||
}
|
||||
|
||||
export async function duplicateProviderInstance(
|
||||
id: string,
|
||||
): Promise<ModelProviderInstance | null> {
|
||||
return ProviderManager.duplicate(id);
|
||||
}
|
||||
|
||||
export async function deleteProviderInstance(id: string): Promise<void> {
|
||||
ProviderManager.delete(id);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import {
|
||||
setActiveProviderInstance,
|
||||
regenerateEmbeddings,
|
||||
deleteProviderInstance,
|
||||
duplicateProviderInstance,
|
||||
fetchAvailableModels,
|
||||
fetchAvailableModelsForInstance,
|
||||
} from "@/app/actions";
|
||||
@@ -43,13 +44,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 +195,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) => {
|
||||
@@ -346,6 +339,23 @@ export function ProviderInstancesConfig({
|
||||
}
|
||||
};
|
||||
|
||||
const handleDuplicate = async () => {
|
||||
if (selectedInstanceId === "new" || selectedInstanceId === null) return;
|
||||
try {
|
||||
setLoading(true);
|
||||
setError("");
|
||||
const duplicated = await duplicateProviderInstance(selectedInstanceId);
|
||||
if (duplicated) {
|
||||
setSelectedInstanceId(duplicated.id);
|
||||
await onChanged();
|
||||
}
|
||||
} catch (err) {
|
||||
setError(err instanceof Error ? err.message : String(err));
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<section className="mb-8 flex min-h-[600px] flex-col">
|
||||
{error && (
|
||||
@@ -654,16 +664,26 @@ export function ProviderInstancesConfig({
|
||||
</div>
|
||||
|
||||
<div className="flex flex-row items-center justify-between gap-2">
|
||||
<div>
|
||||
<div className="flex flex-row gap-2">
|
||||
{selectedInstanceId !== "new" && (
|
||||
<Button
|
||||
type="button"
|
||||
variant="destructive"
|
||||
onClick={handleDelete}
|
||||
disabled={loading}
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
<>
|
||||
<Button
|
||||
type="button"
|
||||
variant="destructive"
|
||||
onClick={handleDelete}
|
||||
disabled={loading}
|
||||
>
|
||||
Delete
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
onClick={handleDuplicate}
|
||||
disabled={loading}
|
||||
>
|
||||
Duplicate
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<Button type="submit" disabled={loading}>
|
||||
|
||||
@@ -25,15 +25,8 @@ import {
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
} from "@/components/ui/dialog";
|
||||
import {
|
||||
Select,
|
||||
SelectContent,
|
||||
SelectGroup,
|
||||
SelectItem,
|
||||
SelectTrigger,
|
||||
SelectValue,
|
||||
} from "@/components/ui/select";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Bot, UserRound } from "lucide-react";
|
||||
|
||||
export function HomeView() {
|
||||
const router = useRouter();
|
||||
@@ -192,7 +185,7 @@ export function HomeView() {
|
||||
|
||||
return (
|
||||
<div className="flex-1 overflow-y-auto w-full relative">
|
||||
<div className="relative z-10 mx-auto max-w-[1024px] px-10 py-12">
|
||||
<div className="relative z-10 mx-auto max-w-5xl px-10 py-12">
|
||||
<div className="animate-fade-in">
|
||||
{/* Centered Big Logo */}
|
||||
<div className="flex flex-col items-center justify-center mb-10 pt-4">
|
||||
@@ -237,7 +230,7 @@ export function HomeView() {
|
||||
{Array.from({ length: 3 }).map((_, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="flex-shrink-0 w-72 border border-border/30 bg-card p-5 shadow-sm transition-all flex flex-col justify-between h-[148px]"
|
||||
className="shrink-0 w-72 border border-border/30 bg-card p-5 shadow-sm transition-all flex flex-col justify-between h-37"
|
||||
>
|
||||
<div className="space-y-3">
|
||||
<Skeleton className="h-5 w-2/3" />
|
||||
@@ -264,7 +257,7 @@ export function HomeView() {
|
||||
? undefined
|
||||
: () => handleResume(s.id)
|
||||
}
|
||||
className={`flex-shrink-0 w-72 border border-border/30 bg-card p-5 shadow-sm transition-all relative group ${
|
||||
className={`shrink-0 w-72 border border-border/30 bg-card p-5 shadow-sm transition-all relative group ${
|
||||
providerInstances.length === 0
|
||||
? "opacity-50 cursor-not-allowed filter grayscale"
|
||||
: "cursor-pointer hover:-translate-y-0.5 hover:shadow-md active:translate-y-0 active:shadow-sm"
|
||||
@@ -310,8 +303,8 @@ export function HomeView() {
|
||||
</h2>
|
||||
{loadingData ? (
|
||||
<div className="flex overflow-x-auto gap-6 pb-4 scrollbar-thin scrollbar-thumb-border/20">
|
||||
<Link href="/builder" className="no-underline flex-shrink-0">
|
||||
<div className="w-64 border border-border/30 bg-card p-5 cursor-pointer shadow-sm hover:-translate-y-0.5 hover:shadow-md active:translate-y-0 active:shadow-sm transition-all flex flex-col justify-between h-full min-h-[148px]">
|
||||
<Link href="/builder" className="no-underline shrink-0">
|
||||
<div className="w-64 border border-border/30 bg-card p-5 cursor-pointer shadow-sm hover:-translate-y-0.5 hover:shadow-md active:translate-y-0 active:shadow-sm transition-all flex flex-col justify-between h-full min-h-37">
|
||||
<div>
|
||||
<strong className="text-body-md text-foreground block mb-1">
|
||||
Build a scenario
|
||||
@@ -331,7 +324,7 @@ export function HomeView() {
|
||||
{Array.from({ length: 3 }).map((_, index) => (
|
||||
<div
|
||||
key={index}
|
||||
className="flex-shrink-0 w-64 border border-border/30 bg-card p-5 shadow-sm flex flex-col justify-between h-[148px]"
|
||||
className="shrink-0 w-64 border border-border/30 bg-card p-5 shadow-sm flex flex-col justify-between h-37"
|
||||
>
|
||||
<div className="space-y-3">
|
||||
<Skeleton className="h-5 w-3/4" />
|
||||
@@ -345,8 +338,8 @@ export function HomeView() {
|
||||
</div>
|
||||
) : (
|
||||
<div className="flex overflow-x-auto gap-6 pb-4 scrollbar-thin scrollbar-thumb-border/20">
|
||||
<Link href="/builder" className="no-underline flex-shrink-0">
|
||||
<div className="w-64 border border-primary bg-primary p-5 cursor-pointer shadow-sm hover:-translate-y-0.5 hover:shadow-md active:translate-y-0 active:shadow-sm transition-all flex flex-col justify-between h-full min-h-[148px]">
|
||||
<Link href="/builder" className="no-underline shrink-0">
|
||||
<div className="w-64 border border-primary bg-primary p-5 cursor-pointer shadow-sm hover:-translate-y-0.5 hover:shadow-md active:translate-y-0 active:shadow-sm transition-all flex flex-col justify-between h-full min-h-37">
|
||||
<div>
|
||||
<strong className="text-body-md text-surface block mb-1">
|
||||
Build a scenario
|
||||
@@ -382,7 +375,7 @@ export function HomeView() {
|
||||
open={!!scenarioForModal}
|
||||
onOpenChange={(open) => !open && setScenarioForModal(null)}
|
||||
>
|
||||
<DialogContent className="max-w-[400px]">
|
||||
<DialogContent className="max-w-100">
|
||||
<DialogHeader className="border-b border-dotted border-border/20 pb-4 mb-2">
|
||||
<DialogTitle>Start Scenario</DialogTitle>
|
||||
<DialogDescription>
|
||||
@@ -412,28 +405,37 @@ export function HomeView() {
|
||||
<label className="text-xs font-semibold uppercase tracking-wider text-muted-foreground font-mono">
|
||||
Simulation Mode / Play as
|
||||
</label>
|
||||
<Select
|
||||
value={selectedEntityForModal}
|
||||
onValueChange={(val) =>
|
||||
setSelectedEntityForModal(val || "")
|
||||
}
|
||||
>
|
||||
<SelectTrigger className="w-full">
|
||||
<SelectValue placeholder="-- Run Fully Autonomously --" />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectGroup>
|
||||
<SelectItem value="">
|
||||
-- Run Fully Autonomously --
|
||||
</SelectItem>
|
||||
{modalEntities.map((ent) => (
|
||||
<SelectItem key={ent.id} value={ent.id}>
|
||||
Play as {ent.name}
|
||||
</SelectItem>
|
||||
))}
|
||||
</SelectGroup>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant={
|
||||
selectedEntityForModal === ""
|
||||
? "default"
|
||||
: "outline"
|
||||
}
|
||||
onClick={() => setSelectedEntityForModal("")}
|
||||
className="flex-1 min-w-40"
|
||||
>
|
||||
<Bot />
|
||||
Run Fully Autonomously
|
||||
</Button>
|
||||
{modalEntities.map((ent) => (
|
||||
<Button
|
||||
key={ent.id}
|
||||
type="button"
|
||||
variant={
|
||||
selectedEntityForModal === ent.id
|
||||
? "default"
|
||||
: "outline"
|
||||
}
|
||||
onClick={() => setSelectedEntityForModal(ent.id)}
|
||||
className="flex-1 min-w-40"
|
||||
>
|
||||
<UserRound />
|
||||
Play as {ent.name}
|
||||
</Button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -33,7 +33,7 @@ export function HandoffModal({ entry, onClose }: HandoffModalProps) {
|
||||
|
||||
return (
|
||||
<Dialog open onOpenChange={(open) => !open && onClose()}>
|
||||
<DialogContent className="max-w-[800px] sm:max-w-[800px] h-[85vh] overflow-hidden flex flex-col p-0 gap-0 border-2">
|
||||
<DialogContent className="max-w-200 sm:max-w-200 h-[85vh] overflow-hidden flex flex-col p-0 gap-0 border-2">
|
||||
<DialogHeader className="px-6 pt-5 pb-4 border-b">
|
||||
<DialogTitle className="text-lg font-head tracking-wide text-primary flex items-center justify-between">
|
||||
<span>Memory Handoff Details — {entry.entityName}</span>
|
||||
@@ -126,66 +126,79 @@ export function HandoffModal({ entry, onClose }: HandoffModalProps) {
|
||||
<h3 className="text-xs font-semibold uppercase tracking-wider text-muted-foreground font-mono">
|
||||
Memory Ledger Additions
|
||||
</h3>
|
||||
{chunks.map((chunk: any, index: number) => (
|
||||
<div
|
||||
key={index}
|
||||
className="border border-border/30 bg-card p-4 shadow-[2px_2px_0_0_var(--border)] relative flex flex-col gap-3"
|
||||
>
|
||||
<div className="flex justify-between items-start gap-4">
|
||||
<div className="flex-1 text-sm text-foreground/90 leading-relaxed font-sans">
|
||||
{chunk.content}
|
||||
</div>
|
||||
<Badge
|
||||
variant="outline"
|
||||
className={`font-mono text-xs ${getImportanceColor(chunk.importance)}`}
|
||||
>
|
||||
Importance: {chunk.importance}
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
{chunk.quotes && chunk.quotes.length > 0 && (
|
||||
<div className="bg-secondary/10 border-l-2 border-primary/50 p-2.5 my-1 text-xs italic text-muted-foreground space-y-1">
|
||||
{chunk.quotes.map((quote: string, qIdx: number) => (
|
||||
<div key={qIdx}>“{quote}”</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
<div className="flex flex-wrap gap-2 text-xs pt-2 border-t border-dotted border-border/10">
|
||||
{chunk.retainInBuffer ? (
|
||||
{chunks.map(
|
||||
(
|
||||
chunk: {
|
||||
content: string;
|
||||
importance: number;
|
||||
quotes?: string[];
|
||||
retainInBuffer?: boolean;
|
||||
involvedEntityIds?: string[];
|
||||
},
|
||||
index: number,
|
||||
) => (
|
||||
<div
|
||||
key={index}
|
||||
className="border border-border/30 bg-card p-4 shadow-sm relative flex flex-col gap-3"
|
||||
>
|
||||
<div className="flex justify-between items-start gap-4">
|
||||
<div className="flex-1 text-sm text-foreground/90 leading-relaxed font-sans">
|
||||
{chunk.content}
|
||||
</div>
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="bg-primary/5 text-primary border-primary/20 text-[10px] font-mono"
|
||||
className={`font-mono text-xs ${getImportanceColor(chunk.importance)}`}
|
||||
>
|
||||
Pinned in Buffer
|
||||
</Badge>
|
||||
) : (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="bg-muted text-muted-foreground border-border/20 text-[10px] font-mono"
|
||||
>
|
||||
Pruned from Buffer
|
||||
Importance: {chunk.importance}
|
||||
</Badge>
|
||||
</div>
|
||||
|
||||
{chunk.quotes && chunk.quotes.length > 0 && (
|
||||
<div className="bg-secondary/10 border-l-2 border-primary/50 p-2.5 my-1 text-xs italic text-muted-foreground space-y-1">
|
||||
{chunk.quotes.map((quote: string, qIdx: number) => (
|
||||
<div key={qIdx}>“{quote}”</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{chunk.involvedEntityIds &&
|
||||
chunk.involvedEntityIds.length > 0 && (
|
||||
<div className="flex items-center gap-1.5 ml-auto text-[10px] font-mono text-muted-foreground">
|
||||
<span>Entities:</span>
|
||||
{chunk.involvedEntityIds.map((entId: string) => (
|
||||
<Badge
|
||||
key={entId}
|
||||
variant="outline"
|
||||
className="text-[10px] px-1 py-0 border-border/20 font-mono"
|
||||
>
|
||||
{entId}
|
||||
</Badge>
|
||||
))}
|
||||
</div>
|
||||
<div className="flex flex-wrap gap-2 text-xs pt-2 border-t border-dotted border-border/10">
|
||||
{chunk.retainInBuffer ? (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="bg-primary/5 text-primary border-primary/20 text-[10px] font-mono"
|
||||
>
|
||||
Pinned in Buffer
|
||||
</Badge>
|
||||
) : (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="bg-muted text-muted-foreground border-border/20 text-[10px] font-mono"
|
||||
>
|
||||
Pruned from Buffer
|
||||
</Badge>
|
||||
)}
|
||||
|
||||
{chunk.involvedEntityIds &&
|
||||
chunk.involvedEntityIds.length > 0 && (
|
||||
<div className="flex items-center gap-1.5 ml-auto text-[10px] font-mono text-muted-foreground">
|
||||
<span>Entities:</span>
|
||||
{chunk.involvedEntityIds.map(
|
||||
(entId: string) => (
|
||||
<Badge
|
||||
key={entId}
|
||||
variant="outline"
|
||||
className="text-[10px] px-1 py-0 border-border/20 font-mono"
|
||||
>
|
||||
{entId}
|
||||
</Badge>
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
),
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
@@ -233,7 +246,7 @@ export function HandoffModal({ entry, onClose }: HandoffModalProps) {
|
||||
<h4 className="text-xs font-semibold uppercase tracking-wider text-muted-foreground font-mono">
|
||||
Raw JSON Output
|
||||
</h4>
|
||||
<pre className="p-3 bg-muted rounded text-xs font-mono whitespace-pre-wrap text-foreground border flex-1 overflow-y-auto max-h-[500px]">
|
||||
<pre className="p-3 bg-muted rounded text-xs font-mono whitespace-pre-wrap text-foreground border flex-1 overflow-y-auto max-h-125">
|
||||
{handoffResult
|
||||
? JSON.stringify(handoffResult, null, 2)
|
||||
: "No JSON Output recorded."}
|
||||
|
||||
188
apps/gui/src/components/play/InteractDock.tsx
Normal file
188
apps/gui/src/components/play/InteractDock.tsx
Normal file
@@ -0,0 +1,188 @@
|
||||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import type { SimSnapshot } from "@/lib/simulation-types";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { formatSimDate, formatSimTimeHM, getClockIcon } from "@/lib/utils";
|
||||
|
||||
interface InteractDockProps {
|
||||
snapshot: SimSnapshot;
|
||||
loading: boolean;
|
||||
playerInput: string;
|
||||
setPlayerInput: (value: string) => void;
|
||||
onSubmitAction: (e: React.FormEvent<HTMLFormElement>) => void;
|
||||
onPauseRequested: () => void;
|
||||
onResumeRequested: () => void;
|
||||
onStopRequested: () => void;
|
||||
}
|
||||
|
||||
export function InteractDock({
|
||||
snapshot,
|
||||
loading,
|
||||
playerInput,
|
||||
setPlayerInput,
|
||||
onSubmitAction,
|
||||
onPauseRequested,
|
||||
onResumeRequested,
|
||||
onStopRequested,
|
||||
}: InteractDockProps) {
|
||||
const router = useRouter();
|
||||
|
||||
return (
|
||||
<footer className="sticky bottom-0 px-8 py-4 z-20 shrink-0 bg-background/70 backdrop-blur-md border-t border-border/10">
|
||||
<div className="max-w-200 mx-auto relative">
|
||||
{snapshot.status === "running" ||
|
||||
snapshot.status === "waiting_player" ? (
|
||||
<div className="border border-border/30 bg-card/85 p-4 shadow-sm backdrop-blur-sm relative z-10">
|
||||
{snapshot.status === "waiting_player" && snapshot.waitingEntity && (
|
||||
<details className="mb-3">
|
||||
<summary className="cursor-pointer text-sm font-medium font-head text-primary select-none outline-none">
|
||||
<strong>Your context as {snapshot.waitingEntity.name}</strong>
|
||||
</summary>
|
||||
<pre className="text-xs whitespace-pre-wrap bg-input border border-border/20 p-2 max-h-37.5 overflow-y-auto mt-2 font-mono">
|
||||
{snapshot.waitingEntity.userContext}
|
||||
</pre>
|
||||
</details>
|
||||
)}
|
||||
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex justify-between items-center gap-2">
|
||||
{snapshot.worldTime ? (
|
||||
<span className="text-base font-mono text-muted-foreground font-medium">
|
||||
<img
|
||||
src="/calendar_logo.png"
|
||||
alt="Date"
|
||||
className="w-7 h-7 inline-block align-middle mr-1 opacity-70"
|
||||
/>
|
||||
{formatSimDate(snapshot.worldTime)}
|
||||
<img
|
||||
src={getClockIcon(snapshot.worldTime)}
|
||||
alt="Time"
|
||||
className="w-7 h-7 inline-block align-middle ml-2 mr-1 opacity-70"
|
||||
/>
|
||||
{formatSimTimeHM(snapshot.worldTime)}
|
||||
{snapshot.currentLocation && (
|
||||
<>
|
||||
<img
|
||||
src="/map_pointer_icon.png"
|
||||
alt="Location"
|
||||
className="w-7 h-7 inline-block align-middle ml-2 mr-1 opacity-70"
|
||||
/>
|
||||
{snapshot.currentLocation}
|
||||
</>
|
||||
)}
|
||||
</span>
|
||||
) : (
|
||||
<div />
|
||||
)}
|
||||
<div className="flex gap-2">
|
||||
{loading ? (
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={onPauseRequested}
|
||||
>
|
||||
Pause
|
||||
</Button>
|
||||
) : (
|
||||
snapshot.status === "running" && (
|
||||
<Button
|
||||
type="button"
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={onResumeRequested}
|
||||
>
|
||||
Resume
|
||||
</Button>
|
||||
)
|
||||
)}
|
||||
<Button
|
||||
type="button"
|
||||
variant="destructive"
|
||||
size="sm"
|
||||
onClick={onStopRequested}
|
||||
>
|
||||
Stop
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{snapshot.status === "waiting_player" &&
|
||||
snapshot.waitingEntity && (
|
||||
<form
|
||||
onSubmit={onSubmitAction}
|
||||
className="flex flex-row gap-2 items-stretch"
|
||||
>
|
||||
<Textarea
|
||||
value={playerInput}
|
||||
onChange={(e) => setPlayerInput(e.target.value)}
|
||||
placeholder="Describe what your character does, says, or thinks..."
|
||||
rows={3}
|
||||
className="flex-1 min-h-26"
|
||||
disabled={loading}
|
||||
/>
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={loading || !playerInput.trim()}
|
||||
className="w-32 shrink-0 self-stretch"
|
||||
>
|
||||
{loading ? "Processing..." : "Submit"}
|
||||
</Button>
|
||||
</form>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
) : snapshot.status === "done" || snapshot.status === "error" ? (
|
||||
<div className="flex justify-between items-center bg-card/85 border border-border/30 p-4 shadow-sm backdrop-blur-sm">
|
||||
<div className="flex flex-col gap-1">
|
||||
<span className="text-sm font-mono text-muted-foreground">
|
||||
{snapshot.status === "error"
|
||||
? "Simulation finished with an error."
|
||||
: "Simulation complete."}
|
||||
</span>
|
||||
{snapshot.worldTime && (
|
||||
<div className="flex items-center gap-2 text-base font-mono text-muted-foreground">
|
||||
<img
|
||||
src="/calendar_logo.png"
|
||||
alt="Date"
|
||||
className="w-7 h-7 opacity-70"
|
||||
/>
|
||||
<span>{formatSimDate(snapshot.worldTime)}</span>
|
||||
<img
|
||||
src={getClockIcon(snapshot.worldTime)}
|
||||
alt="Time"
|
||||
className="w-7 h-7 opacity-70"
|
||||
/>
|
||||
<span>{formatSimTimeHM(snapshot.worldTime)}</span>
|
||||
{snapshot.currentLocation && (
|
||||
<>
|
||||
<img
|
||||
src="/map_pointer_icon.png"
|
||||
alt="Location"
|
||||
className="w-7 h-7 opacity-70"
|
||||
/>
|
||||
<span>{snapshot.currentLocation}</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<Button
|
||||
onClick={() => {
|
||||
router.push("/");
|
||||
}}
|
||||
size="sm"
|
||||
>
|
||||
{snapshot.status === "error"
|
||||
? "Back to Dashboard"
|
||||
: "New Simulation"}
|
||||
</Button>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
</footer>
|
||||
);
|
||||
}
|
||||
@@ -1,52 +1,61 @@
|
||||
"use client";
|
||||
|
||||
import * as React from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import type { SimSnapshot } from "@/lib/simulation-types";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Spinner } from "@/components/ui/spinner";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { hydrate } from "@omnia/voice";
|
||||
import { Brain, PersonStanding, Speech } from "lucide-react";
|
||||
import {
|
||||
Alert,
|
||||
AlertAction,
|
||||
AlertDescription,
|
||||
AlertTitle,
|
||||
} from "@/components/ui/alert";
|
||||
import { InteractDock } from "./InteractDock";
|
||||
|
||||
function IntentTag({
|
||||
intent,
|
||||
isSelf,
|
||||
playerAliases,
|
||||
playerId,
|
||||
entities,
|
||||
}: {
|
||||
intent: SimSnapshot["log"][number]["intents"][number];
|
||||
isSelf?: boolean;
|
||||
playerAliases: Record<string, string>;
|
||||
playerId: string;
|
||||
entities: SimSnapshot["entities"];
|
||||
}) {
|
||||
const labels: Record<string, string> = {
|
||||
monologue: "thought",
|
||||
thought: "thought",
|
||||
dialogue: "dialogue",
|
||||
action: "action",
|
||||
const icons: Record<string, React.ReactNode> = {
|
||||
monologue: <Brain className="size-4" />,
|
||||
thought: <Brain className="size-4" />,
|
||||
dialogue: <Speech className="size-4" />,
|
||||
action: <PersonStanding className="size-4" />,
|
||||
};
|
||||
|
||||
const label = labels[intent.type] || intent.type;
|
||||
const icon = icons[intent.type] || null;
|
||||
|
||||
let outcome = "";
|
||||
if (intent.type === "action") {
|
||||
outcome = intent.isValid ? " ✅" : ` ❌ (${intent.reason})`;
|
||||
const viewerAliasesMap = new Map<string, string>();
|
||||
if (entities) {
|
||||
for (const ent of entities) {
|
||||
viewerAliasesMap.set(ent.id, ent.name || ent.id);
|
||||
}
|
||||
}
|
||||
if (playerAliases) {
|
||||
for (const [targetId, alias] of Object.entries(playerAliases)) {
|
||||
viewerAliasesMap.set(targetId, alias);
|
||||
}
|
||||
}
|
||||
|
||||
const viewerAliasesMap = new Map(Object.entries(playerAliases || {}));
|
||||
const viewerEntityMock = {
|
||||
id: playerId || "",
|
||||
aliases: viewerAliasesMap,
|
||||
};
|
||||
|
||||
const textToDisplay = hydrate(intent.content, viewerEntityMock as any);
|
||||
const textToDisplay = hydrate(
|
||||
intent.content,
|
||||
viewerEntityMock as unknown as Parameters<typeof hydrate>[1],
|
||||
);
|
||||
|
||||
const modifiersStr =
|
||||
intent.modifiers && intent.modifiers.length > 0 ? (
|
||||
@@ -55,12 +64,28 @@ function IntentTag({
|
||||
</span>
|
||||
) : null;
|
||||
|
||||
const invalidActionReason =
|
||||
intent.type === "action" && !intent.isValid && intent.reason
|
||||
? ` (${intent.reason})`
|
||||
: "";
|
||||
|
||||
const invalidActionClassName =
|
||||
intent.type === "action" && !intent.isValid ? " text-destructive" : "";
|
||||
|
||||
return (
|
||||
<span className="text-sm text-muted-foreground">
|
||||
[{label}] “{textToDisplay}”{modifiersStr}
|
||||
{outcome}
|
||||
{intent.minutesToAdvance ? ` [+${intent.minutesToAdvance}min]` : ""}
|
||||
</span>
|
||||
<>
|
||||
<span className="text-sm text-muted-foreground inline-flex items-start gap-1">
|
||||
<span className="mt-0.5 inline-flex shrink-0 items-center justify-center">
|
||||
{icon}
|
||||
</span>
|
||||
<span className={invalidActionClassName}>
|
||||
“{textToDisplay}”{modifiersStr}
|
||||
{invalidActionReason}
|
||||
{intent.minutesToAdvance ? ` [+${intent.minutesToAdvance}min]` : ""}
|
||||
</span>
|
||||
</span>
|
||||
<br />
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -86,55 +111,59 @@ function LogEntryCard({
|
||||
isPlayerCard,
|
||||
playerAliases,
|
||||
playerId,
|
||||
entities,
|
||||
}: {
|
||||
entry: SimSnapshot["log"][number];
|
||||
onShowPrompt: (entry: SimSnapshot["log"][number]) => void;
|
||||
isPlayerCard: boolean;
|
||||
playerAliases: Record<string, string>;
|
||||
playerId: string;
|
||||
entities: SimSnapshot["entities"];
|
||||
}) {
|
||||
const showMenu = !!(entry.rawPrompt || entry.decoderPrompt);
|
||||
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"border p-4 shadow-[2px_2px_0_0_var(--border)]",
|
||||
isPlayerCard
|
||||
? "border-primary bg-surface-container-low"
|
||||
: "border-border/30 bg-card",
|
||||
)}
|
||||
>
|
||||
<div className="flex justify-between items-center mb-2 border-b border-dotted border-border/20 pb-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<strong className="text-body-md font-bold text-foreground">
|
||||
{entry.entityName}
|
||||
</strong>
|
||||
<span className="text-xs text-muted-foreground font-mono">
|
||||
Turn {entry.turn} · {formatSimTime(entry.timestamp)}
|
||||
</span>
|
||||
</div>
|
||||
{showMenu && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={() => onShowPrompt(entry)}
|
||||
title="View Raw Prompts & Token Usage"
|
||||
>
|
||||
☰
|
||||
</Button>
|
||||
<div className={cn("mb-2")}>
|
||||
<div
|
||||
className={cn(
|
||||
"border p-4 shadow-sm",
|
||||
isPlayerCard
|
||||
? "border-primary bg-surface-container-low"
|
||||
: "border-border/30 bg-card",
|
||||
)}
|
||||
>
|
||||
<div className="flex justify-between items-center mb-2 border-b border-dotted border-border/20 pb-2">
|
||||
<div className="flex items-center gap-2">
|
||||
<strong className="text-body-md font-bold text-foreground">
|
||||
{entry.entityName}
|
||||
</strong>
|
||||
<span className="text-xs text-muted-foreground font-mono">
|
||||
Turn {entry.turn} · {formatSimTime(entry.timestamp)}
|
||||
</span>
|
||||
</div>
|
||||
{showMenu && (
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
onClick={() => onShowPrompt(entry)}
|
||||
title="View Raw Prompts & Token Usage"
|
||||
>
|
||||
☰
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
<div className="text-body-md leading-relaxed mb-3 text-foreground/90 whitespace-pre-wrap">
|
||||
{entry.narrativeProse}
|
||||
</div>
|
||||
</div>
|
||||
<div className="text-body-md leading-relaxed mb-3 text-foreground/90 whitespace-pre-wrap">
|
||||
{entry.narrativeProse}
|
||||
</div>
|
||||
<div className="flex flex-col gap-1.5 mt-2 border-t border-dotted border-border/10 pt-2">
|
||||
<div className={cn("mt-3 ms-3")}>
|
||||
{entry.intents.map((intent, i) => (
|
||||
<IntentTag
|
||||
key={i}
|
||||
intent={intent}
|
||||
isSelf={isPlayerCard}
|
||||
playerAliases={playerAliases}
|
||||
playerId={playerId}
|
||||
entities={entities}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
@@ -152,6 +181,9 @@ interface InteractViewProps {
|
||||
onShowPrompt: (entry: SimSnapshot["log"][number]) => void;
|
||||
onShowHandoff: (entry: SimSnapshot["log"][number]) => void;
|
||||
logEndRef: React.RefObject<HTMLDivElement | null>;
|
||||
onPauseRequested: () => void;
|
||||
onResumeRequested: () => void;
|
||||
onStopRequested: () => void;
|
||||
}
|
||||
|
||||
export function InteractView({
|
||||
@@ -164,16 +196,17 @@ export function InteractView({
|
||||
onShowPrompt,
|
||||
onShowHandoff,
|
||||
logEndRef,
|
||||
onPauseRequested,
|
||||
onResumeRequested,
|
||||
onStopRequested,
|
||||
}: InteractViewProps) {
|
||||
const router = useRouter();
|
||||
|
||||
const playerEntity = snapshot.entities.find((e) => e.isPlayer);
|
||||
|
||||
return (
|
||||
<>
|
||||
{/* Scrollable Center Viewport */}
|
||||
<main className="flex-1 overflow-y-auto px-8 py-6">
|
||||
<div className="flex flex-col gap-4 max-w-[800px] mx-auto pb-12">
|
||||
<div className="flex flex-col gap-4 max-w-200 mx-auto pb-44 md:pb-52">
|
||||
{snapshot.log.map((entry, i) => {
|
||||
if (entry.isHandoff) {
|
||||
return (
|
||||
@@ -213,6 +246,7 @@ export function InteractView({
|
||||
isPlayerCard={entry.entityId === playerEntity?.id}
|
||||
playerAliases={playerAliases}
|
||||
playerId={playerId}
|
||||
entities={snapshot.entities}
|
||||
/>
|
||||
);
|
||||
})}
|
||||
@@ -226,54 +260,16 @@ export function InteractView({
|
||||
</div>
|
||||
</main>
|
||||
|
||||
{/* Sticky Chat / Interaction Input Footer */}
|
||||
<footer className="sticky bottom-0 bg-background/95 backdrop-blur-xs border-t border-dotted border-border/20 px-8 py-4 z-10 shrink-0">
|
||||
<div className="max-w-[800px] mx-auto">
|
||||
{snapshot.status === "waiting_player" && snapshot.waitingEntity ? (
|
||||
<div className="border border-border/30 bg-card p-4 shadow-[2px_2px_0_0_var(--border)]">
|
||||
<details className="mb-3">
|
||||
<summary className="cursor-pointer text-sm font-medium font-head text-primary select-none outline-none">
|
||||
<strong>Your context as {snapshot.waitingEntity.name}</strong>
|
||||
</summary>
|
||||
<pre className="text-xs whitespace-pre-wrap bg-input border border-border/20 p-2 max-h-[150px] overflow-y-auto mt-2 font-mono">
|
||||
{snapshot.waitingEntity.userContext}
|
||||
</pre>
|
||||
</details>
|
||||
|
||||
<form onSubmit={onSubmitAction} className="flex flex-col gap-2">
|
||||
<Textarea
|
||||
value={playerInput}
|
||||
onChange={(e) => setPlayerInput(e.target.value)}
|
||||
placeholder="Describe what your character does, says, or thinks..."
|
||||
rows={3}
|
||||
disabled={loading}
|
||||
/>
|
||||
<Button type="submit" disabled={loading || !playerInput.trim()}>
|
||||
{loading ? "Processing..." : "Submit Action"}
|
||||
</Button>
|
||||
</form>
|
||||
</div>
|
||||
) : snapshot.status === "done" || snapshot.status === "error" ? (
|
||||
<div className="flex justify-between items-center bg-card border border-border/30 p-4 shadow-[2px_2px_0_0_var(--border)]">
|
||||
<span className="text-sm font-mono text-muted-foreground">
|
||||
{snapshot.status === "error"
|
||||
? "Simulation finished with an error."
|
||||
: "Simulation complete."}
|
||||
</span>
|
||||
<Button
|
||||
onClick={() => {
|
||||
router.push("/");
|
||||
}}
|
||||
size="sm"
|
||||
>
|
||||
{snapshot.status === "error"
|
||||
? "Back to Dashboard"
|
||||
: "New Simulation"}
|
||||
</Button>
|
||||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
</footer>
|
||||
<InteractDock
|
||||
snapshot={snapshot}
|
||||
loading={loading}
|
||||
playerInput={playerInput}
|
||||
setPlayerInput={setPlayerInput}
|
||||
onSubmitAction={onSubmitAction}
|
||||
onPauseRequested={onPauseRequested}
|
||||
onResumeRequested={onResumeRequested}
|
||||
onStopRequested={onStopRequested}
|
||||
/>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -319,43 +319,6 @@ export function PlayView() {
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/* Simulation Global Controls */}
|
||||
<div className="flex gap-2 shrink-0">
|
||||
{snapshot.status !== "done" && snapshot.status !== "error" && (
|
||||
<>
|
||||
{snapshot.status === "running" &&
|
||||
(loading ? (
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
pauseRequestedRef.current = true;
|
||||
}}
|
||||
>
|
||||
Pause
|
||||
</Button>
|
||||
) : (
|
||||
<Button
|
||||
variant="secondary"
|
||||
size="sm"
|
||||
onClick={() => runSteps(snapshot.id)}
|
||||
>
|
||||
Resume
|
||||
</Button>
|
||||
))}
|
||||
<Button
|
||||
variant="destructive"
|
||||
size="sm"
|
||||
onClick={() => {
|
||||
pauseRequestedRef.current = true;
|
||||
router.push("/");
|
||||
}}
|
||||
>
|
||||
Stop
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center justify-between text-xs font-mono mt-1 pt-1.5 border-t border-border/10">
|
||||
<span className="text-muted-foreground">
|
||||
@@ -390,6 +353,14 @@ export function PlayView() {
|
||||
onShowPrompt={setSelectedEntryForModal}
|
||||
onShowHandoff={setSelectedHandoffForModal}
|
||||
logEndRef={logEndRef}
|
||||
onPauseRequested={() => {
|
||||
pauseRequestedRef.current = true;
|
||||
}}
|
||||
onResumeRequested={() => runSteps(snapshot.id)}
|
||||
onStopRequested={() => {
|
||||
pauseRequestedRef.current = true;
|
||||
router.push("/");
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<ManageView snapshot={snapshot} onRename={setSnapshot} />
|
||||
|
||||
@@ -52,21 +52,26 @@ export function PromptAnalyzer({
|
||||
maxContext > 0 ? (inputTokens / maxContext) * 100 : 0;
|
||||
const isAbsolute = maxContext > 0 && usagePctOfContext >= 20;
|
||||
|
||||
const getColorClass = (type: string) => {
|
||||
switch (type) {
|
||||
case "system":
|
||||
return "bg-blue-500";
|
||||
case "world":
|
||||
return "bg-emerald-500";
|
||||
case "events":
|
||||
return "bg-purple-500";
|
||||
case "memories":
|
||||
return "bg-pink-500";
|
||||
case "input":
|
||||
return "bg-amber-500";
|
||||
default:
|
||||
return "bg-slate-500";
|
||||
}
|
||||
const legentColors = [
|
||||
"bg-blue-500",
|
||||
"bg-emerald-500",
|
||||
"bg-purple-500",
|
||||
"bg-orange-500",
|
||||
"bg-pink-500",
|
||||
"bg-amber-500",
|
||||
"bg-teal-500",
|
||||
"bg-cyan-500",
|
||||
"bg-indigo-500",
|
||||
"bg-violet-500",
|
||||
"bg-rose-500",
|
||||
"bg-sky-500",
|
||||
"bg-lime-500",
|
||||
"bg-fuchsia-500",
|
||||
"bg-red-500",
|
||||
];
|
||||
|
||||
const getColorClass = (index: number) => {
|
||||
return legentColors[index % legentColors.length];
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -106,7 +111,7 @@ export function PromptAnalyzer({
|
||||
return (
|
||||
<div
|
||||
key={idx}
|
||||
className={`h-full transition-all duration-300 ${getColorClass(item.type)}`}
|
||||
className={`h-full transition-all duration-300 ${getColorClass(idx)}`}
|
||||
style={{ width: `${widthPct}%` }}
|
||||
title={`${item.label}: ${item.tokens} tokens (${item.pct.toFixed(1)}%)`}
|
||||
/>
|
||||
@@ -129,7 +134,7 @@ export function PromptAnalyzer({
|
||||
<AccordionTrigger className="text-sm py-2.5 hover:no-underline">
|
||||
<div className="flex items-center gap-2">
|
||||
<span
|
||||
className={`inline-block w-2.5 h-2.5 rounded-sm ${getColorClass(item.type)}`}
|
||||
className={`inline-block w-2.5 h-2.5 rounded-sm ${getColorClass(idx)}`}
|
||||
/>
|
||||
<span>{item.label}:</span>
|
||||
<span className="text-muted-foreground font-normal">
|
||||
@@ -139,7 +144,7 @@ export function PromptAnalyzer({
|
||||
</div>
|
||||
</AccordionTrigger>
|
||||
<AccordionContent>
|
||||
<pre className="m-0 p-3 bg-muted rounded text-xs font-mono whitespace-pre-wrap text-foreground border max-h-[300px] overflow-y-auto">
|
||||
<pre className="m-0 p-3 bg-muted rounded text-xs font-mono whitespace-pre-wrap text-foreground border max-h-75 overflow-y-auto">
|
||||
{item.content}
|
||||
</pre>
|
||||
</AccordionContent>
|
||||
@@ -161,7 +166,7 @@ export function PromptAnalyzer({
|
||||
)}
|
||||
</div>
|
||||
<div className="rounded border-2">
|
||||
<pre className="m-0 p-3 bg-muted text-xs font-mono whitespace-pre-wrap text-foreground max-h-[250px] overflow-y-auto">
|
||||
<pre className="m-0 p-3 bg-muted text-xs font-mono whitespace-pre-wrap text-foreground max-h-62.5 overflow-y-auto">
|
||||
{outputText}
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { useEffect, useState } from "react";
|
||||
import type { SimSnapshot } from "@/lib/simulation-types";
|
||||
import type { SimSnapshot, PromptBreakdown } from "@/lib/simulation-types";
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
@@ -18,7 +18,7 @@ interface PromptModalProps {
|
||||
}
|
||||
|
||||
export function PromptModal({ entry, onClose }: PromptModalProps) {
|
||||
const [activeTab, setActiveTab] = useState<"actor" | "decoder">("actor");
|
||||
const [activeTab, setActiveTab] = useState<string>("actor");
|
||||
|
||||
useEffect(() => {
|
||||
if (!entry.rawPrompt && entry.decoderPrompt) {
|
||||
@@ -28,7 +28,7 @@ export function PromptModal({ entry, onClose }: PromptModalProps) {
|
||||
|
||||
// Helper to resolve components with a fallback if none exist (for backwards-compatibility)
|
||||
const getComponents = (
|
||||
promptBreakdown: any,
|
||||
promptBreakdown: PromptBreakdown | null | undefined,
|
||||
defaultType: "world" | "input",
|
||||
) => {
|
||||
if (!promptBreakdown) return [];
|
||||
@@ -53,9 +53,20 @@ export function PromptModal({ entry, onClose }: PromptModalProps) {
|
||||
const actorComponents = getComponents(entry.rawPrompt, "world");
|
||||
const decoderComponents = getComponents(entry.decoderPrompt, "input");
|
||||
|
||||
const isValidatorTab = activeTab.startsWith("validator-");
|
||||
const validatorIndex = isValidatorTab
|
||||
? parseInt(activeTab.substring("validator-".length), 10)
|
||||
: -1;
|
||||
const validatorCall = isValidatorTab
|
||||
? entry.validatorCalls?.find((c) => c.intentIndex === validatorIndex)
|
||||
: null;
|
||||
const validatorComponents = validatorCall
|
||||
? getComponents(validatorCall.prompt, "world")
|
||||
: [];
|
||||
|
||||
return (
|
||||
<Dialog open onOpenChange={(open) => !open && onClose()}>
|
||||
<DialogContent className="max-w-[750px] sm:max-w-[750px] h-[90vh] overflow-hidden flex flex-col p-0 gap-0">
|
||||
<DialogContent className="max-w-187.5 sm:max-w-187.5 h-[90vh] overflow-hidden flex flex-col p-0 gap-0">
|
||||
<DialogHeader className="px-6 pt-5 pb-4 border-b">
|
||||
<DialogTitle className="text-lg">
|
||||
Raw Prompts & Token Usage ({entry.entityName})
|
||||
@@ -67,6 +78,12 @@ export function PromptModal({ entry, onClose }: PromptModalProps) {
|
||||
onTabChange={setActiveTab}
|
||||
hasActor={!!entry.rawPrompt}
|
||||
hasDecoder={!!entry.decoderPrompt}
|
||||
validatorCalls={
|
||||
entry.validatorCalls?.map((c) => ({
|
||||
intentIndex: c.intentIndex,
|
||||
intentContent: c.intentContent,
|
||||
})) || []
|
||||
}
|
||||
/>
|
||||
|
||||
<div className="overflow-y-auto flex-1 p-5">
|
||||
@@ -99,10 +116,42 @@ export function PromptModal({ entry, onClose }: PromptModalProps) {
|
||||
modelName={entry.decoderUsage?.modelName}
|
||||
providerInstanceName={entry.decoderUsage?.providerInstanceName}
|
||||
outputLabel="LLM Output (Decoded Intent Sequence)"
|
||||
outputText={JSON.stringify(entry.intents, null, 2)}
|
||||
outputText={JSON.stringify(
|
||||
entry.decodedIntents || entry.intents,
|
||||
null,
|
||||
2,
|
||||
)}
|
||||
outputTokens={entry.decoderUsage?.outputTokens}
|
||||
/>
|
||||
)}
|
||||
|
||||
{validatorCall && validatorCall.prompt && (
|
||||
<PromptAnalyzer
|
||||
components={validatorComponents}
|
||||
inputTokens={validatorCall.usage?.inputTokens || 0}
|
||||
maxContext={
|
||||
validatorCall.usage?.maxContext !== undefined
|
||||
? validatorCall.usage.maxContext
|
||||
: 32768
|
||||
}
|
||||
modelName={validatorCall.usage?.modelName}
|
||||
providerInstanceName={validatorCall.usage?.providerInstanceName}
|
||||
outputLabel={`LLM Output`}
|
||||
outputText={JSON.stringify(validatorCall.response, null, 2)}
|
||||
outputTokens={validatorCall.usage?.outputTokens}
|
||||
/>
|
||||
)}
|
||||
|
||||
{validatorCall && !validatorCall.prompt && (
|
||||
<div className="flex flex-col items-center justify-center border border-dashed rounded-lg bg-muted/20 text-muted-foreground p-8 my-6">
|
||||
<span className="text-sm font-semibold mb-2 text-foreground">
|
||||
Bypassed LLM Validation
|
||||
</span>
|
||||
<p className="text-xs text-center text-muted-foreground max-w-md">
|
||||
{validatorCall.response.reason}
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
"use client";
|
||||
|
||||
interface PromptSwitcherProps {
|
||||
activeTab: "actor" | "decoder";
|
||||
onTabChange: (tab: "actor" | "decoder") => void;
|
||||
activeTab: string;
|
||||
onTabChange: (tab: string) => void;
|
||||
hasActor: boolean;
|
||||
hasDecoder: boolean;
|
||||
validatorCalls?: { intentIndex: number; intentContent: string }[];
|
||||
}
|
||||
|
||||
export function PromptSwitcher({
|
||||
@@ -12,32 +13,67 @@ export function PromptSwitcher({
|
||||
onTabChange,
|
||||
hasActor,
|
||||
hasDecoder,
|
||||
validatorCalls = [],
|
||||
}: PromptSwitcherProps) {
|
||||
return (
|
||||
<div className="flex items-center justify-center gap-4 border-b bg-muted/50 px-5 py-4">
|
||||
<button
|
||||
onClick={() => onTabChange("actor")}
|
||||
disabled={!hasActor}
|
||||
className={`flex h-14 w-40 items-center justify-center border-2 text-sm font-medium transition-all ${
|
||||
activeTab === "actor"
|
||||
? "border-primary bg-primary text-primary-foreground shadow-sm"
|
||||
: "border-border/30 bg-card text-foreground hover:border-primary/50"
|
||||
} disabled:cursor-not-allowed disabled:opacity-40`}
|
||||
>
|
||||
Actor Prompt
|
||||
</button>
|
||||
<span className="text-xl text-muted-foreground">→</span>
|
||||
<button
|
||||
onClick={() => onTabChange("decoder")}
|
||||
disabled={!hasDecoder}
|
||||
className={`flex h-14 w-44 items-center justify-center border-2 text-sm font-medium transition-all ${
|
||||
activeTab === "decoder"
|
||||
? "border-primary bg-primary text-primary-foreground shadow-sm"
|
||||
: "border-border/30 bg-card text-foreground hover:border-primary/50"
|
||||
} disabled:cursor-not-allowed disabled:opacity-40`}
|
||||
>
|
||||
Intent Decoder
|
||||
</button>
|
||||
<div className="flex items-center justify-center gap-4 border-b bg-muted/40 px-6 py-5 overflow-x-auto">
|
||||
{/* Primary Pipeline (Linear flow to the left) */}
|
||||
<div className="flex items-center gap-3 shrink-0">
|
||||
<button
|
||||
onClick={() => onTabChange("actor")}
|
||||
disabled={!hasActor}
|
||||
className={`flex h-12 w-36 items-center justify-center border-2 text-xs font-semibold uppercase tracking-wider transition-all ${
|
||||
activeTab === "actor"
|
||||
? "border-primary bg-primary text-primary-foreground shadow-sm"
|
||||
: "border-border bg-card text-foreground hover:border-primary/50"
|
||||
} disabled:cursor-not-allowed disabled:opacity-40 rounded`}
|
||||
>
|
||||
Actor Prompt
|
||||
</button>
|
||||
|
||||
<span className="text-lg text-muted-foreground">→</span>
|
||||
|
||||
<button
|
||||
onClick={() => onTabChange("decoder")}
|
||||
disabled={!hasDecoder}
|
||||
className={`flex h-12 w-36 items-center justify-center border-2 text-xs font-semibold uppercase tracking-wider transition-all ${
|
||||
activeTab === "decoder"
|
||||
? "border-primary bg-primary text-primary-foreground shadow-sm"
|
||||
: "border-border bg-card text-foreground hover:border-primary/50"
|
||||
} disabled:cursor-not-allowed disabled:opacity-40 rounded`}
|
||||
>
|
||||
Intent Decoder
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* Branching Validator Column to the right of Intent Decoder */}
|
||||
{validatorCalls.length > 0 && (
|
||||
<div className="flex items-center gap-3 shrink-0">
|
||||
<span className="text-lg text-muted-foreground">→</span>
|
||||
|
||||
<div className="flex flex-col gap-2 pl-3">
|
||||
<div className="flex flex-col gap-2">
|
||||
{validatorCalls.map((call) => {
|
||||
const tabKey = `validator-${call.intentIndex}`;
|
||||
return (
|
||||
<button
|
||||
key={tabKey}
|
||||
onClick={() => onTabChange(tabKey)}
|
||||
className={`flex h-12 w-36 items-center justify-center border-2 text-xs font-semibold uppercase tracking-wider transition-all rounded ${
|
||||
activeTab === tabKey
|
||||
? "border-primary bg-primary text-primary-foreground shadow-sm"
|
||||
: "border-border bg-card text-foreground hover:border-primary/50"
|
||||
}`}
|
||||
title={call.intentContent}
|
||||
>
|
||||
LLM Validator (Intent #{call.intentIndex})
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@ export function ScenarioCard({
|
||||
return (
|
||||
<div
|
||||
onClick={disabled ? undefined : onClick}
|
||||
className={`flex-shrink-0 w-64 border border-border/30 bg-card p-5 shadow-sm transition-all ${
|
||||
className={`shrink-0 w-64 border border-border/30 bg-card p-5 shadow-sm transition-all ${
|
||||
disabled
|
||||
? "opacity-50 cursor-not-allowed filter grayscale"
|
||||
: "cursor-pointer hover:-translate-y-0.5 hover:shadow-md active:translate-y-0 active:shadow-sm"
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -99,12 +99,13 @@ function InputGroupButton({
|
||||
return React.cloneElement(render, {
|
||||
className: cn(
|
||||
inputGroupButtonVariants({ size }),
|
||||
(render.props as any)?.className,
|
||||
(render.props as Record<string, unknown>)?.className as
|
||||
string | undefined,
|
||||
className,
|
||||
),
|
||||
type,
|
||||
...props,
|
||||
} as any);
|
||||
} as Record<string, unknown> as React.HTMLAttributes<HTMLElement>);
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
@@ -20,6 +20,34 @@ export interface PromptBreakdown {
|
||||
components?: PromptComponent[];
|
||||
}
|
||||
|
||||
export interface ValidatorCall {
|
||||
intentIndex: number;
|
||||
intentContent: string;
|
||||
prompt?: PromptBreakdown;
|
||||
response: {
|
||||
isValid: boolean;
|
||||
reason: string;
|
||||
};
|
||||
usage?: {
|
||||
inputTokens: number;
|
||||
outputTokens: number;
|
||||
totalTokens: number;
|
||||
modelName?: string;
|
||||
providerInstanceName?: string;
|
||||
maxContext?: number;
|
||||
};
|
||||
}
|
||||
|
||||
export interface HandoffResult {
|
||||
chunks: {
|
||||
content: string;
|
||||
importance: number;
|
||||
quotes?: string[];
|
||||
retainInBuffer?: boolean;
|
||||
involvedEntityIds?: string[];
|
||||
}[];
|
||||
}
|
||||
|
||||
export interface LogEntry {
|
||||
turn: number;
|
||||
entityId: string;
|
||||
@@ -28,7 +56,9 @@ export interface LogEntry {
|
||||
intents: IntentInfo[];
|
||||
timestamp: string;
|
||||
isHandoff?: boolean;
|
||||
handoffResult?: any;
|
||||
handoffResult?: HandoffResult;
|
||||
decodedIntents?: IntentInfo[];
|
||||
validatorCalls?: ValidatorCall[];
|
||||
rawPrompt?: PromptBreakdown;
|
||||
usage?: {
|
||||
inputTokens: number;
|
||||
@@ -76,4 +106,6 @@ export interface SimSnapshot {
|
||||
entityIndex: number;
|
||||
waitingEntity?: WaitingContext;
|
||||
error?: string;
|
||||
worldTime?: string;
|
||||
currentLocation?: string;
|
||||
}
|
||||
|
||||
@@ -39,7 +39,7 @@ export async function runHandoffResolution(session: SimSession): Promise<void> {
|
||||
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
|
||||
@@ -63,7 +63,7 @@ export async function runHandoffResolution(session: SimSession): Promise<void> {
|
||||
}
|
||||
: undefined,
|
||||
usage: lastCall?.usage,
|
||||
handoffResult: lastResult?.response || lastCall?.response,
|
||||
handoffResult: (lastResult?.response || lastCall?.response) as any,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -483,6 +483,23 @@ export class SimulationManager {
|
||||
};
|
||||
});
|
||||
|
||||
// Get current location from the waiting entity
|
||||
let currentLocation: string | undefined;
|
||||
if (
|
||||
worldState &&
|
||||
session.entityIndex >= 0 &&
|
||||
session.entityIndex < session.entities.length
|
||||
) {
|
||||
const currentEntityInfo = session.entities[session.entityIndex];
|
||||
const actualEntity = worldState.getEntity(currentEntityInfo.id);
|
||||
if (actualEntity?.locationId) {
|
||||
const location = worldState.getLocation(actualEntity.locationId);
|
||||
if (location) {
|
||||
currentLocation = location.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
id: session.worldInstanceId,
|
||||
status: session.status,
|
||||
@@ -495,6 +512,8 @@ export class SimulationManager {
|
||||
entityIndex: session.entityIndex,
|
||||
waitingEntity: session.waitingEntity,
|
||||
error: session.error,
|
||||
worldTime: worldState?.clock.get().toISOString(),
|
||||
currentLocation,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@ import type {
|
||||
IntentInfo,
|
||||
LogEntry,
|
||||
WaitingContext,
|
||||
ValidatorCall,
|
||||
} from "../simulation-types";
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -49,10 +50,12 @@ async function processIntents(
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
worldState: any,
|
||||
session: SimSession,
|
||||
): Promise<IntentInfo[]> {
|
||||
): Promise<{ intentInfos: IntentInfo[]; validatorCalls: ValidatorCall[] }> {
|
||||
const intentInfos: IntentInfo[] = [];
|
||||
const validatorCalls: ValidatorCall[] = [];
|
||||
|
||||
for (const intent of intents) {
|
||||
for (let i = 0; i < intents.length; i++) {
|
||||
const intent = intents[i];
|
||||
const outcome = await session.architect.processIntent(worldState, intent);
|
||||
const ts = worldState.clock.get().toISOString();
|
||||
|
||||
@@ -66,6 +69,50 @@ async function processIntents(
|
||||
minutesToAdvance: outcome.timeDelta?.minutesToAdvance,
|
||||
});
|
||||
|
||||
if (intent.type === "action" && session.architect.validator.lastResult) {
|
||||
const lastResult = session.architect.validator.lastResult;
|
||||
let usage = undefined;
|
||||
if (
|
||||
session.validatorProvider.lastCalls &&
|
||||
session.validatorProvider.lastCalls.length > 0
|
||||
) {
|
||||
const valCall =
|
||||
session.validatorProvider.lastCalls[
|
||||
session.validatorProvider.lastCalls.length - 1
|
||||
];
|
||||
usage = valCall.usage;
|
||||
}
|
||||
|
||||
validatorCalls.push({
|
||||
intentIndex: i,
|
||||
intentContent: intent.content,
|
||||
prompt: {
|
||||
systemPrompt: lastResult.systemPrompt || "",
|
||||
userContext: lastResult.userContext || "",
|
||||
components: lastResult.components,
|
||||
},
|
||||
response: {
|
||||
isValid: outcome.isValid,
|
||||
reason: outcome.reason,
|
||||
},
|
||||
usage,
|
||||
});
|
||||
} else {
|
||||
const reason =
|
||||
intent.type === "dialogue"
|
||||
? "Dialogue intents represent verbal/communication actions and are automatically valid."
|
||||
: "Monologue/thought intents represent internal reflections and bypass validation.";
|
||||
|
||||
validatorCalls.push({
|
||||
intentIndex: i,
|
||||
intentContent: intent.content,
|
||||
response: {
|
||||
isValid: true,
|
||||
reason: outcome.reason || reason,
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
const actorEntry = buildBufferEntryForIntent(intent, ts, entity.locationId);
|
||||
if (intent.type === "action") {
|
||||
actorEntry.outcome = { isValid: outcome.isValid, reason: outcome.reason };
|
||||
@@ -99,7 +146,7 @@ async function processIntents(
|
||||
}
|
||||
}
|
||||
|
||||
return intentInfos;
|
||||
return { intentInfos, validatorCalls };
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -219,13 +266,21 @@ export async function processNpcTurn(
|
||||
entry.decoderUsage = decoderCall.usage;
|
||||
}
|
||||
|
||||
entry.intents = await processIntents(
|
||||
const { intentInfos, validatorCalls } = await processIntents(
|
||||
result.intents.intents,
|
||||
info.id,
|
||||
entity,
|
||||
worldState,
|
||||
session,
|
||||
);
|
||||
entry.intents = intentInfos;
|
||||
entry.validatorCalls = validatorCalls;
|
||||
entry.decodedIntents = result.intents.intents.map((intent) => ({
|
||||
type: intent.type,
|
||||
content: intent.content,
|
||||
modifiers: intent.modifiers || [],
|
||||
targetIds: intent.targetIds,
|
||||
}));
|
||||
|
||||
session.log.push(entry);
|
||||
session.coreRepo.saveWorldState(worldState);
|
||||
@@ -303,13 +358,21 @@ export async function executePlayerAction(
|
||||
entry.decoderUsage = call.usage;
|
||||
}
|
||||
|
||||
entry.intents = await processIntents(
|
||||
const { intentInfos, validatorCalls: playerValCalls } = await processIntents(
|
||||
result.intents.intents,
|
||||
ctx.entityId,
|
||||
entity,
|
||||
worldState,
|
||||
session,
|
||||
);
|
||||
entry.intents = intentInfos;
|
||||
entry.validatorCalls = playerValCalls;
|
||||
entry.decodedIntents = result.intents.intents.map((intent) => ({
|
||||
type: intent.type,
|
||||
content: intent.content,
|
||||
modifiers: intent.modifiers || [],
|
||||
targetIds: intent.targetIds,
|
||||
}));
|
||||
|
||||
session.log.push(entry);
|
||||
session.coreRepo.saveWorldState(worldState);
|
||||
|
||||
@@ -4,3 +4,41 @@ import { twMerge } from "tailwind-merge";
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
|
||||
export function formatSimDate(isoString: string): string {
|
||||
try {
|
||||
const d = new Date(isoString);
|
||||
if (isNaN(d.getTime())) return isoString;
|
||||
const yyyy = d.getUTCFullYear();
|
||||
const mm = String(d.getUTCMonth() + 1).padStart(2, "0");
|
||||
const dd = String(d.getUTCDate()).padStart(2, "0");
|
||||
return `${yyyy}-${mm}-${dd}`;
|
||||
} catch {
|
||||
return isoString;
|
||||
}
|
||||
}
|
||||
|
||||
export function formatSimTimeHM(isoString: string): string {
|
||||
try {
|
||||
const d = new Date(isoString);
|
||||
if (isNaN(d.getTime())) return isoString;
|
||||
const hh = String(d.getUTCHours());
|
||||
const mm = String(d.getUTCMinutes()).padStart(2, "0");
|
||||
return `${hh}:${mm}`;
|
||||
} catch {
|
||||
return isoString;
|
||||
}
|
||||
}
|
||||
|
||||
export function getClockIcon(isoString: string): string {
|
||||
try {
|
||||
const d = new Date(isoString);
|
||||
if (isNaN(d.getTime())) return "/clock_day_icon.png";
|
||||
const hour = d.getUTCHours();
|
||||
return hour >= 6 && hour < 18
|
||||
? "/clock_day_icon.png"
|
||||
: "/clock_night_icon.png";
|
||||
} catch {
|
||||
return "/clock_day_icon.png";
|
||||
}
|
||||
}
|
||||
|
||||
15
docker-compose.yml
Normal file
15
docker-compose.yml
Normal file
@@ -0,0 +1,15 @@
|
||||
services:
|
||||
omnia-gui:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/gui/Dockerfile
|
||||
ports:
|
||||
- "3000:3000"
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- GOOGLE_API_KEY=${GOOGLE_API_KEY:-}
|
||||
volumes:
|
||||
- omnia-data:/app/apps/gui/data
|
||||
|
||||
volumes:
|
||||
omnia-data:
|
||||
@@ -28,7 +28,7 @@
|
||||
"devEngines": {
|
||||
"packageManager": {
|
||||
"name": "pnpm",
|
||||
"version": "11.13.0",
|
||||
"version": "11.15.1",
|
||||
"onFail": "download"
|
||||
}
|
||||
},
|
||||
|
||||
@@ -4,7 +4,6 @@ import {
|
||||
WorldState,
|
||||
naturalizeTime,
|
||||
serializeSubjectiveWorldState,
|
||||
resolveAlias,
|
||||
} from "@omnia/core";
|
||||
import {
|
||||
BufferEntry,
|
||||
@@ -14,7 +13,7 @@ import {
|
||||
LedgerRepository,
|
||||
} from "@omnia/memory";
|
||||
import { hydrate } from "@omnia/voice";
|
||||
import { PromptComponent } from "@omnia/llm";
|
||||
import { PromptComponent, IPromptBuilder, PromptBreakdown } from "@omnia/llm";
|
||||
|
||||
/**
|
||||
* Zod schema for the structured response expected from the actor LLM.
|
||||
@@ -38,7 +37,9 @@ export type ActorResponse = z.infer<typeof ActorResponseSchema>;
|
||||
* ACL'd to it), its own Cognitive Buffer, and the entities co-located
|
||||
* with it. System UUIDs are surfaced as subjective aliases.
|
||||
*/
|
||||
export class ActorPromptBuilder {
|
||||
export class ActorPromptBuilder implements IPromptBuilder<
|
||||
[WorldState, Entity]
|
||||
> {
|
||||
/**
|
||||
* @param bufferRepo Used to fetch the actor's Cognitive Buffer. Optional —
|
||||
* if absent, the memory section is omitted.
|
||||
@@ -64,14 +65,7 @@ export class ActorPromptBuilder {
|
||||
/**
|
||||
* Assembles the system prompt and user context for a given entity.
|
||||
*/
|
||||
build(
|
||||
worldState: WorldState,
|
||||
entity: Entity,
|
||||
): {
|
||||
systemPrompt: string;
|
||||
userContext: string;
|
||||
components: PromptComponent[];
|
||||
} {
|
||||
build(worldState: WorldState, entity: Entity): PromptBreakdown {
|
||||
const systemPrompt = this.buildSystemPrompt();
|
||||
const { userContext, components } = this.buildUserContext(
|
||||
worldState,
|
||||
|
||||
@@ -9,7 +9,7 @@ export interface ProcessResult extends ValidationResult {
|
||||
}
|
||||
|
||||
export class Architect {
|
||||
private validator: LLMValidator;
|
||||
public validator: LLMValidator;
|
||||
private timeDeltaGenerator: TimeDeltaGenerator;
|
||||
|
||||
constructor(
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
export * from "./llm-validator.js";
|
||||
export * from "./llm-validator-prompt-builder.js";
|
||||
export * from "./architect.js";
|
||||
export * from "./delta.js";
|
||||
|
||||
59
packages/architect/src/llm-validator-prompt-builder.ts
Normal file
59
packages/architect/src/llm-validator-prompt-builder.ts
Normal file
@@ -0,0 +1,59 @@
|
||||
import { WorldState, serializeObjectiveWorldState } from "@omnia/core";
|
||||
import { Intent } from "@omnia/intent";
|
||||
import { hydrateObjective } from "@omnia/voice";
|
||||
import { PromptBreakdown, PromptComponent, IPromptBuilder } from "@omnia/llm";
|
||||
|
||||
/**
|
||||
* Prompt builder for the LLM Validator (World Architect).
|
||||
* Separates prompt generation, structure, and component breakdowns.
|
||||
*/
|
||||
export class LLMValidatorPromptBuilder implements IPromptBuilder<
|
||||
[WorldState, Intent]
|
||||
> {
|
||||
build(worldState: WorldState, intent: Intent): PromptBreakdown {
|
||||
const serializedWorld = serializeObjectiveWorldState(worldState);
|
||||
|
||||
const systemPrompt = `
|
||||
You are the World Architect, a deterministic and objective judge of reality, physics, and narration for a simulation game.
|
||||
Your task is to judge whether a proposed action (Intent) by an actor is physically and logically possible given the current objective state of the world.
|
||||
Exempt dialogue or speech actions from validation (consider them always valid).
|
||||
Enforce logical boundaries such as:
|
||||
- Spatial boundaries (an actor cannot grab an object in another location unless they are there).
|
||||
- Physical boundaries (an actor cannot open a locked drawer without a key or breaking it).
|
||||
- State Boundaries (an actor cannot perform a task if their state doesn't allow them to do so).
|
||||
- State/Attribute constraints.
|
||||
- An actor can perform actions on themselves as long as it follows the boundaries stated above.
|
||||
|
||||
You must respond with a JSON object containing:
|
||||
- "isValid": boolean indicating if the action is possible/allowed.
|
||||
- "reason": a very short explanation of why the action is allowed or denied.
|
||||
`.trim();
|
||||
|
||||
const objectiveContent = hydrateObjective(intent.content, worldState);
|
||||
|
||||
const worldStateSection = `=== CURRENT WORLD STATE ===\nCurrent Time: ${worldState.clock.get().toISOString()}\nEntities & Attributes:\n${serializedWorld}`;
|
||||
const proposedActionSection = `=== PROPOSED ACTION ===\nActor ID: ${intent.actorId}\nType: ${intent.type}\nContent: "${objectiveContent}"\nTarget IDs: ${intent.targetIds.join(", ") || "(None)"}`;
|
||||
|
||||
const userContext = `${worldStateSection}\n\n${proposedActionSection}\n\nDecide if the proposed action is logically valid and physically possible.`;
|
||||
|
||||
const components: PromptComponent[] = [
|
||||
{ label: "System Prompt", type: "system", content: systemPrompt },
|
||||
{
|
||||
label: "Current World State",
|
||||
type: "world",
|
||||
content: worldStateSection,
|
||||
},
|
||||
{
|
||||
label: "Proposed Action",
|
||||
type: "input",
|
||||
content: proposedActionSection,
|
||||
},
|
||||
];
|
||||
|
||||
return {
|
||||
systemPrompt,
|
||||
userContext,
|
||||
components,
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,8 @@
|
||||
import { z } from "zod";
|
||||
import { WorldState, serializeObjectiveWorldState } from "@omnia/core";
|
||||
import { ILLMProvider } from "@omnia/llm";
|
||||
import { WorldState } from "@omnia/core";
|
||||
import { ILLMProvider, PromptBreakdown } from "@omnia/llm";
|
||||
import { Intent } from "@omnia/intent";
|
||||
import { hydrateObjective } from "@omnia/voice";
|
||||
import { LLMValidatorPromptBuilder } from "./llm-validator-prompt-builder.js";
|
||||
|
||||
export const ValidationResultSchema = z.object({
|
||||
isValid: z.boolean(),
|
||||
@@ -12,7 +12,12 @@ export const ValidationResultSchema = z.object({
|
||||
export type ValidationResult = z.infer<typeof ValidationResultSchema>;
|
||||
|
||||
export class LLMValidator {
|
||||
constructor(private llmProvider: ILLMProvider) {}
|
||||
public lastResult: PromptBreakdown | null = null;
|
||||
private promptBuilder: LLMValidatorPromptBuilder;
|
||||
|
||||
constructor(private llmProvider: ILLMProvider) {
|
||||
this.promptBuilder = new LLMValidatorPromptBuilder();
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates an action intent against the objective world state.
|
||||
@@ -25,6 +30,8 @@ export class LLMValidator {
|
||||
worldState: WorldState,
|
||||
intent: Intent,
|
||||
): Promise<ValidationResult> {
|
||||
this.lastResult = null;
|
||||
|
||||
// Defensive guard: monologue and thought intents bypass validation.
|
||||
if (intent.type === "monologue" || intent.type === "thought") {
|
||||
return {
|
||||
@@ -42,41 +49,16 @@ export class LLMValidator {
|
||||
};
|
||||
}
|
||||
|
||||
// 1. Serialize the objective world state for the LLM
|
||||
const serializedWorld = serializeObjectiveWorldState(worldState);
|
||||
const { systemPrompt, userContext, components } = this.promptBuilder.build(
|
||||
worldState,
|
||||
intent,
|
||||
);
|
||||
|
||||
// 2. Build the prompts
|
||||
const systemPrompt = `
|
||||
You are the World Architect, a deterministic and objective judge of reality, physics, and narration for a simulation game.
|
||||
Your task is to judge whether a proposed action (Intent) by an actor is physically and logically possible given the current objective state of the world.
|
||||
Exempt dialogue or speech actions from validation (consider them always valid).
|
||||
Enforce logical boundaries such as:
|
||||
- Spatial boundaries (an actor cannot grab an object in another location unless they are there).
|
||||
- Physical boundaries (an actor cannot open a locked drawer without a key or breaking it).
|
||||
- State Boundaries (an actor cannot perform a task if their state doesn't allow them to do so).
|
||||
- State/Attribute constraints.
|
||||
|
||||
You must respond with a JSON object containing:
|
||||
- "isValid": boolean indicating if the action is possible/allowed.
|
||||
- "reason": a concise explanation of why the action is allowed or denied.
|
||||
`.trim();
|
||||
|
||||
const objectiveContent = hydrateObjective(intent.content, worldState);
|
||||
|
||||
const userContext = `
|
||||
=== CURRENT WORLD STATE ===
|
||||
Current Time: ${worldState.clock.get().toISOString()}
|
||||
Entities & Attributes:
|
||||
${serializedWorld}
|
||||
|
||||
=== PROPOSED ACTION ===
|
||||
Actor ID: ${intent.actorId}
|
||||
Type: ${intent.type}
|
||||
Content: "${objectiveContent}"
|
||||
Target IDs: ${intent.targetIds.join(", ") || "(None)"}
|
||||
|
||||
Decide if the proposed action is logically valid and physically possible.
|
||||
`.trim();
|
||||
this.lastResult = {
|
||||
systemPrompt,
|
||||
userContext,
|
||||
components,
|
||||
};
|
||||
|
||||
// structured call via the LLM provider
|
||||
const response = await this.llmProvider.generateStructuredResponse({
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { WorldState, resolveAlias } from "@omnia/core";
|
||||
import { PromptBreakdown, PromptComponent } from "@omnia/llm";
|
||||
import { PromptBreakdown, PromptComponent, IPromptBuilder } from "@omnia/llm";
|
||||
import { Intent } from "./intent.js";
|
||||
|
||||
// TODO: Builder a generic interface for prompt builders in @omnia/llm: IPromptBuilder or something
|
||||
|
||||
/**
|
||||
* Prompt builder for the Intent Decoder.
|
||||
* Separates prompt generation, structure, and component breakdowns.
|
||||
*/
|
||||
export class IntentDecoderPromptBuilder {
|
||||
export class IntentDecoderPromptBuilder implements IPromptBuilder<
|
||||
[WorldState, string, string, Intent[]]
|
||||
> {
|
||||
build(
|
||||
worldState: WorldState,
|
||||
actorId: string,
|
||||
|
||||
@@ -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 () => {
|
||||
|
||||
@@ -13,7 +13,7 @@ export interface PromptBreakdown {
|
||||
components?: PromptComponent[];
|
||||
}
|
||||
|
||||
export interface IPromptBuilder<TArgs extends any[]> {
|
||||
export interface IPromptBuilder<TArgs extends unknown[]> {
|
||||
build(...args: TArgs): PromptBreakdown;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ export interface LLMCallRecord {
|
||||
providerInstanceName?: string;
|
||||
maxContext?: number;
|
||||
};
|
||||
response?: any;
|
||||
response?: unknown;
|
||||
}
|
||||
|
||||
export interface ILLMProvider {
|
||||
|
||||
@@ -62,6 +62,50 @@ export class ProviderManager {
|
||||
};
|
||||
}
|
||||
|
||||
static duplicate(id: string): ModelProviderInstance | null {
|
||||
const db = getDb();
|
||||
const source = db
|
||||
.prepare("SELECT * FROM provider_instances WHERE id = ?")
|
||||
.get(id) as DbRow | undefined;
|
||||
if (!source) return null;
|
||||
|
||||
const newId = "provider-" + Date.now();
|
||||
const newName = `${source.name} (Copy)`;
|
||||
|
||||
const activeCount = db
|
||||
.prepare(
|
||||
"SELECT COUNT(*) as count FROM provider_instances WHERE isActive = 1 AND type = ?",
|
||||
)
|
||||
.get(source.type) as { count: number };
|
||||
const isActive = activeCount.count === 0 ? 1 : 0;
|
||||
|
||||
db.prepare(
|
||||
`INSERT INTO provider_instances (id, name, providerName, apiKey, isActive, modelName, type, maxContext, endpointUrl)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`,
|
||||
).run(
|
||||
newId,
|
||||
newName,
|
||||
source.providerName,
|
||||
source.apiKey,
|
||||
isActive,
|
||||
source.modelName,
|
||||
source.type,
|
||||
source.maxContext,
|
||||
source.endpointUrl,
|
||||
);
|
||||
|
||||
return {
|
||||
id: newId,
|
||||
name: newName,
|
||||
providerName: source.providerName,
|
||||
apiKey: source.apiKey,
|
||||
isActive: isActive === 1,
|
||||
modelName: source.modelName || undefined,
|
||||
type: source.type as "generative" | "embedding",
|
||||
maxContext: source.maxContext,
|
||||
endpointUrl: source.endpointUrl || undefined,
|
||||
};
|
||||
}
|
||||
static delete(id: string): void {
|
||||
const db = getDb();
|
||||
const provider = db
|
||||
|
||||
@@ -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([]);
|
||||
}
|
||||
|
||||
@@ -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];
|
||||
});
|
||||
|
||||
@@ -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";
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { Entity } from "@omnia/core";
|
||||
import { PromptBreakdown, PromptComponent } from "@omnia/llm";
|
||||
import { PromptBreakdown, PromptComponent, IPromptBuilder } from "@omnia/llm";
|
||||
import { BufferEntry, serializeSubjectiveBufferEntry } from "./buffer.js";
|
||||
|
||||
/**
|
||||
* Prompt builder for the Handoff Engine.
|
||||
* Separates prompt generation, structure, and component breakdowns.
|
||||
*/
|
||||
export class HandoffPromptBuilder {
|
||||
export class HandoffPromptBuilder implements IPromptBuilder<
|
||||
[Entity, BufferEntry[], Date]
|
||||
> {
|
||||
build(entity: Entity, candidates: BufferEntry[], now: Date): PromptBreakdown {
|
||||
const candidatesList = candidates
|
||||
.map((entry) => {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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@<id>[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) => {
|
||||
|
||||
@@ -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}`;
|
||||
}
|
||||
|
||||
76
pnpm-lock.yaml
generated
76
pnpm-lock.yaml
generated
@@ -6,74 +6,74 @@ importers:
|
||||
configDependencies: {}
|
||||
packageManagerDependencies:
|
||||
"@pnpm/exe":
|
||||
specifier: 11.13.0
|
||||
version: 11.13.0
|
||||
specifier: 11.15.1
|
||||
version: 11.15.1
|
||||
pnpm:
|
||||
specifier: 11.13.0
|
||||
version: 11.13.0
|
||||
specifier: 11.15.1
|
||||
version: 11.15.1
|
||||
|
||||
packages:
|
||||
"@pnpm/exe@11.13.0":
|
||||
"@pnpm/exe@11.15.1":
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-aXsm4VW1awRuh4X4G4fl+1xdV+L9DElKrgc4Yq/3zgGQQ12ATj1n3MMeosfa68aX/i7E9VyWT42adDSg8+kEFQ==,
|
||||
integrity: sha512-+e+DQrUPtDqH+9blSre23l7od3P3lRy43HN8TOKHNvbtuTNDRQtqQ0seHk/kn7iJl+ZSKBALFrQXPvbItNgRwA==,
|
||||
}
|
||||
hasBin: true
|
||||
|
||||
"@pnpm/linux-arm64@11.13.0":
|
||||
"@pnpm/linux-arm64@11.15.1":
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-86ri9P/i3Enbv0NBAEtz27lBHHwCJqsC7YxHX56+jXPyFobGbsDVR5OUyoCCVVNz/Phs2O7c9SaDVdqKPzUFCA==,
|
||||
integrity: sha512-8QOTdBeklXcE/AY4cAR2RJ4809I38kLxtInAYW4sVDfQoWYjmEIoU/ZxpHsk78KM8VU0BehtOB+iZsMxSCyiLQ==,
|
||||
}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
"@pnpm/linux-x64@11.13.0":
|
||||
"@pnpm/linux-x64@11.15.1":
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-ZXvUMP5ew1WZllTq1f7Tm3l6sF5LK5sMesfdu9J6uxsznK/3tTi6edUeiNN6dA22mAHhjvrzVj+MeQ6X3DG0tA==,
|
||||
integrity: sha512-hbhuC2Rh5Zw9ERUsQhOSLPnwfWSRTU6phtuFdK2I2raYCXa7v5C4i+XKTH+sKLPG5vJiKPyi4Hd62UECHZoy2w==,
|
||||
}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
"@pnpm/linuxstatic-arm64@11.13.0":
|
||||
"@pnpm/linuxstatic-arm64@11.15.1":
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-elwRj0sE3W54gDECgbHu2/TerpZsHXRmLSXfzuIvReumGuOYk5zlUhD5dJqzp0B1ktetVNU4Rb1keENz5/Gb/Q==,
|
||||
integrity: sha512-xEL9kDvLXnNYAgQak9tfIhO/BaBf1R/1+/dzzntuquzSqrEaPs0x0P4qMmwq02hVBDfAGA2MAD4n9kmc6Q//tw==,
|
||||
}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
"@pnpm/linuxstatic-x64@11.13.0":
|
||||
"@pnpm/linuxstatic-x64@11.15.1":
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-PQyfFMRA6/uYB+1vqx0wSXfOirC5CUOKRlTjXNgI1q/R1Ug/NMDfKOr52qbWFllcG9pIHKV8hZTo4WyBUjS1mA==,
|
||||
integrity: sha512-SLJ4neJx649ri4qHdseQN6SnAy6nNFnsLGi7g+EH32cVux4aWX7tjMNTPHrUKJ6Oc7C6oPGXUpLmemEvAwCPOg==,
|
||||
}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
libc: [musl]
|
||||
|
||||
"@pnpm/macos-arm64@11.13.0":
|
||||
"@pnpm/macos-arm64@11.15.1":
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-qWf2wbvESMICLJcVfWNh4pwIsr2oK6yFwbuv1uHi0UY3OnWNt0+POmhqWtYWtDj+EPWM3pSfEAc+KFQAiaBCvg==,
|
||||
integrity: sha512-GbIUQcDZgO/i1Ql38Pk269KNYpEbSCWYcSXBHgT62y8qVTrpEbmi+TKNaLVYuUkK0k/hMibySRa5GUs7/vnNyw==,
|
||||
}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
"@pnpm/win-arm64@11.13.0":
|
||||
"@pnpm/win-arm64@11.15.1":
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-ZvbGFdjU3cX32+/sHOhV9VkkbBucJ9QyW/F6VSsqgkvmTZTXlQglYp4K1KBbKWxYKz4i6M9p5PStI6yYB+y0jA==,
|
||||
integrity: sha512-pLlcpdtoaHJxVfhWahoQg5U7Mv9b6/X/8og+dY1GX1GvsZU3Wf7Y+LlA1sfxqoPcohtQdo6MdJkWiOZ3nIFMCQ==,
|
||||
}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
"@pnpm/win-x64@11.13.0":
|
||||
"@pnpm/win-x64@11.15.1":
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-5KX2lMFbXZNvKC+gLftR5FiU25j/jMp24Zi9JB01T3r42uxrHt12GQP7CNkNjxCXdi8jioUB7e3iT1eINS8qVQ==,
|
||||
integrity: sha512-gAvQjBOrNb8zHXRQawBfZRtjDWEFe6p9aSBi8uuMtWB4XAaj0+YuzstsR93llZ/UgP67oTkbkCOITBLayRVGGQ==,
|
||||
}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
@@ -168,47 +168,47 @@ packages:
|
||||
}
|
||||
engines: { node: ">=8" }
|
||||
|
||||
pnpm@11.13.0:
|
||||
pnpm@11.15.1:
|
||||
resolution:
|
||||
{
|
||||
integrity: sha512-iNlHJNjy5sGGdEpVhMblnsrIaex7oV6ctM1ijo3HBmggskgdjuO1HqjaMjpzeAaKpYxVajcg0yt8IKBR0Ig2Og==,
|
||||
integrity: sha512-gTULB+U8lTigLx8jA7QpD6LXvgTlbiqXDEzEtBfcdh3hlu2r1J1Vx9yVgNuBAHxEFD5OPX5GKzAA0jwlUSLQZQ==,
|
||||
}
|
||||
engines: { node: ">=22.13" }
|
||||
hasBin: true
|
||||
|
||||
snapshots:
|
||||
"@pnpm/exe@11.13.0":
|
||||
"@pnpm/exe@11.15.1":
|
||||
dependencies:
|
||||
"@reflink/reflink": 0.1.19
|
||||
detect-libc: 2.1.2
|
||||
optionalDependencies:
|
||||
"@pnpm/linux-arm64": 11.13.0
|
||||
"@pnpm/linux-x64": 11.13.0
|
||||
"@pnpm/linuxstatic-arm64": 11.13.0
|
||||
"@pnpm/linuxstatic-x64": 11.13.0
|
||||
"@pnpm/macos-arm64": 11.13.0
|
||||
"@pnpm/win-arm64": 11.13.0
|
||||
"@pnpm/win-x64": 11.13.0
|
||||
"@pnpm/linux-arm64": 11.15.1
|
||||
"@pnpm/linux-x64": 11.15.1
|
||||
"@pnpm/linuxstatic-arm64": 11.15.1
|
||||
"@pnpm/linuxstatic-x64": 11.15.1
|
||||
"@pnpm/macos-arm64": 11.15.1
|
||||
"@pnpm/win-arm64": 11.15.1
|
||||
"@pnpm/win-x64": 11.15.1
|
||||
|
||||
"@pnpm/linux-arm64@11.13.0":
|
||||
"@pnpm/linux-arm64@11.15.1":
|
||||
optional: true
|
||||
|
||||
"@pnpm/linux-x64@11.13.0":
|
||||
"@pnpm/linux-x64@11.15.1":
|
||||
optional: true
|
||||
|
||||
"@pnpm/linuxstatic-arm64@11.13.0":
|
||||
"@pnpm/linuxstatic-arm64@11.15.1":
|
||||
optional: true
|
||||
|
||||
"@pnpm/linuxstatic-x64@11.13.0":
|
||||
"@pnpm/linuxstatic-x64@11.15.1":
|
||||
optional: true
|
||||
|
||||
"@pnpm/macos-arm64@11.13.0":
|
||||
"@pnpm/macos-arm64@11.15.1":
|
||||
optional: true
|
||||
|
||||
"@pnpm/win-arm64@11.13.0":
|
||||
"@pnpm/win-arm64@11.15.1":
|
||||
optional: true
|
||||
|
||||
"@pnpm/win-x64@11.13.0":
|
||||
"@pnpm/win-x64@11.15.1":
|
||||
optional: true
|
||||
|
||||
"@reflink/reflink-darwin-arm64@0.1.19":
|
||||
@@ -248,7 +248,7 @@ snapshots:
|
||||
|
||||
detect-libc@2.1.2: {}
|
||||
|
||||
pnpm@11.13.0: {}
|
||||
pnpm@11.15.1: {}
|
||||
|
||||
---
|
||||
lockfileVersion: "9.0"
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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)", () => {
|
||||
|
||||
Reference in New Issue
Block a user