zeus-api-types 1.0.71 → 1.0.72

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.
@@ -182,6 +182,26 @@ export interface DialogContext {
182
182
  last_updated_turn?: number;
183
183
  history: DialogMessage[];
184
184
  }
185
+ export declare const MetadataPromptTargets: {
186
+ readonly narrativeTurn0: number;
187
+ readonly narrative: number;
188
+ readonly narrativeLastTurn: number;
189
+ readonly update: number;
190
+ readonly gameInit: number;
191
+ readonly choiceMetadata: number;
192
+ readonly dialog: number;
193
+ };
194
+ export type MetadataPromptTargetKey = keyof typeof MetadataPromptTargets;
195
+ export type MetadataPromptTargetMask = (typeof MetadataPromptTargets)[MetadataPromptTargetKey];
196
+ export declare const ALL_METADATA_PROMPT_TARGETS: number;
197
+ export declare function hasMetadataPromptTarget(mask: number, target: MetadataPromptTargetMask): boolean;
198
+ export declare function buildMetadataPromptIncludeMask(targets: MetadataPromptTargetKey[]): number;
199
+ export type MetadataCustomDataShapeValue = string | number | boolean;
200
+ export interface MetadataCustomDataShapeEntry {
201
+ promptIncludeMask?: number;
202
+ [key: string]: MetadataCustomDataShapeValue | undefined;
203
+ }
204
+ export type MetadataCustomDataShape = Record<string, MetadataCustomDataShapeEntry>;
185
205
  /**
186
206
  * Metadata for game state
187
207
  * NOTE: genre moved to immutable block (pre-MVP, no backward compatibility)
@@ -203,6 +223,7 @@ export interface Metadata {
203
223
  nextActPrologue?: string;
204
224
  nextActTime?: string;
205
225
  nextActLocation?: string;
226
+ customDataShape?: MetadataCustomDataShape;
206
227
  user?: UserMetadata;
207
228
  [key: string]: unknown;
208
229
  }
@@ -1,7 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ALL_METADATA_PROMPT_TARGETS = exports.MetadataPromptTargets = void 0;
3
4
  exports.computeTimeString = computeTimeString;
4
5
  exports.formatTimeHuman = formatTimeHuman;
6
+ exports.hasMetadataPromptTarget = hasMetadataPromptTarget;
7
+ exports.buildMetadataPromptIncludeMask = buildMetadataPromptIncludeMask;
5
8
  /**
6
9
  * Derives the canonical time string from scalar time fields.
7
10
  * Use this everywhere instead of reading time.current, which may be stale.
@@ -22,3 +25,20 @@ function formatTimeHuman(time) {
22
25
  const minute = time.minute.toString().padStart(2, '0');
23
26
  return `Day ${time.day}, ${hour12}:${minute}${period}`;
24
27
  }
28
+ exports.MetadataPromptTargets = {
29
+ narrativeTurn0: 1 << 0,
30
+ narrative: 1 << 1,
31
+ narrativeLastTurn: 1 << 2,
32
+ update: 1 << 3,
33
+ gameInit: 1 << 4,
34
+ choiceMetadata: 1 << 5,
35
+ dialog: 1 << 6,
36
+ };
37
+ exports.ALL_METADATA_PROMPT_TARGETS = Object.values(exports.MetadataPromptTargets)
38
+ .reduce((mask, target) => mask | target, 0);
39
+ function hasMetadataPromptTarget(mask, target) {
40
+ return (mask & target) === target;
41
+ }
42
+ function buildMetadataPromptIncludeMask(targets) {
43
+ return targets.reduce((mask, target) => mask | exports.MetadataPromptTargets[target], 0);
44
+ }
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, formatTimeHuman } from './game-state';
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';
6
+ export { ALL_METADATA_PROMPT_TARGETS, buildMetadataPromptIncludeMask, computeTimeString, formatTimeHuman, hasMetadataPromptTarget, MetadataPromptTargets } from './game-state';
7
+ export type { BaseImmutableState, DialogContext, DialogMessage, GameMetadata, GameState, GameStateReduced, GenreImmutableState, HistoryEntry, ImmutableState, Location, Metadata, MetadataCustomDataShape, MetadataCustomDataShapeEntry, MetadataCustomDataShapeValue, MetadataPromptTargetKey, MetadataPromptTargetMask, 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,7 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.formatTimeHuman = exports.computeTimeString = void 0;
3
+ exports.MetadataPromptTargets = exports.hasMetadataPromptTarget = exports.formatTimeHuman = exports.computeTimeString = exports.buildMetadataPromptIncludeMask = exports.ALL_METADATA_PROMPT_TARGETS = void 0;
4
4
  // Game State Utilities (value exports — not type-only)
5
5
  var game_state_1 = require("./game-state");
6
+ Object.defineProperty(exports, "ALL_METADATA_PROMPT_TARGETS", { enumerable: true, get: function () { return game_state_1.ALL_METADATA_PROMPT_TARGETS; } });
7
+ Object.defineProperty(exports, "buildMetadataPromptIncludeMask", { enumerable: true, get: function () { return game_state_1.buildMetadataPromptIncludeMask; } });
6
8
  Object.defineProperty(exports, "computeTimeString", { enumerable: true, get: function () { return game_state_1.computeTimeString; } });
7
9
  Object.defineProperty(exports, "formatTimeHuman", { enumerable: true, get: function () { return game_state_1.formatTimeHuman; } });
10
+ Object.defineProperty(exports, "hasMetadataPromptTarget", { enumerable: true, get: function () { return game_state_1.hasMetadataPromptTarget; } });
11
+ Object.defineProperty(exports, "MetadataPromptTargets", { enumerable: true, get: function () { return game_state_1.MetadataPromptTargets; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zeus-api-types",
3
- "version": "1.0.71",
3
+ "version": "1.0.72",
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",