zeus-api-types 1.0.47 → 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,75 @@
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
+ }
1
73
  /**
2
74
  * World container - reduced version without events (for frontend)
3
75
  */
@@ -1,2 +1,5 @@
1
1
  "use strict";
2
+ // ============================================================================
3
+ // AI METADATA TRACKING
4
+ // ============================================================================
2
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.47",
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",