Integrate unfinished server-rs refactor worklists
This commit is contained in:
@@ -193,3 +193,7 @@ export type BigFishRuntimeSnapshotResponse = {
|
||||
eventLog: string[];
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export type BigFishRunResponse = {
|
||||
run: BigFishRuntimeSnapshotResponse;
|
||||
};
|
||||
|
||||
104
packages/shared/src/contracts/story.ts
Normal file
104
packages/shared/src/contracts/story.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
import type { JsonObject } from './common';
|
||||
|
||||
/**
|
||||
* story session 主链共享契约。
|
||||
* 字段命名与 server-rs/shared-contracts/src/story.rs 的 camelCase 回包保持一致。
|
||||
*/
|
||||
|
||||
export type BeginStorySessionRequest = {
|
||||
runtimeSessionId: string;
|
||||
worldProfileId: string;
|
||||
initialPrompt: string;
|
||||
openingSummary?: string | null;
|
||||
};
|
||||
|
||||
export type ContinueStoryRequest = {
|
||||
storySessionId: string;
|
||||
narrativeText: string;
|
||||
choiceFunctionId?: string | null;
|
||||
};
|
||||
|
||||
export type StorySessionPayload = {
|
||||
storySessionId: string;
|
||||
runtimeSessionId: string;
|
||||
actorUserId: string;
|
||||
worldProfileId: string;
|
||||
initialPrompt: string;
|
||||
openingSummary?: string | null;
|
||||
latestNarrativeText: string;
|
||||
latestChoiceFunctionId?: string | null;
|
||||
status: string;
|
||||
version: number;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
};
|
||||
|
||||
export type StoryEventPayload = {
|
||||
eventId: string;
|
||||
storySessionId: string;
|
||||
eventKind: string;
|
||||
narrativeText: string;
|
||||
choiceFunctionId?: string | null;
|
||||
createdAt: string;
|
||||
};
|
||||
|
||||
export type StorySessionMutationResponse = {
|
||||
storySession: StorySessionPayload;
|
||||
storyEvent: StoryEventPayload;
|
||||
};
|
||||
|
||||
export type StorySessionStateResponse = {
|
||||
storySession: StorySessionPayload;
|
||||
storyEvents: StoryEventPayload[];
|
||||
};
|
||||
|
||||
export type StoryRuntimeProjectionRequest = {
|
||||
storySessionId: string;
|
||||
clientVersion?: number;
|
||||
};
|
||||
|
||||
export type StoryRuntimeActorProjection = {
|
||||
hp: number;
|
||||
maxHp: number;
|
||||
mana: number;
|
||||
maxMana: number;
|
||||
currency: number;
|
||||
currencyText: string;
|
||||
};
|
||||
|
||||
export type StoryRuntimeInventoryProjection = {
|
||||
backpackItems: JsonObject[];
|
||||
equipmentSlots: JsonObject[];
|
||||
forgeRecipes: JsonObject[];
|
||||
};
|
||||
|
||||
export type StoryRuntimeOptionProjection = {
|
||||
functionId: string;
|
||||
actionText: string;
|
||||
detailText?: string | null;
|
||||
scope: string;
|
||||
payload?: JsonObject | null;
|
||||
enabled: boolean;
|
||||
reason?: string | null;
|
||||
};
|
||||
|
||||
export type StoryRuntimeStatusProjection = {
|
||||
inBattle: boolean;
|
||||
npcInteractionActive: boolean;
|
||||
currentEncounterId?: string | null;
|
||||
currentNpcBattleMode?: string | null;
|
||||
currentNpcBattleOutcome?: string | null;
|
||||
};
|
||||
|
||||
export type StoryRuntimeProjectionResponse = {
|
||||
storySession: StorySessionPayload;
|
||||
storyEvents: StoryEventPayload[];
|
||||
serverVersion: number;
|
||||
actor: StoryRuntimeActorProjection;
|
||||
inventory: StoryRuntimeInventoryProjection;
|
||||
options: StoryRuntimeOptionProjection[];
|
||||
status: StoryRuntimeStatusProjection;
|
||||
currentNarrativeText?: string | null;
|
||||
actionResultText?: string | null;
|
||||
toast?: string | null;
|
||||
};
|
||||
@@ -2,6 +2,7 @@ export * from './assets/qwenSprite';
|
||||
export * from './contracts/auth';
|
||||
export type * from './contracts/bigFish';
|
||||
export * from './contracts/common';
|
||||
export type * from './contracts/creationAgentDocumentInput';
|
||||
export type * from './contracts/customWorldAgent';
|
||||
export * from './contracts/rpgAgentActions';
|
||||
export * from './contracts/rpgAgentAnchors';
|
||||
@@ -22,6 +23,7 @@ export * from './contracts/rpgRuntimeQuestAssist';
|
||||
export * from './contracts/rpgRuntimeStoryAction';
|
||||
export * from './contracts/rpgRuntimeStoryState';
|
||||
export * from './contracts/runtime';
|
||||
export type * from './contracts/story';
|
||||
export * from './http';
|
||||
export * from './llm/narrativeLanguage';
|
||||
export * from './llm/parsers';
|
||||
|
||||
Reference in New Issue
Block a user