@patterkit/model 0.1.2 → 0.2.1

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.
package/dist/index.cjs CHANGED
@@ -20,12 +20,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ COMMON_GENDERS: () => COMMON_GENDERS,
23
24
  DEFAULT_CAPTION_CHARACTER: () => DEFAULT_CAPTION_CHARACTER,
24
25
  DEFAULT_CAPTION_DELIMITERS: () => DEFAULT_CAPTION_DELIMITERS,
25
26
  DEFAULT_DOCUMENTATION_CLASSES: () => DEFAULT_DOCUMENTATION_CLASSES,
26
27
  DEFAULT_RECORDING_STATUSES: () => DEFAULT_RECORDING_STATUSES,
27
28
  DEFAULT_WRITING_STATUSES: () => DEFAULT_WRITING_STATUSES,
28
29
  PROJECT_LOCALE_SCENE: () => PROJECT_LOCALE_SCENE,
30
+ RERECORD_STATUS: () => RERECORD_STATUS,
31
+ RERECORD_STATUS_DECL: () => RERECORD_STATUS_DECL,
29
32
  castStringKey: () => castStringKey,
30
33
  deriveRecordingFolders: () => deriveRecordingFolders,
31
34
  effectiveGameId: () => effectiveGameId,
@@ -59,6 +62,7 @@ function effectiveGameId(entity) {
59
62
  const g = entity.gameId?.trim();
60
63
  return g ? g : gameIdify(entity.name);
61
64
  }
