restore: import verified wave3 baseline
This commit is contained in:
+96
-314
@@ -1,349 +1,131 @@
|
||||
// @generated by crates/nana-contracts; do not edit.
|
||||
|
||||
export type ResourceId = string;
|
||||
export type ResourceKind =
|
||||
| "character"
|
||||
| "world_book"
|
||||
| "persona"
|
||||
| "plot_module"
|
||||
| "item_spec";
|
||||
|
||||
export interface ResourceRef {
|
||||
id: ResourceId;
|
||||
kind: ResourceKind;
|
||||
revision: string;
|
||||
content_hash: string;
|
||||
}
|
||||
export type ResourceKind = "character" | "world_book" | "persona" | "plot_module" | "item_spec";
|
||||
|
||||
export interface ResourceHeader {
|
||||
id: ResourceId;
|
||||
kind: ResourceKind;
|
||||
schema_version: number;
|
||||
revision: string;
|
||||
content_hash: string;
|
||||
dependencies: ResourceRef[];
|
||||
}
|
||||
export type ResourceRef = { id: ResourceId, kind: ResourceKind, revision: string, content_hash: string, };
|
||||
|
||||
export type RelationshipDimension =
|
||||
| "affinity"
|
||||
| "trust"
|
||||
| "hope"
|
||||
| "respect"
|
||||
| "intimacy"
|
||||
| "attachment";
|
||||
export type ResourceHeader = { id: ResourceId, kind: ResourceKind, schema_version: number, revision: string, content_hash: string, dependencies: Array<ResourceRef>, };
|
||||
|
||||
export interface RelationshipAxes {
|
||||
affinity: number;
|
||||
trust: number;
|
||||
hope: number;
|
||||
respect: number;
|
||||
intimacy: number;
|
||||
attachment: number;
|
||||
}
|
||||
export type CharacterStyle = { speech: string, mannerisms: Array<string>, forbidden_player_assumptions: Array<string>, };
|
||||
|
||||
export interface RelationshipAdjustment {
|
||||
dimension: RelationshipDimension;
|
||||
delta: number;
|
||||
cause: string;
|
||||
judgment_rule: string | null;
|
||||
}
|
||||
export type CharacterJudgmentRule = { tags: Array<string>, meaning: string, relationship_effects: Array<RelationshipAdjustment>, };
|
||||
|
||||
export interface SkillValue {
|
||||
skill: string;
|
||||
value: number;
|
||||
}
|
||||
export type SkillValue = { skill: string, value: number, };
|
||||
|
||||
export interface CharacterCard {
|
||||
header: ResourceHeader;
|
||||
name: string;
|
||||
identity: string;
|
||||
personality: string[];
|
||||
values: string[];
|
||||
boundaries: string[];
|
||||
style: {
|
||||
speech: string;
|
||||
mannerisms: string[];
|
||||
forbidden_player_assumptions: string[];
|
||||
};
|
||||
initial_relationship: RelationshipAxes;
|
||||
judgment_rules: Array<{
|
||||
tags: string[];
|
||||
meaning: string;
|
||||
relationship_effects: RelationshipAdjustment[];
|
||||
}>;
|
||||
skills: SkillValue[];
|
||||
default_expression: string;
|
||||
}
|
||||
export type CharacterCard = { header: ResourceHeader, name: string, identity: string, personality: Array<string>, values: Array<string>, boundaries: Array<string>, style: CharacterStyle, initial_relationship: RelationshipAxes, judgment_rules: Array<CharacterJudgmentRule>, skills: Array<SkillValue>, default_expression: string, };
|
||||
|
||||
export interface WorldBook {
|
||||
header: ResourceHeader;
|
||||
name: string;
|
||||
entries: Array<{
|
||||
id: string;
|
||||
title: string;
|
||||
content: string;
|
||||
keywords: string[];
|
||||
tags: string[];
|
||||
required_flags: string[];
|
||||
}>;
|
||||
}
|
||||
export type WorldBookEntry = { id: string, title: string, content: string, keywords: Array<string>, tags: Array<string>, required_flags: Array<string>, };
|
||||
|
||||
export interface Persona {
|
||||
header: ResourceHeader;
|
||||
name: string;
|
||||
identity: string;
|
||||
traits: string[];
|
||||
skills: SkillValue[];
|
||||
initial_items: ResourceId[];
|
||||
}
|
||||
export type WorldBook = { header: ResourceHeader, name: string, entries: Array<WorldBookEntry>, };
|
||||
|
||||
export interface PlotModule {
|
||||
header: ResourceHeader;
|
||||
name: string;
|
||||
opening_event: string;
|
||||
events: Array<{
|
||||
id: string;
|
||||
title: string;
|
||||
tags: string[];
|
||||
situation: string[];
|
||||
required_flags: string[];
|
||||
pressures: Array<{
|
||||
id: string;
|
||||
description: string;
|
||||
clock_id: string | null;
|
||||
clock_delta: number | null;
|
||||
}>;
|
||||
outcomes: Array<{
|
||||
id: string;
|
||||
description: string;
|
||||
effects: StateOp[];
|
||||
}>;
|
||||
}>;
|
||||
}
|
||||
export type Persona = { header: ResourceHeader, name: string, identity: string, traits: Array<string>, skills: Array<SkillValue>, initial_items: Array<ResourceId>, };
|
||||
|
||||
export interface ItemSpec {
|
||||
header: ResourceHeader;
|
||||
name: string;
|
||||
description: string;
|
||||
tags: string[];
|
||||
lore_refs: string[];
|
||||
mechanics: {
|
||||
usable: boolean;
|
||||
grants_tags: string[];
|
||||
check_modifier: number | null;
|
||||
};
|
||||
hidden_facts: string[];
|
||||
}
|
||||
export type PlotPressure = { id: string, description: string, clock_id: string | null, clock_delta: number | null, };
|
||||
|
||||
export interface ResourceBundle {
|
||||
id: string;
|
||||
schema_version: number;
|
||||
revision: string;
|
||||
display_name: string;
|
||||
entry_character: ResourceId;
|
||||
entry_persona: ResourceId;
|
||||
entry_plot_module: ResourceId | null;
|
||||
characters: CharacterCard[];
|
||||
world_books: WorldBook[];
|
||||
personas: Persona[];
|
||||
plot_modules: PlotModule[];
|
||||
item_specs: ItemSpec[];
|
||||
}
|
||||
export type PlotOutcome = { id: string, description: string, effects: Array<StateOp>, };
|
||||
|
||||
export type PromiseStatus =
|
||||
| "proposed"
|
||||
| "accepted"
|
||||
| "fulfilled"
|
||||
| "broken"
|
||||
| "released"
|
||||
| "impossible";
|
||||
export type PromiseWeight = "minor" | "major";
|
||||
export type KnowledgeCertainty = "suspected" | "reported" | "confirmed";
|
||||
export type ItemPlacement = "bag" | "worn" | "hand" | "scene" | "hidden";
|
||||
export type AcquisitionMode = "initial" | "found" | "given" | "borrowed" | "stolen" | "returned";
|
||||
export type PlotEvent = { id: string, title: string, tags: Array<string>, situation: Array<string>, required_flags: Array<string>, pressures: Array<PlotPressure>, outcomes: Array<PlotOutcome>, };
|
||||
|
||||
export interface Promise {
|
||||
id: string;
|
||||
promiser: string;
|
||||
promisee: string;
|
||||
content: string;
|
||||
status: PromiseStatus;
|
||||
weight: PromiseWeight;
|
||||
created_at: string;
|
||||
accepted_at: string | null;
|
||||
resolved_at: string | null;
|
||||
}
|
||||
export type PlotModule = { header: ResourceHeader, name: string, opening_event: string, events: Array<PlotEvent>, };
|
||||
|
||||
export interface KnowledgeRecord {
|
||||
id: string;
|
||||
observer: string;
|
||||
subject: string | null;
|
||||
fact: string;
|
||||
certainty: KnowledgeCertainty;
|
||||
source: string;
|
||||
learned_at: string;
|
||||
last_verified_at: string | null;
|
||||
}
|
||||
export type ItemMechanics = { usable: boolean, grants_tags: Array<string>, check_modifier: number | null, };
|
||||
|
||||
export interface ItemInstance {
|
||||
id: string;
|
||||
spec_ref: ResourceId;
|
||||
owner: string;
|
||||
holder: string;
|
||||
placement: ItemPlacement;
|
||||
quantity: number;
|
||||
condition: string;
|
||||
state_tags: string[];
|
||||
acquisition: {
|
||||
mode: AcquisitionMode;
|
||||
from: string | null;
|
||||
at_node: string;
|
||||
};
|
||||
}
|
||||
export type ItemSpec = { header: ResourceHeader, name: string, description: string, tags: Array<string>, lore_refs: Array<string>, mechanics: ItemMechanics, hidden_facts: Array<string>, };
|
||||
|
||||
export interface RuntimeState {
|
||||
story_id: string;
|
||||
current_node: string;
|
||||
current_branch: string;
|
||||
world_flags: Record<string, boolean>;
|
||||
relationships: Record<string, RelationshipAxes>;
|
||||
relationship_states: unknown[];
|
||||
promises: Promise[];
|
||||
knowledge: KnowledgeRecord[];
|
||||
items: ItemInstance[];
|
||||
clocks: unknown[];
|
||||
checks: unknown[];
|
||||
}
|
||||
export type ResourceBundle = { id: string, schema_version: number, revision: string, display_name: string, entry_character: ResourceId, entry_persona: ResourceId, entry_plot_module: ResourceId | null, characters: Array<CharacterCard>, world_books: Array<WorldBook>, personas: Array<Persona>, plot_modules: Array<PlotModule>, item_specs: Array<ItemSpec>, };
|
||||
|
||||
export type StateOp =
|
||||
| { op: "set_world_flag"; key: string; value: boolean }
|
||||
| { op: "adjust_relationship"; from: string; to: string; adjustment: RelationshipAdjustment }
|
||||
| { op: "create_promise"; promise: Promise }
|
||||
| { op: "update_promise"; promise_id: string; status: PromiseStatus; resolved_at: string | null }
|
||||
| { op: "add_knowledge"; record: KnowledgeRecord }
|
||||
| { op: "add_item"; item: ItemInstance }
|
||||
| {
|
||||
op: "transfer_item";
|
||||
item_id: string;
|
||||
from: string;
|
||||
to: string;
|
||||
placement: ItemPlacement;
|
||||
mode: AcquisitionMode;
|
||||
}
|
||||
| { op: "record_check"; check: unknown }
|
||||
| { op: "advance_clock"; clock_id: string; delta: number };
|
||||
export type RelationshipAxes = { affinity: number, trust: number, hope: number, respect: number, intimacy: number, attachment: number, };
|
||||
|
||||
export type BeatKind = "narration" | "dialogue" | "action" | "system";
|
||||
export type RelationshipAdjustment = { dimension: RelationshipDimension, delta: number, cause: string, judgment_rule: string | null, };
|
||||
|
||||
export interface PresentationBeat {
|
||||
id: string;
|
||||
kind: BeatKind;
|
||||
speaker: string | null;
|
||||
text: string;
|
||||
visual: {
|
||||
character: string | null;
|
||||
expression: string | null;
|
||||
pose: string | null;
|
||||
scene: string | null;
|
||||
} | null;
|
||||
}
|
||||
export type RelationshipDimension = "affinity" | "trust" | "hope" | "respect" | "intimacy" | "attachment";
|
||||
|
||||
export type RelationshipBand = "distant" | "guarded" | "warming" | "close" | "bonded";
|
||||
|
||||
export interface RelationshipView {
|
||||
affinity: RelationshipBand;
|
||||
trust: RelationshipBand;
|
||||
hope: RelationshipBand;
|
||||
respect: RelationshipBand;
|
||||
intimacy: RelationshipBand;
|
||||
attachment: RelationshipBand;
|
||||
updatedAtNode: string | null;
|
||||
}
|
||||
export type RelationshipView = { affinity: RelationshipBand, trust: RelationshipBand, hope: RelationshipBand, respect: RelationshipBand, intimacy: RelationshipBand, attachment: RelationshipBand, updatedAtNode: string | null, };
|
||||
|
||||
export interface PlayerView {
|
||||
storyId: string;
|
||||
nodeId: string;
|
||||
branchId: string;
|
||||
sceneId: string;
|
||||
sceneTitle: string;
|
||||
characterName: string;
|
||||
beats: PresentationBeat[];
|
||||
suggestions: Array<{ id: string; label: string; draft: string }>;
|
||||
inventory: Array<{
|
||||
instanceId: string;
|
||||
name: string;
|
||||
description: string;
|
||||
quantity: number;
|
||||
placement: ItemPlacement;
|
||||
condition: string;
|
||||
}>;
|
||||
knowledge: Array<{
|
||||
id: string;
|
||||
title: string;
|
||||
summary: string;
|
||||
certainty: KnowledgeCertainty;
|
||||
}>;
|
||||
promises: Array<{
|
||||
id: string;
|
||||
content: string;
|
||||
status: PromiseStatus;
|
||||
weight: PromiseWeight;
|
||||
}>;
|
||||
relationship: RelationshipView;
|
||||
history: Array<{
|
||||
id: string;
|
||||
parentId: string | null;
|
||||
branchId: string;
|
||||
label: string;
|
||||
isCurrent: boolean;
|
||||
}>;
|
||||
canContinue: boolean;
|
||||
}
|
||||
export type PromiseStatus = "proposed" | "accepted" | "fulfilled" | "broken" | "released" | "impossible";
|
||||
|
||||
export type PromiseWeight = "minor" | "major";
|
||||
|
||||
export type Promise = { id: string, promiser: string, promisee: string, content: string, status: PromiseStatus, weight: PromiseWeight, created_at: string, accepted_at: string | null, resolved_at: string | null, };
|
||||
|
||||
export type RelationshipState = { id: string, tag: string, description: string, source_node: string, active: boolean, };
|
||||
|
||||
export type KnowledgeCertainty = "suspected" | "reported" | "confirmed";
|
||||
|
||||
export type KnowledgeRecord = { id: string, observer: string, subject: string | null, fact: string, certainty: KnowledgeCertainty, source: string, learned_at: string, last_verified_at: string | null, };
|
||||
|
||||
export type ItemPlacement = "bag" | "worn" | "hand" | "scene" | "hidden";
|
||||
|
||||
export type AcquisitionMode = "initial" | "found" | "given" | "borrowed" | "stolen" | "returned";
|
||||
|
||||
export type ItemAcquisition = { mode: AcquisitionMode, from: string | null, at_node: string, };
|
||||
|
||||
export type ItemInstance = { id: string, spec_ref: ResourceId, owner: string, holder: string, placement: ItemPlacement, quantity: number, condition: string, state_tags: Array<string>, acquisition: ItemAcquisition, };
|
||||
|
||||
export type CheckDifficulty = "regular" | "hard" | "extreme";
|
||||
|
||||
export type CheckResult = "critical_success" | "extreme_success" | "hard_success" | "success" | "failure" | "fumble";
|
||||
|
||||
export type CheckRecord = { id: string, action_id: string, actor: string, skill: string, target: number, difficulty: CheckDifficulty, bonus_dice: number, roll: number, result: CheckResult, pushed_from: string | null, node_id: string, };
|
||||
|
||||
export type ClockState = { id: string, label: string, value: number, max: number, };
|
||||
|
||||
export type StoryBinding = { persona: ResourceRef, characters: Array<ResourceRef>, world_books: Array<ResourceRef>, plot_modules: Array<ResourceRef>, };
|
||||
|
||||
export type Story = { id: string, title: string, ruleset: string, bindings: StoryBinding, root_node: string, active_branch: string, };
|
||||
|
||||
export type StateDelta = { ops: Array<StateOp>, };
|
||||
|
||||
export type StateOp = { "op": "set_world_flag", key: string, value: boolean, } | { "op": "adjust_relationship", from: string, to: string, adjustment: RelationshipAdjustment, } | { "op": "create_promise", promise: Promise, } | { "op": "update_promise", promise_id: string, status: PromiseStatus, resolved_at: string | null, } | { "op": "add_knowledge", record: KnowledgeRecord, } | { "op": "add_item", item: ItemInstance, } | { "op": "transfer_item", item_id: string, from: string, to: string, placement: ItemPlacement, mode: AcquisitionMode, } | { "op": "record_check", check: CheckRecord, } | { "op": "advance_clock", clock_id: string, delta: number, };
|
||||
|
||||
export type StoryNode = { id: string, story_id: string, branch_id: string, parent_id: string | null, action_id: string, user_input: string, delta: StateDelta, state_hash: string, scene: PresentationScene, character: PresentationCharacter, beats: Array<PresentationBeat>, suggestions: Array<ActionSuggestion>, can_continue: boolean, };
|
||||
|
||||
export type RuntimeState = { story_id: string, current_node: string, current_branch: string, world_flags: { [key in string]?: boolean }, relationships: { [key in string]?: RelationshipAxes }, relationship_states: Array<RelationshipState>, promises: Array<Promise>, knowledge: Array<KnowledgeRecord>, items: Array<ItemInstance>, clocks: Array<ClockState>, checks: Array<CheckRecord>, };
|
||||
|
||||
export type BeatKind = "narration" | "dialogue" | "action" | "system";
|
||||
|
||||
export type VisualDirective = { character: string | null, expression: string | null, pose: string | null, scene: string | null, };
|
||||
|
||||
export type PresentationBeat = { id: string, kind: BeatKind, speaker: string | null, text: string, visual: VisualDirective | null, };
|
||||
|
||||
export type ActionSuggestion = { id: string, label: string, draft: string, };
|
||||
|
||||
export type PresentationScene = { id: string, title: string, };
|
||||
|
||||
export type PresentationCharacter = { id: string, name: string, expression: string | null, pose: string | null, };
|
||||
|
||||
export type PresentationSnapshot = { scene: PresentationScene, character: PresentationCharacter, beats: Array<PresentationBeat>, suggestions: Array<ActionSuggestion>, can_continue: boolean, };
|
||||
|
||||
export type PlayerItemView = { instanceId: string, name: string, description: string, quantity: number, placement: ItemPlacement, condition: string, };
|
||||
|
||||
export type PlayerKnowledgeView = { id: string, title: string, summary: string, certainty: KnowledgeCertainty, };
|
||||
|
||||
export type PlayerPromiseView = { id: string, content: string, status: PromiseStatus, weight: PromiseWeight, };
|
||||
|
||||
export type HistoryNodeView = { id: string, parentId: string | null, branchId: string, label: string, isCurrent: boolean, };
|
||||
|
||||
export type PlayerView = { storyId: string, nodeId: string, branchId: string, sceneId: string, sceneTitle: string, characterName: string, characterExpression: string | null, characterPose: string | null, beats: Array<PresentationBeat>, suggestions: Array<ActionSuggestion>, inventory: Array<PlayerItemView>, knowledge: Array<PlayerKnowledgeView>, promises: Array<PlayerPromiseView>, relationship: RelationshipView, history: Array<HistoryNodeView>, canContinue: boolean, };
|
||||
|
||||
export type TurnIntent = "speak_or_act" | "continue" | "regenerate" | "push_check";
|
||||
|
||||
export interface TurnRequest {
|
||||
storyId: string;
|
||||
branchId: string;
|
||||
expectedNodeId: string;
|
||||
actionId: string;
|
||||
intent: TurnIntent;
|
||||
input: string;
|
||||
}
|
||||
export type TurnRequest = { storyId: string, branchId: string, expectedNodeId: string, actionId: string, intent: TurnIntent, input: string, };
|
||||
|
||||
export interface TurnResult {
|
||||
committedNodeId: string;
|
||||
playerView: PlayerView;
|
||||
}
|
||||
export type TurnResult = { committedNodeId: string, playerView: PlayerView, };
|
||||
|
||||
export type TurnFailureCode =
|
||||
| "stale_node"
|
||||
| "invalid_input"
|
||||
| "invalid_model_output"
|
||||
| "provider_unavailable"
|
||||
| "cancelled"
|
||||
| "timed_out"
|
||||
| "internal";
|
||||
export type TurnFailureCode = "stale_node" | "invalid_input" | "invalid_model_output" | "provider_unavailable" | "cancelled" | "timed_out" | "internal";
|
||||
|
||||
export interface TurnFailure {
|
||||
code: TurnFailureCode;
|
||||
message: string;
|
||||
retryable: boolean;
|
||||
}
|
||||
export type TurnFailure = { code: TurnFailureCode, message: string, retryable: boolean, };
|
||||
|
||||
export interface AppInfo {
|
||||
name: string;
|
||||
version: string;
|
||||
contractVersion: number;
|
||||
}
|
||||
export type AppInfo = { name: string, version: string, contractVersion: number, };
|
||||
|
||||
export interface DemoPackSummary {
|
||||
id: string;
|
||||
displayName: string;
|
||||
revision: string;
|
||||
characters: number;
|
||||
worldBooks: number;
|
||||
personas: number;
|
||||
plotModules: number;
|
||||
itemSpecs: number;
|
||||
}
|
||||
export type DemoPackSummary = { id: string, displayName: string, revision: string, characters: number, worldBooks: number, personas: number, plotModules: number, itemSpecs: number, };
|
||||
|
||||
export type ValidationCode = "invalid_id" | "invalid_schema_version" | "invalid_revision" | "invalid_content_hash" | "wrong_resource_kind" | "duplicate_resource" | "missing_reference" | "invalid_relationship_value" | "invalid_skill_value";
|
||||
|
||||
export type ValidationIssue = { code: ValidationCode, path: string, message: string, };
|
||||
|
||||
export type ValidationReport = { issues: Array<ValidationIssue>, };
|
||||
|
||||
Reference in New Issue
Block a user