feat: implement processTurn function to handle turn processing and world state updates
refactor: remove legacy types.ts file and update frontend to use new contracts feat: add applyActions function to manage action application and world state mutation chore: remove empty .gitkeep file from sqlite data directory refactor: update frontend App component to align with new API contracts and improve UX docs: revise project.md to reflect updated architecture and system requirements docs: update thoughts.md with current status, architecture decisions, and remaining checks
This commit is contained in:
7
charactergarden/app/src/contracts/action.ts
Normal file
7
charactergarden/app/src/contracts/action.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
export type Action = {
|
||||
actorId: string;
|
||||
type: string;
|
||||
targetId?: string;
|
||||
locationId?: string;
|
||||
metadata?: Record<string, unknown>;
|
||||
};
|
||||
6
charactergarden/app/src/contracts/entity.ts
Normal file
6
charactergarden/app/src/contracts/entity.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export type Entity = {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
attributes: Record<string, unknown>;
|
||||
};
|
||||
10
charactergarden/app/src/contracts/turn.ts
Normal file
10
charactergarden/app/src/contracts/turn.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { Action } from "./action";
|
||||
import type { ValidationResult } from "./validation";
|
||||
|
||||
export type Turn = {
|
||||
id: string;
|
||||
rawText: string;
|
||||
actions: Action[];
|
||||
validation: ValidationResult[];
|
||||
createdAt: number;
|
||||
};
|
||||
6
charactergarden/app/src/contracts/validation.ts
Normal file
6
charactergarden/app/src/contracts/validation.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export type ValidationResult = {
|
||||
actionIndex: number;
|
||||
success: boolean;
|
||||
reason?: string;
|
||||
message?: string;
|
||||
};
|
||||
8
charactergarden/app/src/contracts/world.ts
Normal file
8
charactergarden/app/src/contracts/world.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
import type { Entity } from "./entity";
|
||||
|
||||
export type WorldState = {
|
||||
id: string;
|
||||
entities: Record<string, Entity>;
|
||||
metadata: Record<string, unknown>;
|
||||
createdAt: number;
|
||||
};
|
||||
Reference in New Issue
Block a user