@patterkit/model 0.7.0 → 0.9.0
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/README.md +35 -0
- package/dist/index.cjs +6 -1
- package/dist/index.d.cts +114 -9
- package/dist/index.d.ts +114 -9
- package/dist/index.js +5 -1
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# @patterkit/model
|
|
2
|
+
|
|
3
|
+
The TypeScript types that describe Patter's data: the shape every other `@patterkit` package agrees on.
|
|
4
|
+
Types only, with no behaviour.
|
|
5
|
+
|
|
6
|
+
Most people won't need to install this directly. To play Patter dialogue in a game or web page, use
|
|
7
|
+
[`@patterkit/runtime`](https://www.npmjs.com/package/@patterkit/runtime); to work with Patter projects from
|
|
8
|
+
a terminal or a build script, use [`@patterkit/cli`](https://www.npmjs.com/package/@patterkit/cli).
|
|
9
|
+
|
|
10
|
+
## What's in it
|
|
11
|
+
|
|
12
|
+
- **The source format**: scenes and their flow tree (blocks, groups, snippets, beats, and jumps), the
|
|
13
|
+
project file, locale files, and the authoring file that holds comments, suggestions, and writing status.
|
|
14
|
+
- **The compiled bundle**: the `.patterc` a game loads, as written by the compiler and read by every runtime.
|
|
15
|
+
- **Shared helpers for addressing**: the game-facing ids (`gameIdify`, `isValidGameId`, `effectiveGameId`).
|
|
16
|
+
|
|
17
|
+
Conditions and effects are kept as source strings here; the expression language itself is
|
|
18
|
+
[`@wildwinter/expr`](https://www.npmjs.com/package/@wildwinter/expr). The format is described in
|
|
19
|
+
[the specification](https://patterkit.dev/specification/).
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
npm install @patterkit/model
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Part of Patter
|
|
26
|
+
|
|
27
|
+
[Patter](https://patterkit.dev/) is a branching dialogue format with its own editor (Patterpad), command line
|
|
28
|
+
tool (`patter`), and runtimes for JavaScript, Unity, Unreal, and Godot. This package is one layer of the
|
|
29
|
+
JavaScript tooling, and the other `@patterkit` packages build on it. [How it fits
|
|
30
|
+
together](https://patterkit.dev/architecture/) shows where each piece sits, and the source is in the
|
|
31
|
+
[patter repository](https://github.com/patterkit/patter).
|
|
32
|
+
|
|
33
|
+
## Licence
|
|
34
|
+
|
|
35
|
+
MIT
|
package/dist/index.cjs
CHANGED
|
@@ -26,6 +26,7 @@ __export(index_exports, {
|
|
|
26
26
|
DEFAULT_DOCUMENTATION_CLASSES: () => DEFAULT_DOCUMENTATION_CLASSES,
|
|
27
27
|
DEFAULT_RECORDING_STATUSES: () => DEFAULT_RECORDING_STATUSES,
|
|
28
28
|
DEFAULT_WRITING_STATUSES: () => DEFAULT_WRITING_STATUSES,
|
|
29
|
+
HANDOFF_SCHEMA: () => HANDOFF_SCHEMA,
|
|
29
30
|
PROJECT_LOCALE_SCENE: () => PROJECT_LOCALE_SCENE,
|
|
30
31
|
RERECORD_STATUS: () => RERECORD_STATUS,
|
|
31
32
|
RERECORD_STATUS_DECL: () => RERECORD_STATUS_DECL,
|
|
@@ -106,13 +107,16 @@ var DEFAULT_DOCUMENTATION_CLASSES = [
|
|
|
106
107
|
// every export, and (like all) the editor
|
|
107
108
|
{ name: "vo", deliver: ["vo"] },
|
|
108
109
|
// voice-recording scripts
|
|
109
|
-
{ name: "loc", deliver: ["loc"] }
|
|
110
|
+
{ name: "loc", deliver: ["loc"] },
|
|
110
111
|
// localisation handoff
|
|
112
|
+
{ name: "editor", deliver: ["editor"] }
|
|
113
|
+
// the editable script handed to an outside editor
|
|
111
114
|
];
|
|
112
115
|
var PROJECT_LOCALE_SCENE = "@project";
|
|
113
116
|
function castStringKey(name) {
|
|
114
117
|
return `cast:${name}`;
|
|
115
118
|
}
|
|
119
|
+
var HANDOFF_SCHEMA = "patter/handoff@0";
|
|
116
120
|
var DEFAULT_CAPTION_DELIMITERS = { open: "[", close: "]" };
|
|
117
121
|
var DEFAULT_CAPTION_CHARACTER = "SFX";
|
|
118
122
|
var SAVE_SCHEMA = "patter/save@0";
|
|
@@ -125,6 +129,7 @@ var SAVE_VERSION = 3;
|
|
|
125
129
|
DEFAULT_DOCUMENTATION_CLASSES,
|
|
126
130
|
DEFAULT_RECORDING_STATUSES,
|
|
127
131
|
DEFAULT_WRITING_STATUSES,
|
|
132
|
+
HANDOFF_SCHEMA,
|
|
128
133
|
PROJECT_LOCALE_SCENE,
|
|
129
134
|
RERECORD_STATUS,
|
|
130
135
|
RERECORD_STATUS_DECL,
|
package/dist/index.d.cts
CHANGED
|
@@ -417,8 +417,9 @@ interface DocumentationClass {
|
|
|
417
417
|
/**
|
|
418
418
|
* Export channels this class flows to: a list of channel names, or `"*"` for
|
|
419
419
|
* all. Omitted/empty = editor-only (e.g. "writing"). Built-in channels: `vo`
|
|
420
|
-
* (voice-recording scripts), `loc` (localisation handoff)
|
|
421
|
-
* own (e.g. `sfx`, `art`),
|
|
420
|
+
* (voice-recording scripts), `loc` (localisation handoff), `editor` (the editable
|
|
421
|
+
* script handed to an outside editor); studios add their own (e.g. `sfx`, `art`),
|
|
422
|
+
* carried now and picked up when that export exists.
|
|
422
423
|
*/
|
|
423
424
|
deliver?: string[] | "*";
|
|
424
425
|
}
|
|
@@ -656,12 +657,18 @@ interface Comment {
|
|
|
656
657
|
resolved?: boolean;
|
|
657
658
|
messages: CommentMessage[];
|
|
658
659
|
}
|
|
659
|
-
/** A "suggest a rewrite" proposal for a single say/prose beat (review flow,
|
|
660
|
-
* suggest-rewrite.md). Whole-beat anchored: `baseline` is the say text WHEN suggested
|
|
661
|
-
* the drift detector - if it no longer matches the live text, the line changed since and
|
|
662
|
-
* is shown stale), `proposed` is the replacement. Accept overwrites the beat's say text;
|
|
663
|
-
* reject set `resolved` (archived) + `outcome` (a light audit trail). Stored in the
|
|
664
|
-
* never in the flow text, so downstream tools ignore it.
|
|
660
|
+
/** A "suggest a rewrite" proposal for a single say/prose beat or option prompt (review flow,
|
|
661
|
+
* design/proposals/suggest-rewrite.md). Whole-beat anchored: `baseline` is the say text WHEN suggested
|
|
662
|
+
* (the "before" + the drift detector - if it no longer matches the live text, the line changed since and
|
|
663
|
+
* the suggestion is shown stale), `proposed` is the replacement. Accept overwrites the beat's say text;
|
|
664
|
+
* both accept and reject set `resolved` (archived) + `outcome` (a light audit trail). Stored in the
|
|
665
|
+
* authoring shard, never in the flow text, so downstream tools ignore it.
|
|
666
|
+
*
|
|
667
|
+
* Beyond the text, a suggestion may also propose a new speaker, a new direction, or cutting the beat
|
|
668
|
+
* (the editable-script handoff, design/proposals/editable-script-handoff.md). Each such part carries its
|
|
669
|
+
* own baseline, so each is stale-checked on its own; accept applies whichever parts are present. A
|
|
670
|
+
* suggestion that only changes the speaker or direction, or only cuts, keeps `proposed` equal to
|
|
671
|
+
* `baseline`. */
|
|
665
672
|
interface Suggestion {
|
|
666
673
|
id: string;
|
|
667
674
|
/** The say/prose beat's stable id. */
|
|
@@ -670,12 +677,36 @@ interface Suggestion {
|
|
|
670
677
|
baseline: string;
|
|
671
678
|
/** The proposed replacement say text. */
|
|
672
679
|
proposed: string;
|
|
680
|
+
/** The primary author: with several (`authors`), the one with the most changes. */
|
|
673
681
|
author: string;
|
|
682
|
+
/** Everyone whose changes this suggestion carries, when there is more than one (an editor's file with
|
|
683
|
+
* several people's tracked changes on one line). `author` stays the primary, so a reader that only
|
|
684
|
+
* knows `author` keeps working. */
|
|
685
|
+
authors?: string[];
|
|
674
686
|
ts: string;
|
|
687
|
+
/** A proposed new speaker (a known cast member's name), and the speaker when suggested. */
|
|
688
|
+
proposedCharacter?: string;
|
|
689
|
+
baselineCharacter?: string;
|
|
690
|
+
/** A proposed new direction (the parenthetical), and the direction when suggested ("" for none). */
|
|
691
|
+
proposedDirection?: string;
|
|
692
|
+
baselineDirection?: string;
|
|
693
|
+
/** A proposal to cut the beat (an editor emptied its line). Accept marks it cut. */
|
|
694
|
+
proposedCut?: boolean;
|
|
695
|
+
/** Where the suggestion came from, when it arrived in an editable-script handoff: the handoff and the
|
|
696
|
+
* line's marker in it. Drives the review's "from handoff" filter, and lets a re-import of the same
|
|
697
|
+
* handoff replace its still-open suggestions instead of stacking duplicates. */
|
|
698
|
+
handoff?: SuggestionSource;
|
|
675
699
|
/** Accepted or rejected -> archived (hidden unless "show resolved suggestions" is on). */
|
|
676
700
|
resolved?: boolean;
|
|
677
701
|
outcome?: "accepted" | "rejected";
|
|
678
702
|
}
|
|
703
|
+
/** The handoff a suggestion arrived in (see `Suggestion.handoff`). */
|
|
704
|
+
interface SuggestionSource {
|
|
705
|
+
/** The handoff's id ("H-7Q2K"). */
|
|
706
|
+
id: string;
|
|
707
|
+
/** The line's marker code in that handoff ("K7Q2M"). */
|
|
708
|
+
marker: string;
|
|
709
|
+
}
|
|
679
710
|
interface EditRecord {
|
|
680
711
|
modifiedAt?: string;
|
|
681
712
|
by?: string;
|
|
@@ -725,6 +756,74 @@ interface AuthoringFile {
|
|
|
725
756
|
*/
|
|
726
757
|
rerecord?: Record<string, boolean>;
|
|
727
758
|
}
|
|
759
|
+
declare const HANDOFF_SCHEMA = "patter/handoff@0";
|
|
760
|
+
interface HandoffFile {
|
|
761
|
+
schema: typeof HANDOFF_SCHEMA;
|
|
762
|
+
/** "H-7Q2K": shown in the document's page header, so a returned file finds its record. */
|
|
763
|
+
id: string;
|
|
764
|
+
createdAt: string;
|
|
765
|
+
createdBy: string;
|
|
766
|
+
/** The file format sent. */
|
|
767
|
+
format: "docx";
|
|
768
|
+
/** Who it went to, as typed at export (optional). */
|
|
769
|
+
recipient?: string;
|
|
770
|
+
/** The scene ids exported, in document order. */
|
|
771
|
+
range: {
|
|
772
|
+
scenes: string[];
|
|
773
|
+
};
|
|
774
|
+
options: {
|
|
775
|
+
/** Which notes rode along: a documentation channel name ("editor"), or "all". */
|
|
776
|
+
notes: string;
|
|
777
|
+
/** Each line's writing status shown as a tag. */
|
|
778
|
+
status: boolean;
|
|
779
|
+
/** A cast page before the script. */
|
|
780
|
+
cast: boolean;
|
|
781
|
+
};
|
|
782
|
+
/** Every editable line, keyed by its marker code ("K7Q2M"). */
|
|
783
|
+
lines: Record<string, HandoffLine>;
|
|
784
|
+
/** The whole document in order: context rows tied to the node they describe, and each editable line
|
|
785
|
+
* by marker. Lets the importer align what came back with what was sent, and anchor a comment made on
|
|
786
|
+
* a context row to its node. */
|
|
787
|
+
skeleton: HandoffRow[];
|
|
788
|
+
/** One entry per reimport, appended. */
|
|
789
|
+
imports?: HandoffImport[];
|
|
790
|
+
/** Set when the handoff is finished with; a closed handoff no longer appears in review filters. */
|
|
791
|
+
closed?: boolean;
|
|
792
|
+
}
|
|
793
|
+
/** An editable line as sent. */
|
|
794
|
+
interface HandoffLine {
|
|
795
|
+
/** The beat id (a line, a narration beat, or an option prompt). */
|
|
796
|
+
id: string;
|
|
797
|
+
kind: "line" | "narration" | "option";
|
|
798
|
+
/** The speaker and direction as sent (spoken lines only). */
|
|
799
|
+
character?: string;
|
|
800
|
+
direction?: string;
|
|
801
|
+
/** The text as sent: the baseline for every comparison on reimport. */
|
|
802
|
+
baseline: string;
|
|
803
|
+
}
|
|
804
|
+
/** One row of the sent document, in order. */
|
|
805
|
+
type HandoffRow = {
|
|
806
|
+
kind: "box";
|
|
807
|
+
marker: string;
|
|
808
|
+
} | {
|
|
809
|
+
kind: "scene" | "block" | "condition" | "group" | "else" | "jump" | "gameEvent" | "note";
|
|
810
|
+
node: string;
|
|
811
|
+
text: string;
|
|
812
|
+
};
|
|
813
|
+
/** A record of one reimport. */
|
|
814
|
+
interface HandoffImport {
|
|
815
|
+
at: string;
|
|
816
|
+
by: string;
|
|
817
|
+
/** SHA-256 of the returned file, so a second import of the same file is recognisable. */
|
|
818
|
+
fileHash: string;
|
|
819
|
+
counts: {
|
|
820
|
+
changed: number;
|
|
821
|
+
unchanged: number;
|
|
822
|
+
stale: number;
|
|
823
|
+
comments: number;
|
|
824
|
+
problems: number;
|
|
825
|
+
};
|
|
826
|
+
}
|
|
728
827
|
/** A compiled expression envelope: canonical source + pre-derived tagged-tuple AST. */
|
|
729
828
|
interface Expression {
|
|
730
829
|
src: string;
|
|
@@ -918,6 +1017,12 @@ interface FlowCursor {
|
|
|
918
1017
|
/** The chosen option owning a prompt still to be replayed (a save taken between choose + advance).
|
|
919
1018
|
* Optional / null in older saves -> no pending prompt. */
|
|
920
1019
|
pendingPromptOwnerId?: string | null;
|
|
1020
|
+
/** The prompt still to be replayed, exactly as the choice SHOWED it (text and speaker fields, the same
|
|
1021
|
+
* shape as a saved option's `prompt`), so the replay after a load says what the player saw. Written only
|
|
1022
|
+
* alongside a `pendingPromptOwnerId` (the choose -> advance window, with `replayPromptOnChoose`), and
|
|
1023
|
+
* absent otherwise. A save without it (written before Patterplay 0.18.0) resolves the owner's prompt beat
|
|
1024
|
+
* when it is delivered, as before. */
|
|
1025
|
+
pendingPrompt?: SavedChoicePrompt;
|
|
921
1026
|
/** This flow's (non-shared) selector cursors, keyed by group id. */
|
|
922
1027
|
selectors: Record<string, SelectorSnapshot>;
|
|
923
1028
|
}
|
|
@@ -963,4 +1068,4 @@ interface SaveGameV2 {
|
|
|
963
1068
|
flows: Record<string, FlowSnapshotV2>;
|
|
964
1069
|
}
|
|
965
1070
|
|
|
966
|
-
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 EngineSave, type EstimatingConfig, type Expression, type FlowCursor, type FlowFile, type FlowNode, type FlowSnapshot, type FlowSnapshotV2, 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, SAVE_SCHEMA, SAVE_VERSION, type SaveEnvelope, type SaveGame, type SaveGameV2, type SavedChoice, type SavedChoiceOption, type SavedChoicePrompt, type ScalarValue, type Scene, type Selector, type SelectorExhaust, type SelectorOrder, type SelectorSnapshot, type SequenceOptions, type Snippet, type StackFrame, type Suggestion, type TextBeat, type VcsKind, type WritingStatusDecl, castStringKey, deriveRecordingFolders, effectiveGameId, gameIdify, isContentlessBeat, isValidGameId, walkNodes };
|
|
1071
|
+
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 EngineSave, type EstimatingConfig, type Expression, type FlowCursor, type FlowFile, type FlowNode, type FlowSnapshot, type FlowSnapshotV2, type GameData, type GameDataField, type GameDataFieldType, type GameDataFields, type GameDataNodeKind, type GameEventBeat, type GrammaticalGender, type Group, HANDOFF_SCHEMA, type HandoffFile, type HandoffImport, type HandoffLine, type HandoffRow, 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, SAVE_SCHEMA, SAVE_VERSION, type SaveEnvelope, type SaveGame, type SaveGameV2, type SavedChoice, type SavedChoiceOption, type SavedChoicePrompt, type ScalarValue, type Scene, type Selector, type SelectorExhaust, type SelectorOrder, type SelectorSnapshot, type SequenceOptions, type Snippet, type StackFrame, type Suggestion, type SuggestionSource, type TextBeat, type VcsKind, type WritingStatusDecl, castStringKey, deriveRecordingFolders, effectiveGameId, gameIdify, isContentlessBeat, isValidGameId, walkNodes };
|
package/dist/index.d.ts
CHANGED
|
@@ -417,8 +417,9 @@ interface DocumentationClass {
|
|
|
417
417
|
/**
|
|
418
418
|
* Export channels this class flows to: a list of channel names, or `"*"` for
|
|
419
419
|
* all. Omitted/empty = editor-only (e.g. "writing"). Built-in channels: `vo`
|
|
420
|
-
* (voice-recording scripts), `loc` (localisation handoff)
|
|
421
|
-
* own (e.g. `sfx`, `art`),
|
|
420
|
+
* (voice-recording scripts), `loc` (localisation handoff), `editor` (the editable
|
|
421
|
+
* script handed to an outside editor); studios add their own (e.g. `sfx`, `art`),
|
|
422
|
+
* carried now and picked up when that export exists.
|
|
422
423
|
*/
|
|
423
424
|
deliver?: string[] | "*";
|
|
424
425
|
}
|
|
@@ -656,12 +657,18 @@ interface Comment {
|
|
|
656
657
|
resolved?: boolean;
|
|
657
658
|
messages: CommentMessage[];
|
|
658
659
|
}
|
|
659
|
-
/** A "suggest a rewrite" proposal for a single say/prose beat (review flow,
|
|
660
|
-
* suggest-rewrite.md). Whole-beat anchored: `baseline` is the say text WHEN suggested
|
|
661
|
-
* the drift detector - if it no longer matches the live text, the line changed since and
|
|
662
|
-
* is shown stale), `proposed` is the replacement. Accept overwrites the beat's say text;
|
|
663
|
-
* reject set `resolved` (archived) + `outcome` (a light audit trail). Stored in the
|
|
664
|
-
* never in the flow text, so downstream tools ignore it.
|
|
660
|
+
/** A "suggest a rewrite" proposal for a single say/prose beat or option prompt (review flow,
|
|
661
|
+
* design/proposals/suggest-rewrite.md). Whole-beat anchored: `baseline` is the say text WHEN suggested
|
|
662
|
+
* (the "before" + the drift detector - if it no longer matches the live text, the line changed since and
|
|
663
|
+
* the suggestion is shown stale), `proposed` is the replacement. Accept overwrites the beat's say text;
|
|
664
|
+
* both accept and reject set `resolved` (archived) + `outcome` (a light audit trail). Stored in the
|
|
665
|
+
* authoring shard, never in the flow text, so downstream tools ignore it.
|
|
666
|
+
*
|
|
667
|
+
* Beyond the text, a suggestion may also propose a new speaker, a new direction, or cutting the beat
|
|
668
|
+
* (the editable-script handoff, design/proposals/editable-script-handoff.md). Each such part carries its
|
|
669
|
+
* own baseline, so each is stale-checked on its own; accept applies whichever parts are present. A
|
|
670
|
+
* suggestion that only changes the speaker or direction, or only cuts, keeps `proposed` equal to
|
|
671
|
+
* `baseline`. */
|
|
665
672
|
interface Suggestion {
|
|
666
673
|
id: string;
|
|
667
674
|
/** The say/prose beat's stable id. */
|
|
@@ -670,12 +677,36 @@ interface Suggestion {
|
|
|
670
677
|
baseline: string;
|
|
671
678
|
/** The proposed replacement say text. */
|
|
672
679
|
proposed: string;
|
|
680
|
+
/** The primary author: with several (`authors`), the one with the most changes. */
|
|
673
681
|
author: string;
|
|
682
|
+
/** Everyone whose changes this suggestion carries, when there is more than one (an editor's file with
|
|
683
|
+
* several people's tracked changes on one line). `author` stays the primary, so a reader that only
|
|
684
|
+
* knows `author` keeps working. */
|
|
685
|
+
authors?: string[];
|
|
674
686
|
ts: string;
|
|
687
|
+
/** A proposed new speaker (a known cast member's name), and the speaker when suggested. */
|
|
688
|
+
proposedCharacter?: string;
|
|
689
|
+
baselineCharacter?: string;
|
|
690
|
+
/** A proposed new direction (the parenthetical), and the direction when suggested ("" for none). */
|
|
691
|
+
proposedDirection?: string;
|
|
692
|
+
baselineDirection?: string;
|
|
693
|
+
/** A proposal to cut the beat (an editor emptied its line). Accept marks it cut. */
|
|
694
|
+
proposedCut?: boolean;
|
|
695
|
+
/** Where the suggestion came from, when it arrived in an editable-script handoff: the handoff and the
|
|
696
|
+
* line's marker in it. Drives the review's "from handoff" filter, and lets a re-import of the same
|
|
697
|
+
* handoff replace its still-open suggestions instead of stacking duplicates. */
|
|
698
|
+
handoff?: SuggestionSource;
|
|
675
699
|
/** Accepted or rejected -> archived (hidden unless "show resolved suggestions" is on). */
|
|
676
700
|
resolved?: boolean;
|
|
677
701
|
outcome?: "accepted" | "rejected";
|
|
678
702
|
}
|
|
703
|
+
/** The handoff a suggestion arrived in (see `Suggestion.handoff`). */
|
|
704
|
+
interface SuggestionSource {
|
|
705
|
+
/** The handoff's id ("H-7Q2K"). */
|
|
706
|
+
id: string;
|
|
707
|
+
/** The line's marker code in that handoff ("K7Q2M"). */
|
|
708
|
+
marker: string;
|
|
709
|
+
}
|
|
679
710
|
interface EditRecord {
|
|
680
711
|
modifiedAt?: string;
|
|
681
712
|
by?: string;
|
|
@@ -725,6 +756,74 @@ interface AuthoringFile {
|
|
|
725
756
|
*/
|
|
726
757
|
rerecord?: Record<string, boolean>;
|
|
727
758
|
}
|
|
759
|
+
declare const HANDOFF_SCHEMA = "patter/handoff@0";
|
|
760
|
+
interface HandoffFile {
|
|
761
|
+
schema: typeof HANDOFF_SCHEMA;
|
|
762
|
+
/** "H-7Q2K": shown in the document's page header, so a returned file finds its record. */
|
|
763
|
+
id: string;
|
|
764
|
+
createdAt: string;
|
|
765
|
+
createdBy: string;
|
|
766
|
+
/** The file format sent. */
|
|
767
|
+
format: "docx";
|
|
768
|
+
/** Who it went to, as typed at export (optional). */
|
|
769
|
+
recipient?: string;
|
|
770
|
+
/** The scene ids exported, in document order. */
|
|
771
|
+
range: {
|
|
772
|
+
scenes: string[];
|
|
773
|
+
};
|
|
774
|
+
options: {
|
|
775
|
+
/** Which notes rode along: a documentation channel name ("editor"), or "all". */
|
|
776
|
+
notes: string;
|
|
777
|
+
/** Each line's writing status shown as a tag. */
|
|
778
|
+
status: boolean;
|
|
779
|
+
/** A cast page before the script. */
|
|
780
|
+
cast: boolean;
|
|
781
|
+
};
|
|
782
|
+
/** Every editable line, keyed by its marker code ("K7Q2M"). */
|
|
783
|
+
lines: Record<string, HandoffLine>;
|
|
784
|
+
/** The whole document in order: context rows tied to the node they describe, and each editable line
|
|
785
|
+
* by marker. Lets the importer align what came back with what was sent, and anchor a comment made on
|
|
786
|
+
* a context row to its node. */
|
|
787
|
+
skeleton: HandoffRow[];
|
|
788
|
+
/** One entry per reimport, appended. */
|
|
789
|
+
imports?: HandoffImport[];
|
|
790
|
+
/** Set when the handoff is finished with; a closed handoff no longer appears in review filters. */
|
|
791
|
+
closed?: boolean;
|
|
792
|
+
}
|
|
793
|
+
/** An editable line as sent. */
|
|
794
|
+
interface HandoffLine {
|
|
795
|
+
/** The beat id (a line, a narration beat, or an option prompt). */
|
|
796
|
+
id: string;
|
|
797
|
+
kind: "line" | "narration" | "option";
|
|
798
|
+
/** The speaker and direction as sent (spoken lines only). */
|
|
799
|
+
character?: string;
|
|
800
|
+
direction?: string;
|
|
801
|
+
/** The text as sent: the baseline for every comparison on reimport. */
|
|
802
|
+
baseline: string;
|
|
803
|
+
}
|
|
804
|
+
/** One row of the sent document, in order. */
|
|
805
|
+
type HandoffRow = {
|
|
806
|
+
kind: "box";
|
|
807
|
+
marker: string;
|
|
808
|
+
} | {
|
|
809
|
+
kind: "scene" | "block" | "condition" | "group" | "else" | "jump" | "gameEvent" | "note";
|
|
810
|
+
node: string;
|
|
811
|
+
text: string;
|
|
812
|
+
};
|
|
813
|
+
/** A record of one reimport. */
|
|
814
|
+
interface HandoffImport {
|
|
815
|
+
at: string;
|
|
816
|
+
by: string;
|
|
817
|
+
/** SHA-256 of the returned file, so a second import of the same file is recognisable. */
|
|
818
|
+
fileHash: string;
|
|
819
|
+
counts: {
|
|
820
|
+
changed: number;
|
|
821
|
+
unchanged: number;
|
|
822
|
+
stale: number;
|
|
823
|
+
comments: number;
|
|
824
|
+
problems: number;
|
|
825
|
+
};
|
|
826
|
+
}
|
|
728
827
|
/** A compiled expression envelope: canonical source + pre-derived tagged-tuple AST. */
|
|
729
828
|
interface Expression {
|
|
730
829
|
src: string;
|
|
@@ -918,6 +1017,12 @@ interface FlowCursor {
|
|
|
918
1017
|
/** The chosen option owning a prompt still to be replayed (a save taken between choose + advance).
|
|
919
1018
|
* Optional / null in older saves -> no pending prompt. */
|
|
920
1019
|
pendingPromptOwnerId?: string | null;
|
|
1020
|
+
/** The prompt still to be replayed, exactly as the choice SHOWED it (text and speaker fields, the same
|
|
1021
|
+
* shape as a saved option's `prompt`), so the replay after a load says what the player saw. Written only
|
|
1022
|
+
* alongside a `pendingPromptOwnerId` (the choose -> advance window, with `replayPromptOnChoose`), and
|
|
1023
|
+
* absent otherwise. A save without it (written before Patterplay 0.18.0) resolves the owner's prompt beat
|
|
1024
|
+
* when it is delivered, as before. */
|
|
1025
|
+
pendingPrompt?: SavedChoicePrompt;
|
|
921
1026
|
/** This flow's (non-shared) selector cursors, keyed by group id. */
|
|
922
1027
|
selectors: Record<string, SelectorSnapshot>;
|
|
923
1028
|
}
|
|
@@ -963,4 +1068,4 @@ interface SaveGameV2 {
|
|
|
963
1068
|
flows: Record<string, FlowSnapshotV2>;
|
|
964
1069
|
}
|
|
965
1070
|
|
|
966
|
-
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 EngineSave, type EstimatingConfig, type Expression, type FlowCursor, type FlowFile, type FlowNode, type FlowSnapshot, type FlowSnapshotV2, 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, SAVE_SCHEMA, SAVE_VERSION, type SaveEnvelope, type SaveGame, type SaveGameV2, type SavedChoice, type SavedChoiceOption, type SavedChoicePrompt, type ScalarValue, type Scene, type Selector, type SelectorExhaust, type SelectorOrder, type SelectorSnapshot, type SequenceOptions, type Snippet, type StackFrame, type Suggestion, type TextBeat, type VcsKind, type WritingStatusDecl, castStringKey, deriveRecordingFolders, effectiveGameId, gameIdify, isContentlessBeat, isValidGameId, walkNodes };
|
|
1071
|
+
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 EngineSave, type EstimatingConfig, type Expression, type FlowCursor, type FlowFile, type FlowNode, type FlowSnapshot, type FlowSnapshotV2, type GameData, type GameDataField, type GameDataFieldType, type GameDataFields, type GameDataNodeKind, type GameEventBeat, type GrammaticalGender, type Group, HANDOFF_SCHEMA, type HandoffFile, type HandoffImport, type HandoffLine, type HandoffRow, 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, SAVE_SCHEMA, SAVE_VERSION, type SaveEnvelope, type SaveGame, type SaveGameV2, type SavedChoice, type SavedChoiceOption, type SavedChoicePrompt, type ScalarValue, type Scene, type Selector, type SelectorExhaust, type SelectorOrder, type SelectorSnapshot, type SequenceOptions, type Snippet, type StackFrame, type Suggestion, type SuggestionSource, type TextBeat, type VcsKind, type WritingStatusDecl, castStringKey, deriveRecordingFolders, effectiveGameId, gameIdify, isContentlessBeat, isValidGameId, walkNodes };
|
package/dist/index.js
CHANGED
|
@@ -66,13 +66,16 @@ var DEFAULT_DOCUMENTATION_CLASSES = [
|
|
|
66
66
|
// every export, and (like all) the editor
|
|
67
67
|
{ name: "vo", deliver: ["vo"] },
|
|
68
68
|
// voice-recording scripts
|
|
69
|
-
{ name: "loc", deliver: ["loc"] }
|
|
69
|
+
{ name: "loc", deliver: ["loc"] },
|
|
70
70
|
// localisation handoff
|
|
71
|
+
{ name: "editor", deliver: ["editor"] }
|
|
72
|
+
// the editable script handed to an outside editor
|
|
71
73
|
];
|
|
72
74
|
var PROJECT_LOCALE_SCENE = "@project";
|
|
73
75
|
function castStringKey(name) {
|
|
74
76
|
return `cast:${name}`;
|
|
75
77
|
}
|
|
78
|
+
var HANDOFF_SCHEMA = "patter/handoff@0";
|
|
76
79
|
var DEFAULT_CAPTION_DELIMITERS = { open: "[", close: "]" };
|
|
77
80
|
var DEFAULT_CAPTION_CHARACTER = "SFX";
|
|
78
81
|
var SAVE_SCHEMA = "patter/save@0";
|
|
@@ -84,6 +87,7 @@ export {
|
|
|
84
87
|
DEFAULT_DOCUMENTATION_CLASSES,
|
|
85
88
|
DEFAULT_RECORDING_STATUSES,
|
|
86
89
|
DEFAULT_WRITING_STATUSES,
|
|
90
|
+
HANDOFF_SCHEMA,
|
|
87
91
|
PROJECT_LOCALE_SCENE,
|
|
88
92
|
RERECORD_STATUS,
|
|
89
93
|
RERECORD_STATUS_DECL,
|
package/package.json
CHANGED