zeus-api-types 1.0.45 → 1.0.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,82 @@
1
+ export interface AIOperationTokens {
2
+ prompt_tokens: number;
3
+ completion_tokens: number;
4
+ total_tokens: number;
5
+ count: number;
6
+ }
7
+ export interface AIMetadata {
8
+ tokensUsed: {
9
+ total: {
10
+ prompt_tokens: number;
11
+ completion_tokens: number;
12
+ total_tokens: number;
13
+ };
14
+ byOperation: {
15
+ narrative?: AIOperationTokens;
16
+ dialog?: AIOperationTokens;
17
+ updateScript?: AIOperationTokens;
18
+ choiceMetadata?: AIOperationTokens;
19
+ gameInit?: AIOperationTokens;
20
+ genreInit?: AIOperationTokens;
21
+ };
22
+ };
23
+ modelsUsed: string[];
24
+ operationCount: number;
25
+ operationsByType: Record<string, number>;
26
+ firstOperationAt?: string;
27
+ lastOperationAt?: string;
28
+ }
29
+ /**
30
+ * Tag structure for both system-level and author-defined metadata
31
+ * - System tags (in immutable): managed by backend, hidden from UI
32
+ * - Author tags (in metadata): user-editable via genre editor
33
+ */
34
+ export interface Tag {
35
+ /** Unique key identifier (max 64 chars) */
36
+ key: string;
37
+ /** Value as string or array of strings (max 64 chars per item) */
38
+ value: string | string[];
39
+ }
40
+ /**
41
+ * Base interface for all immutable blocks
42
+ */
43
+ export interface BaseImmutableState {
44
+ id: string;
45
+ hash?: string;
46
+ }
47
+ /**
48
+ * Game-specific immutable state
49
+ */
50
+ export interface ImmutableState extends BaseImmutableState {
51
+ userId: string;
52
+ genre: string;
53
+ author: string;
54
+ ai?: {
55
+ metadata: AIMetadata;
56
+ };
57
+ act?: number;
58
+ sagaId?: string;
59
+ previousActId?: string;
60
+ nextActId?: string;
61
+ [key: string]: unknown;
62
+ }
63
+ /**
64
+ * Genre-specific immutable state (for genre authoring)
65
+ */
66
+ export interface GenreImmutableState extends BaseImmutableState {
67
+ genre: string;
68
+ author: string;
69
+ published: boolean;
70
+ createdAt: string;
71
+ tags?: Tag[];
72
+ }
73
+ /**
74
+ * World container - reduced version without events (for frontend)
75
+ */
76
+ export interface WorldReduced {
77
+ locations: Record<string, Location>;
78
+ npcs: Record<string, NPC>;
79
+ }
1
80
  /**
2
81
  * Game State Types
3
82
  *
@@ -63,13 +142,6 @@ export interface Location extends WorldEntity {
63
142
  name: string;
64
143
  description: string;
65
144
  }
66
- /**
67
- * World container - reduced version without events (for frontend)
68
- */
69
- export interface WorldReduced {
70
- locations: Record<string, Location>;
71
- npcs: Record<string, NPC>;
72
- }
73
145
  export interface DialogMessage {
74
146
  speaker: string;
75
147
  message: string;
@@ -89,6 +161,7 @@ export interface HistoryEntry {
89
161
  meta?: unknown;
90
162
  };
91
163
  charactersPresent?: NpcExistingOrNewOp[];
164
+ dialogHistory?: DialogMessage[];
92
165
  }
93
166
  export interface PresentationCache {
94
167
  turn: number;
@@ -1,8 +1,5 @@
1
1
  "use strict";
2
- /**
3
- * Game State Types
4
- *
5
- * Core game state interfaces shared between middle-layer and frontend.
6
- * Extracted from middle-layer/src/core/GameState.ts
7
- */
2
+ // ============================================================================
3
+ // AI METADATA TRACKING
4
+ // ============================================================================
8
5
  Object.defineProperty(exports, "__esModule", { value: true });
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  export type { ApiError, ApiErrorResponse } from './errors';
2
2
  export type { NarrativeStartEventPayload, NarrativeChunkEventPayload, NarrativeCompleteEventPayload, NarrativeMetadataEventPayload, MetadataEventPayload, DoneEventPayload, ErrorEventPayload, NarrativeSSEEventPayload, } from './sse/narrative';
3
- export type { TimeState, WorldEntity, Player, NPC, Location, WorldReduced, DialogMessage, HistoryEntry, PresentationCache, Session, StoryArc, } from './game-state';
3
+ export type { TimeState, WorldEntity, Player, NPC, Location, WorldReduced, DialogMessage, HistoryEntry, PresentationCache, Session, StoryArc, AIOperationTokens, AIMetadata, Tag, BaseImmutableState, ImmutableState, GenreImmutableState, } from './game-state';
4
4
  export type { NarrativeFontPreferences, SoundPreferences, ModelStackPreset, ModelEntry, ModelStack, ModelStackPreferences, SystemModelPresets, AIPreferences, UserPreferences, UserMetadata, } from './user-preferences';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zeus-api-types",
3
- "version": "1.0.45",
3
+ "version": "1.0.48",
4
4
  "description": "Shared API types for Wagtales - SSE payloads, error types, and common interfaces",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  "build": "tsc",
21
21
  "clean": "rimraf dist",
22
22
  "prepublishOnly": "npm run build",
23
- "publish": "npm version patch && npm publish"
23
+ "release": "npm version patch && npm publish"
24
24
  },
25
25
  "keywords": [
26
26
  "wagtales",