65
+ var COMMON_GENDERS = ["male", "female", "neuter"];
62
66
  var DEFAULT_WRITING_STATUSES = [
63
67
  { name: "stub", colour: 0 },
64
68
  // red
@@ -81,6 +85,8 @@ var DEFAULT_RECORDING_STATUSES = [
81
85
  { name: "final", colour: 9 }
82
86
  // purple
83
87
  ];
88
+ var RERECORD_STATUS = "rerecord";
89
+ var RERECORD_STATUS_DECL = { name: RERECORD_STATUS, colour: 1 };
84
90
  function deriveRecordingFolders(audioRoot, statuses) {
85
91
  const root = audioRoot?.trim();
86
92
  return statuses.map((s, i) => {
@@ -104,12 +110,15 @@ var DEFAULT_CAPTION_DELIMITERS = { open: "[", close: "]" };
104
110
  var DEFAULT_CAPTION_CHARACTER = "SFX";
105
111
  // Annotate the CommonJS export names for ESM import in node:
106
112
  0 && (module.exports = {
113
+ COMMON_GENDERS,
107
114
  DEFAULT_CAPTION_CHARACTER,
108
115
  DEFAULT_CAPTION_DELIMITERS,
109
116
  DEFAULT_DOCUMENTATION_CLASSES,
110
117
  DEFAULT_RECORDING_STATUSES,
111
118
  DEFAULT_WRITING_STATUSES,
112
119
  PROJECT_LOCALE_SCENE,
120
+ RERECORD_STATUS,
121
+ RERECORD_STATUS_DECL,
113
122
  castStringKey,
114
123
  deriveRecordingFolders,
115
124
  effectiveGameId,
package/dist/index.d.cts CHANGED
@@ -293,11 +293,25 @@ interface CoverageDriver {
293
293
  /** The pool the harness picks from (uniform). Empty = the driver is inert. */
294
294
  values: ScalarValue[];
295
295
  }
296
+ /** A character's grammatical gender, for localisation. Translators need it to inflect the speaker's own
297
+ * lines in gendered languages (adjectives, participles, pronouns), which the source text alone often
298
+ * cannot tell them. Absent means "not specified". Authoring-only: it never reaches the runtime bundle,
299
+ * but it IS carried into the localisation handoff formats as translator context (spec §14).
300
+ *
301
+ * Free text, not a closed set: real languages need more than three genders (common/utrum, animate/
302
+ * inanimate, and so on) and translators name them differently. `COMMON_GENDERS` seeds the editor's
303
+ * auto-suggest so the everyday values stay spelled consistently; anything else is still valid. */
304
+ type GrammaticalGender = string;
305
+ /** The everyday grammatical genders the Cast editor offers as auto-suggest defaults. Not exhaustive and
306
+ * not enforced - a project may use any string (see `GrammaticalGender`). */
307
+ declare const COMMON_GENDERS: readonly ["male", "female", "neuter"];
296
308
  interface CastMember {
297
309
  /** Canonical speaker name (matched by a beat's `character`); language-neutral key. */
298
310
  name: string;
299
311
  /** Localised player-facing name - a localisation id (project-level strings). */
300
312
  displayName?: string;
313
+ /** Grammatical gender for translators (see `GrammaticalGender`); absent = not specified. */
314
+ gender?: GrammaticalGender;
301
315
  /** Free-text production notes about the character (casting, voice, intent) - authoring only. */
302
316
  notes?: string;
303
317
  /** The voice actor cast for this character, if known - surfaced in the VO script export (spec §16).
@@ -305,6 +319,12 @@ interface CastMember {
305
319
  actor?: string;
306
320
  gameData?: GameData;
307
321
  }
322
+ /** The cast as it reaches a compiled bundle: the player-facing fields only. `notes`, `actor` and
323
+ * `gender` are authoring / production / translation context, and the compiler drops them, so a shipped
324
+ * game never carries a real person's name or a writer's private notes. The compiler copies the shipping
325
+ * fields across explicitly (an allow-list), which is what actually keeps a new authoring field out of
326
+ * the bundle; this type states the resulting contract for anyone reading a bundle. */
327
+ type BundleCastMember = Omit<CastMember, "notes" | "actor" | "gender">;
308
328
  /** A node TYPE that can carry author-defined gameData fields (the gameData schema, project-level).
309
329
  * Beat kinds map straight through: dialogue = `line`, narration = `text`, game event = `gameEvent`. */
310
330
  type GameDataNodeKind = "scene" | "block" | "snippet" | "line" | "text" | "gameEvent";
@@ -357,6 +377,13 @@ interface RecordingStatusDecl {
357
377
  /** The default recording-status ladder (used when a project declares none). The FIRST rung is the
358
378
  * level-0 / absence status: a beat with no recorded status counts as `missing`. */
359
379
  declare const DEFAULT_RECORDING_STATUSES: RecordingStatusDecl[];
380
+ /** The reserved recording status a line takes when it is flagged **needs re-record** (#227): a recorded
381
+ * take exists but is unusable (bad quality, wrong take), so it must be redone. It is NOT a ladder rung -
382
+ * it is a regression flag that MASKS the derived / manual rung for the recording script, the production
383
+ * report, and status browse, so a line "recorded" on disk still shows up as work to do. Reserved so it
384
+ * can't collide with an author-declared rung; carries its own alert colour. */
385
+ declare const RERECORD_STATUS = "rerecord";
386
+ declare const RERECORD_STATUS_DECL: RecordingStatusDecl;
360
387
  /** One recording rung mapped to the folder its audio files live in (Audio Folders mode). */
361
388
  interface RecordingFolder {
362
389
  name: string;
@@ -663,6 +690,14 @@ interface AuthoringFile {
663
690
  * it as a separate "cut: N" figure so a removal is visible, not vanished.
664
691
  */
665
692
  cut?: Record<string, boolean>;
693
+ /**
694
+ * **Needs re-record** (#227): dialogue-line ids whose recorded take is unusable and must be redone
695
+ * (bad quality, wrong take, misread). Orthogonal to the recording ladder - a flagged line keeps its
696
+ * audio on disk, but its recording status is MASKED to the reserved `rerecord` status for the recording
697
+ * script / report / status browse (see `RERECORD_STATUS`), so a "recorded" line still reads as work.
698
+ * Authoring-only; never compiled into a bundle.
699
+ */
700
+ rerecord?: Record<string, boolean>;
666
701
  }
667
702
  /** A compiled expression envelope: canonical source + pre-derived tagged-tuple AST. */
668
703
  interface Expression {
@@ -748,7 +783,8 @@ interface Bundle {
748
783
  default: string;
749
784
  included: string[];
750
785
  };
751
- cast?: CastMember[];
786
+ /** Player-facing cast only: the compiler strips notes / actor / gender (see `BundleCastMember`). */
787
+ cast?: BundleCastMember[];
752
788
  properties?: PropertyDecl[];
753
789
  /** Host / world scope declarations, baked from the project so the runtime can self-back a declared
754
790
  * scope (`@world`, ...) when no host resolver claims its token. Absent = no host scopes. */
@@ -790,4 +826,4 @@ declare const DEFAULT_CAPTION_DELIMITERS: CaptionDelimiters;
790
826
  * captions are off). Applies even to a project that pins no `closedCaptions`. */
791
827
  declare const DEFAULT_CAPTION_CHARACTER = "SFX";
792
828
 
793
- export { type AuthoringFile, type Beat, type Block, type Bundle, type CaptionDelimiters, type CastMember, type Comment, type CommentMessage, type CommentRange, type CompiledBlock, type CompiledEffect, type CompiledGroup, type CompiledScene, type CompiledSnippet, type CoverageDriver, DEFAULT_CAPTION_CHARACTER, DEFAULT_CAPTION_DELIMITERS, DEFAULT_DOCUMENTATION_CLASSES, DEFAULT_RECORDING_STATUSES, DEFAULT_WRITING_STATUSES, type DocLine, type DocumentationClass, type EditRecord, type Effect, type EstimatingConfig, type Expression, type FlowFile, type FlowNode, type GameData, type GameDataField, type GameDataFieldType, type GameDataFields, type GameDataNodeKind, type GameEventBeat, type Group, type HostScopeDecl, type HostScopeRegistry, type HostScopeSpec, type Jump, type JumpTarget, type LineBeat, type LocaleFile, PROJECT_LOCALE_SCENE, type ProjectDictionary, type ProjectFile, type PromptBeat, type PropertyDecl, type PropertyType, type RecordingFolder, type RecordingStatusDecl, type ScalarValue, type Scene, type Selector, type SelectorExhaust, type SelectorOrder, type SequenceOptions, type Snippet, type Suggestion, type TextBeat, type VcsKind, type WritingStatusDecl, castStringKey, deriveRecordingFolders, effectiveGameId, gameIdify, isContentlessBeat, isValidGameId, walkNodes };
829
+ export { type AuthoringFile, type Beat, type Block, type Bundle, type BundleCastMember, COMMON_GENDERS, type CaptionDelimiters, type CastMember, type Comment, type CommentMessage, type CommentRange, type CompiledBlock, type CompiledEffect, type CompiledGroup, type CompiledScene, type CompiledSnippet, type CoverageDriver, DEFAULT_CAPTION_CHARACTER, DEFAULT_CAPTION_DELIMITERS, DEFAULT_DOCUMENTATION_CLASSES, DEFAULT_RECORDING_STATUSES, DEFAULT_WRITING_STATUSES, type DocLine, type DocumentationClass, type EditRecord, type Effect, type EstimatingConfig, type Expression, type FlowFile, type FlowNode, type GameData, type GameDataField, type GameDataFieldType, type GameDataFields, type GameDataNodeKind, type GameEventBeat, type GrammaticalGender, type Group, type HostScopeDecl, type HostScopeRegistry, type HostScopeSpec, type Jump, type JumpTarget, type LineBeat, type LocaleFile, PROJECT_LOCALE_SCENE, type ProjectDictionary, type ProjectFile, type PromptBeat, type PropertyDecl, type PropertyType, RERECORD_STATUS, RERECORD_STATUS_DECL, type RecordingFolder, type RecordingStatusDecl, type ScalarValue, type Scene, type Selector, type SelectorExhaust, type SelectorOrder, type SequenceOptions, type Snippet, type Suggestion, type TextBeat, type VcsKind, type WritingStatusDecl, castStringKey, deriveRecordingFolders, effectiveGameId, gameIdify, isContentlessBeat, isValidGameId, walkNodes };
package/dist/index.d.ts CHANGED
@@ -293,11 +293,25 @@ interface CoverageDriver {
293
293
  /** The pool the harness picks from (uniform). Empty = the driver is inert. */
294
294
  values: ScalarValue[];
295
295
  }
296
+ /** A character's grammatical gender, for localisation. Translators need it to inflect the speaker's own
297
+ * lines in gendered languages (adjectives, participles, pronouns), which the source text alone often
298
+ * cannot tell them. Absent means "not specified". Authoring-only: it never reaches the runtime bundle,
299
+ * but it IS carried into the localisation handoff formats as translator context (spec §14).
300
+ *
301
+ * Free text, not a closed set: real languages need more than three genders (common/utrum, animate/
302
+ * inanimate, and so on) and translators name them differently. `COMMON_GENDERS` seeds the editor's
303
+ * auto-suggest so the everyday values stay spelled consistently; anything else is still valid. */
304
+ type GrammaticalGender = string;
305
+ /** The everyday grammatical genders the Cast editor offers as auto-suggest defaults. Not exhaustive and
306
+ * not enforced - a project may use any string (see `GrammaticalGender`). */
307
+ declare const COMMON_GENDERS: readonly ["male", "female", "neuter"];
296
308
  interface CastMember {
297
309
  /** Canonical speaker name (matched by a beat's `character`); language-neutral key. */
298
310
  name: string;
299
311
  /** Localised player-facing name - a localisation id (project-level strings). */
300
312
  displayName?: string;
313
+ /** Grammatical gender for translators (see `GrammaticalGender`); absent = not specified. */
314
+ gender?: GrammaticalGender;
301
315
  /** Free-text production notes about the character (casting, voice, intent) - authoring only. */
302
316
  notes?: string;
303
317
  /** The voice actor cast for this character, if known - surfaced in the VO script export (spec §16).
@@ -305,6 +319,12 @@ interface CastMember {
305
319
  actor?: string;
306
320
  gameData?: GameData;
307
321
  }
322
+ /** The cast as it reaches a compiled bundle: the player-facing fields only. `notes`, `actor` and
323
+ * `gender` are authoring / production / translation context, and the compiler drops them, so a shipped
324
+ * game never carries a real person's name or a writer's private notes. The compiler copies the shipping
325
+ * fields across explicitly (an allow-list), which is what actually keeps a new authoring field out of
326
+ * the bundle; this type states the resulting contract for anyone reading a bundle. */
327
+ type BundleCastMember = Omit<CastMember, "notes" | "actor" | "gender">;
308
328
  /** A node TYPE that can carry author-defined gameData fields (the gameData schema, project-level).
309
329
  * Beat kinds map straight through: dialogue = `line`, narration = `text`, game event = `gameEvent`. */
310
330
  type GameDataNodeKind = "scene" | "block" | "snippet" | "line" | "text" | "gameEvent";
@@ -357,6 +377,13 @@ interface RecordingStatusDecl {
357
377
  /** The default recording-status ladder (used when a project declares none). The FIRST rung is the
358
378
  * level-0 / absence status: a beat with no recorded status counts as `missing`. */
359
379
  declare const DEFAULT_RECORDING_STATUSES: RecordingStatusDecl[];
380
+ /** The reserved recording status a line takes when it is flagged **needs re-record** (#227): a recorded
381
+ * take exists but is unusable (bad quality, wrong take), so it must be redone. It is NOT a ladder rung -
382
+ * it is a regression flag that MASKS the derived / manual rung for the recording script, the production
383
+ * report, and status browse, so a line "recorded" on disk still shows up as work to do. Reserved so it
384
+ * can't collide with an author-declared rung; carries its own alert colour. */
385
+ declare const RERECORD_STATUS = "rerecord";
386
+ declare const RERECORD_STATUS_DECL: RecordingStatusDecl;
360
387
  /** One recording rung mapped to the folder its audio files live in (Audio Folders mode). */
361
388
  interface RecordingFolder {
362
389
  name: string;
@@ -663,6 +690,14 @@ interface AuthoringFile {
663
690
  * it as a separate "cut: N" figure so a removal is visible, not vanished.
664
691
  */
665
692
  cut?: Record<string, boolean>;
693
+ /**
694
+ * **Needs re-record** (#227): dialogue-line ids whose recorded take is unusable and must be redone
695
+ * (bad quality, wrong take, misread). Orthogonal to the recording ladder - a flagged line keeps its
696
+ * audio on disk, but its recording status is MASKED to the reserved `rerecord` status for the recording
697
+ * script / report / status browse (see `RERECORD_STATUS`), so a "recorded" line still reads as work.
698
+ * Authoring-only; never compiled into a bundle.
699
+ */
700
+ rerecord?: Record<string, boolean>;
666
701
  }
667
702
  /** A compiled expression envelope: canonical source + pre-derived tagged-tuple AST. */
668
703
  interface Expression {
@@ -748,7 +783,8 @@ interface Bundle {
748
783
  default: string;
749
784
  included: string[];
750
785
  };
751
- cast?: CastMember[];
786
+ /** Player-facing cast only: the compiler strips notes / actor / gender (see `BundleCastMember`). */
787
+ cast?: BundleCastMember[];
752
788
  properties?: PropertyDecl[];
753
789
  /** Host / world scope declarations, baked from the project so the runtime can self-back a declared
754
790
  * scope (`@world`, ...) when no host resolver claims its token. Absent = no host scopes. */
@@ -790,4 +826,4 @@ declare const DEFAULT_CAPTION_DELIMITERS: CaptionDelimiters;
790
826
  * captions are off). Applies even to a project that pins no `closedCaptions`. */
791
827
  declare const DEFAULT_CAPTION_CHARACTER = "SFX";
792
828
 
793
- export { type AuthoringFile, type Beat, type Block, type Bundle, type CaptionDelimiters, type CastMember, type Comment, type CommentMessage, type CommentRange, type CompiledBlock, type CompiledEffect, type CompiledGroup, type CompiledScene, type CompiledSnippet, type CoverageDriver, DEFAULT_CAPTION_CHARACTER, DEFAULT_CAPTION_DELIMITERS, DEFAULT_DOCUMENTATION_CLASSES, DEFAULT_RECORDING_STATUSES, DEFAULT_WRITING_STATUSES, type DocLine, type DocumentationClass, type EditRecord, type Effect, type EstimatingConfig, type Expression, type FlowFile, type FlowNode, type GameData, type GameDataField, type GameDataFieldType, type GameDataFields, type GameDataNodeKind, type GameEventBeat, type Group, type HostScopeDecl, type HostScopeRegistry, type HostScopeSpec, type Jump, type JumpTarget, type LineBeat, type LocaleFile, PROJECT_LOCALE_SCENE, type ProjectDictionary, type ProjectFile, type PromptBeat, type PropertyDecl, type PropertyType, type RecordingFolder, type RecordingStatusDecl, type ScalarValue, type Scene, type Selector, type SelectorExhaust, type SelectorOrder, type SequenceOptions, type Snippet, type Suggestion, type TextBeat, type VcsKind, type WritingStatusDecl, castStringKey, deriveRecordingFolders, effectiveGameId, gameIdify, isContentlessBeat, isValidGameId, walkNodes };
829
+ export { type AuthoringFile, type Beat, type Block, type Bundle, type BundleCastMember, COMMON_GENDERS, type CaptionDelimiters, type CastMember, type Comment, type CommentMessage, type CommentRange, type CompiledBlock, type CompiledEffect, type CompiledGroup, type CompiledScene, type CompiledSnippet, type CoverageDriver, DEFAULT_CAPTION_CHARACTER, DEFAULT_CAPTION_DELIMITERS, DEFAULT_DOCUMENTATION_CLASSES, DEFAULT_RECORDING_STATUSES, DEFAULT_WRITING_STATUSES, type DocLine, type DocumentationClass, type EditRecord, type Effect, type EstimatingConfig, type Expression, type FlowFile, type FlowNode, type GameData, type GameDataField, type GameDataFieldType, type GameDataFields, type GameDataNodeKind, type GameEventBeat, type GrammaticalGender, type Group, type HostScopeDecl, type HostScopeRegistry, type HostScopeSpec, type Jump, type JumpTarget, type LineBeat, type LocaleFile, PROJECT_LOCALE_SCENE, type ProjectDictionary, type ProjectFile, type PromptBeat, type PropertyDecl, type PropertyType, RERECORD_STATUS, RERECORD_STATUS_DECL, type RecordingFolder, type RecordingStatusDecl, type ScalarValue, type Scene, type Selector, type SelectorExhaust, type SelectorOrder, type SequenceOptions, type Snippet, type Suggestion, type TextBeat, type VcsKind, type WritingStatusDecl, castStringKey, deriveRecordingFolders, effectiveGameId, gameIdify, isContentlessBeat, isValidGameId, walkNodes };
package/dist/index.js CHANGED
@@ -23,6 +23,7 @@ function effectiveGameId(entity) {
23
23
  const g = entity.gameId?.trim();
24
24
  return g ? g : gameIdify(entity.name);
25
25
  }
26
+ var COMMON_GENDERS = ["male", "female", "neuter"];
26
27
  var DEFAULT_WRITING_STATUSES = [
27
28
  { name: "stub", colour: 0 },
28
29
  // red
@@ -45,6 +46,8 @@ var DEFAULT_RECORDING_STATUSES = [
45
46
  { name: "final", colour: 9 }
46
47
  // purple
47
48
  ];
49
+ var RERECORD_STATUS = "rerecord";
50
+ var RERECORD_STATUS_DECL = { name: RERECORD_STATUS, colour: 1 };
48
51
  function deriveRecordingFolders(audioRoot, statuses) {
49
52
  const root = audioRoot?.trim();
50
53
  return statuses.map((s, i) => {
@@ -67,12 +70,15 @@ function castStringKey(name) {
67
70
  var DEFAULT_CAPTION_DELIMITERS = { open: "[", close: "]" };
68
71
  var DEFAULT_CAPTION_CHARACTER = "SFX";
69
72
  export {
73
+ COMMON_GENDERS,
70
74
  DEFAULT_CAPTION_CHARACTER,
71
75
  DEFAULT_CAPTION_DELIMITERS,
72
76
  DEFAULT_DOCUMENTATION_CLASSES,
73
77
  DEFAULT_RECORDING_STATUSES,
74
78
  DEFAULT_WRITING_STATUSES,
75
79
  PROJECT_LOCALE_SCENE,
80
+ RERECORD_STATUS,
81
+ RERECORD_STATUS_DECL,
76
82
  castStringKey,
77
83
  deriveRecordingFolders,
78
84
  effectiveGameId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patterkit/model",
3
- "version": "0.1.2",
3
+ "version": "0.2.1",
4
4
  "description": "Patter data-model types: source (scene/block/group/snippet/beat/jump), project, locale, authoring. The shape source-of-truth.",
5
5
  "type": "module",
6
6
  "license": "MIT",