zeus-api-types 1.0.67 → 1.0.71

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.
@@ -72,6 +72,12 @@ export interface TimeState {
72
72
  * @example computeTimeString({ day: 1, hour: 10, minute: 38 }) === 'day_1_10:38'
73
73
  */
74
74
  export declare function computeTimeString(time: Pick<TimeState, 'day' | 'hour' | 'minute'>): string;
75
+ /**
76
+ * Formats time into a human-readable string for AI prompt ingestion.
77
+ * @example formatTimeHuman({ day: 1, hour: 15, minute: 11 }) === 'Day 1, 3:11pm'
78
+ * @example formatTimeHuman({ day: 3, hour: 0, minute: 5 }) === 'Day 3, 12:05am'
79
+ */
80
+ export declare function formatTimeHuman(time: Pick<TimeState, 'day' | 'hour' | 'minute'>): string;
75
81
  /**
76
82
  * Base interface for world entities (NPCs, Locations, etc.)
77
83
  * All world entities share this common structure
@@ -183,6 +189,7 @@ export interface DialogContext {
183
189
  export interface Metadata {
184
190
  genreTitle?: string;
185
191
  expectedTurns: number;
192
+ wordCount?: number;
186
193
  storyArcCutoff: number;
187
194
  storyArcProgression?: number;
188
195
  version?: string;
@@ -213,7 +220,7 @@ export interface GameState {
213
220
  }
214
221
  export interface GameStateReduced {
215
222
  currentTurn: number;
216
- time: TimeState;
223
+ time: string;
217
224
  location: string;
218
225
  player: Player;
219
226
  world: WorldReduced;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.computeTimeString = computeTimeString;
4
+ exports.formatTimeHuman = formatTimeHuman;
4
5
  /**
5
6
  * Derives the canonical time string from scalar time fields.
6
7
  * Use this everywhere instead of reading time.current, which may be stale.
@@ -9,3 +10,15 @@ exports.computeTimeString = computeTimeString;
9
10
  function computeTimeString(time) {
10
11
  return `day_${time.day}_${time.hour.toString().padStart(2, '0')}:${time.minute.toString().padStart(2, '0')}`;
11
12
  }
13
+ /**
14
+ * Formats time into a human-readable string for AI prompt ingestion.
15
+ * @example formatTimeHuman({ day: 1, hour: 15, minute: 11 }) === 'Day 1, 3:11pm'
16
+ * @example formatTimeHuman({ day: 3, hour: 0, minute: 5 }) === 'Day 3, 12:05am'
17
+ */
18
+ function formatTimeHuman(time) {
19
+ const h = time.hour;
20
+ const period = h < 12 ? 'am' : 'pm';
21
+ const hour12 = h % 12 === 0 ? 12 : h % 12;
22
+ const minute = time.minute.toString().padStart(2, '0');
23
+ return `Day ${time.day}, ${hour12}:${minute}${period}`;
24
+ }
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export type { DoneEventPayload, ErrorEventPayload, MetadataEventPayload, Narrati
3
3
  export type { AIMetadata, AIOperationTokens, AIOperationType } from './ai';
4
4
  export type { BaseDeckCard, DeckDefinition, FixtureSet, MultiDeckDefinition, NarrativeStyleCard, StoryArc, StoryArcCard } from './deck';
5
5
  export type { BaseEvent, DeterministicEvent, EventHistoryEntry, EventPropagation, ProbabilisticEvent, ScheduledEvent, WorldEvents } from './events';
6
- export { computeTimeString } from './game-state';
6
+ export { computeTimeString, formatTimeHuman } from './game-state';
7
7
  export type { BaseImmutableState, DialogContext, DialogMessage, GameMetadata, GameState, GameStateReduced, GenreImmutableState, HistoryEntry, ImmutableState, Location, Metadata, NPC, NpcExistingOrNewOp, Player, PresentationCache, PresentationChoiceMeta, PromptVariables, Session, StateSnapshot, Tag, TimeState, World, WorldEntity, WorldReduced } from './game-state';
8
8
  export type { AIPreferences, ModelEntry, ModelStack, ModelStackPreferences, ModelStackPreset, NarrativeFontPreferences, SoundPreferences, SystemModelPresets, UserMetadata, UserPreferences } from './user-preferences';
9
9
  export type { CreatePresetRequest, CreatePresetResponse, DeletePresetResponse, ListPresetsResponse, PaginatedPresetsResponse, PaginationMetadata, PresetIndex, PresetMetadata, UpdatePresetRequest, UpdatePresetResponse } from './preset';
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.computeTimeString = void 0;
3
+ exports.formatTimeHuman = exports.computeTimeString = void 0;
4
4
  // Game State Utilities (value exports — not type-only)
5
5
  var game_state_1 = require("./game-state");
6
6
  Object.defineProperty(exports, "computeTimeString", { enumerable: true, get: function () { return game_state_1.computeTimeString; } });
7
+ Object.defineProperty(exports, "formatTimeHuman", { enumerable: true, get: function () { return game_state_1.formatTimeHuman; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zeus-api-types",
3
- "version": "1.0.67",
3
+ "version": "1.0.71",
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",